/* ============================================================
   Binance AI Trading Dashboard — Design System
   Premium dark theme with glassmorphism & micro-animations
   ============================================================ */

:root {
  /* Background */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a1f2e;
  --bg-card-hover: #1f2537;
  --bg-input: #0d1117;

  /* Accent Colors */
  --green: #00d68f;
  --green-dim: rgba(0, 214, 143, 0.15);
  --red: #ff3d71;
  --red-dim: rgba(255, 61, 113, 0.15);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.15);
  --orange: #f59e0b;
  --orange-dim: rgba(245, 158, 11, 0.15);
  --purple: #8b5cf6;
  --purple-dim: rgba(139, 92, 246, 0.15);
  --cyan: #06b6d4;

  /* Text */
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Border */
  --border: #1f2937;
  --border-light: #374151;

  /* Glass */
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow-green: 0 0 20px rgba(0, 214, 143, 0.15);
  --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
  --shadow-glow-red: 0 0 20px rgba(255, 61, 113, 0.15);

  /* Sizing */
  --sidebar-width: 220px;
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   SIDEBAR
   ============================================================ */

#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.brand-icon { font-size: 28px; }
.brand-name { font-weight: 700; font-size: 15px; display: block; }
.brand-version { font-size: 11px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.5px; }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: var(--glass);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
  color: var(--blue);
  font-weight: 600;
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--green); }
  50% { opacity: 0.5; box-shadow: 0 0 12px var(--green); }
}

#live-label { color: var(--green); font-weight: 700; letter-spacing: 1px; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */

#main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px 32px;
  max-width: calc(100vw - var(--sidebar-width));
}

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Page Header ---- */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-desc { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.header-badges { display: flex; gap: 8px; }
.header-controls { display: flex; gap: 8px; }

/* ---- Badge ---- */

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-live { background: var(--green-dim); color: var(--green); }
.badge-dry { background: var(--orange-dim); color: var(--orange); }
.badge-info { background: var(--blue-dim); color: var(--blue); }
.badge-danger { background: var(--red-dim); color: var(--red); }

/* ---- Cards ---- */

.cards-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all 0.25s ease;
  margin-bottom: 20px;
}

.card:hover { border-color: var(--border-light); }

.card-glow-green { box-shadow: var(--shadow-glow-green); border-color: rgba(0, 214, 143, 0.2); }
.card-glow-blue { box-shadow: var(--shadow-glow-blue); border-color: rgba(59, 130, 246, 0.2); }
.card-glow-red { box-shadow: var(--shadow-glow-red); border-color: rgba(255, 61, 113, 0.2); }

.card-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-value {
  font-size: 28px;
  font-weight: 800;
  font-feature-settings: 'tnum';
  line-height: 1.2;
}

.card-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.card-sm .card-value { font-size: 14px; font-weight: 600; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.text-sm { font-size: 14px !important; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green) !important; }
.text-red { color: var(--red) !important; }
.text-orange { color: var(--orange) !important; }
.text-blue { color: var(--blue) !important; }
.text-purple { color: var(--purple) !important; }
.mb-16 { margin-bottom: 16px; }

/* ---- Slot Visualization ---- */

.slot-grid {
  display: flex;
  gap: 12px;
  padding: 8px 0;
}

.slot-item {
  flex: 1;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-light);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.slot-item.filled {
  border-style: solid;
  animation: slotPulse 3s ease-in-out infinite;
}

.slot-item.conservative.filled { border-color: var(--green); background: var(--green-dim); color: var(--green); }
.slot-item.momentum.filled { border-color: var(--red); background: var(--red-dim); color: var(--red); }
.slot-item.volatility.filled { border-color: var(--orange); background: var(--orange-dim); color: var(--orange); }

@keyframes slotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.slot-symbol { font-weight: 700; font-size: 12px; }
.slot-pl { font-size: 10px; margin-top: 2px; }

/* ---- Regime Bar ---- */

.regime-bar {
  height: 8px;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--green));
  border-radius: 4px;
  position: relative;
  margin: 12px 0 8px;
}

.regime-marker {
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
  transition: left 0.5s ease;
}

.regime-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---- Positions Mini Cards ---- */

.positions-mini {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.pos-mini-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pos-mini-card:hover { border-color: var(--blue); transform: translateY(-2px); }
.pos-mini-card .pos-symbol { font-weight: 700; font-size: 14px; }
.pos-mini-card .pos-profile { font-size: 10px; margin-left: 6px; }
.pos-mini-card .pos-pl { font-size: 20px; font-weight: 800; margin: 6px 0 2px; font-feature-settings: 'tnum'; }
.pos-mini-card .pos-info { font-size: 11px; color: var(--text-muted); }

/* ---- Tables ---- */

.table-wrap { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-feature-settings: 'tnum';
}

.data-table tr:hover td { background: var(--glass); }

.data-table .pl-positive { color: var(--green); font-weight: 700; }
.data-table .pl-negative { color: var(--red); font-weight: 700; }

/* ---- Profile Badge ---- */

.profile-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.profile-conservative { background: var(--green-dim); color: var(--green); }
.profile-momentum_breakout { background: var(--red-dim); color: var(--red); }
.profile-volatility_harvester { background: var(--orange-dim); color: var(--orange); }

/* ---- Buttons ---- */

.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: #2563eb; transform: translateY(-1px); }
.btn-secondary { background: var(--bg-secondary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--blue); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #e11d48; }
.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-icon { padding: 6px 8px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 14px; }

.link-btn {
  color: var(--blue);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: color 0.2s;
}
.link-btn:hover { color: #60a5fa; }

/* ---- Form Elements ---- */

.text-input, .select-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  width: 100%;
}

.text-input:focus, .select-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim);
}

.form-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 160px; flex: 1; }
.form-group label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.form-action { justify-content: flex-end; }

/* ---- Calibration Display ---- */

.calibration-display {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
}

.cal-item { text-align: center; }
.cal-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.cal-value { font-size: 32px; font-weight: 800; }
.cal-highlight { color: var(--green); }
.cal-arrow { font-size: 24px; color: var(--text-muted); }

/* ---- Config Grid ---- */

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.config-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.config-key { color: var(--text-muted); }
.config-val { font-weight: 600; font-feature-settings: 'tnum'; }

/* ---- Tag List ---- */

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.sub-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* ---- Log Viewer ---- */

.log-viewer {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---- Empty State ---- */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }

/* ---- Toast ---- */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  max-width: 400px;
}

.toast-success { border-left: 4px solid var(--green); }
.toast-error { border-left: 4px solid var(--red); }
.toast-info { border-left: 4px solid var(--blue); }

@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(10px); } }

/* ---- Dialog ---- */

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.dialog-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.dialog-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.dialog-message { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---- Pagination ---- */

.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
}

.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.pagination button.active { background: var(--blue); color: white; border-color: var(--blue); }

/* ---- Canvas Charts ---- */

canvas {
  width: 100% !important;
  max-height: 220px;
}

/* ---- Auto-blacklist items ---- */

.bl-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 12px;
}

.bl-item .bl-symbol { font-weight: 700; color: var(--red); }
.bl-item .bl-reason { color: var(--text-muted); margin-left: 8px; }
.bl-item .bl-until { color: var(--text-secondary); font-size: 11px; }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */

.login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 50000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 40px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(59, 130, 246, 0.08);
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

.login-brand h1 {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-brand p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.login-error {
  background: var(--red-dim);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

#login-form .form-group {
  margin-bottom: 16px;
  min-width: unset;
}

#login-form .text-input {
  padding: 12px 14px;
  font-size: 15px;
}

/* ============================================================
   MOBILE HEADER
   ============================================================ */

#mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 200;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.mobile-title {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}

/* Hamburger menu button */
.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 28px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================================
   MOBILE POSITION CARDS (replaces table on phone)
   ============================================================ */

.pos-card-mobile {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}

.pos-card-mobile .pos-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pos-card-mobile .pos-row:last-child { margin-bottom: 0; }

.pos-card-mobile .pos-symbol-lg {
  font-weight: 800;
  font-size: 16px;
}

.pos-card-mobile .pos-pl-lg {
  font-size: 22px;
  font-weight: 800;
  font-feature-settings: 'tnum';
}

.pos-card-mobile .pos-detail {
  font-size: 12px;
  color: var(--text-muted);
}

.pos-card-mobile .pos-detail strong {
  color: var(--text-secondary);
}

.pos-card-mobile .pos-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.pos-card-mobile .pos-actions .btn { flex: 1; justify-content: center; }

/* ============================================================
   RESPONSIVE — Tablet (≤1200px)
   ============================================================ */

@media (max-width: 1200px) {
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RESPONSIVE — Mobile (≤768px)
   ============================================================ */

@media (max-width: 768px) {
  /* Show mobile header */
  #mobile-header { display: flex; }

  /* Sidebar: off-screen by default, slide in when open */
  #sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 150;
  }

  #sidebar.open {
    transform: translateX(0);
  }

  /* Main content: full width, account for mobile header */
  #main-content {
    margin-left: 0;
    max-width: 100vw;
    padding: 72px 16px 24px;
  }

  /* Page header stacking */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .page-header h1 { font-size: 18px; }
  .page-desc { font-size: 12px; }

  /* Card grids stack */
  .cards-grid { gap: 10px; margin-bottom: 12px; }
  .cards-4, .cards-3, .cards-2 { grid-template-columns: 1fr; }

  /* Cards compact */
  .card { padding: 14px; margin-bottom: 12px; border-radius: 10px; }
  .card-value { font-size: 22px; }
  .card-sm .card-value { font-size: 13px; }

  /* Slot grid: wrap on mobile */
  .slot-grid { flex-wrap: wrap; gap: 8px; }
  .slot-item { min-width: calc(33% - 8px); height: 48px; font-size: 10px; }

  /* Positions mini cards */
  .positions-mini { grid-template-columns: 1fr; }
  .pos-mini-card .pos-pl { font-size: 18px; }

  /* Tables: horizontal scroll + compact */
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .data-table { font-size: 11px; }
  .data-table th, .data-table td { padding: 8px 6px; white-space: nowrap; }

  /* Forms stack vertically */
  .form-row { flex-direction: column; gap: 12px; }
  .form-group { min-width: unset; width: 100%; }

  /* Calibration display */
  .cal-value { font-size: 24px; }
  .calibration-display { gap: 12px; }

  /* Config grid single column */
  .config-grid { grid-template-columns: 1fr; }

  /* Log viewer */
  .log-viewer { font-size: 10px; max-height: 300px; padding: 12px; }

  /* Toast at bottom */
  #toast-container { bottom: 16px; right: 12px; left: 12px; }
  .toast { max-width: none; font-size: 12px; }

  /* Dialog full-width on mobile */
  .dialog-box { max-width: none; margin: 0 12px; }

  /* Sidebar nav items: larger touch targets */
  .nav-item { padding: 14px 16px; font-size: 14px; }
  .nav-icon { font-size: 18px; }

  /* Header badges wrap */
  .header-badges { flex-wrap: wrap; }
  .header-controls { width: 100%; }
  .header-controls .select-input { width: 100%; }
}

/* ============================================================
   RESPONSIVE — Small phone (≤480px)
   ============================================================ */

@media (max-width: 480px) {
  #main-content { padding: 64px 12px 20px; }
  .card { padding: 12px; }
  .card-value { font-size: 20px; }
  .slot-item { min-width: calc(50% - 6px); }
  .btn { padding: 10px 14px; font-size: 13px; }
  .btn-sm { padding: 8px 12px; font-size: 12px; }
}
