/* ============================================================
   BoostGrid — Main CSS
   Clean, minimal, professional design system
   ============================================================ */

/* ── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0d0d;
  --surface:   #161616;
  --surface2:  #1e1e1e;
  --surface3:  #252525;
  --border:    #2a2a2a;
  --border2:   #363636;

  --accent:    #6366f1;
  --accent-h:  #4f52d3;
  --accent-bg: rgba(99,102,241,.1);
  --accent-bd: rgba(99,102,241,.25);

  --green:     #22c55e;
  --green-bg:  rgba(34,197,94,.1);
  --green-bd:  rgba(34,197,94,.2);

  --red:       #ef4444;
  --red-bg:    rgba(239,68,68,.1);
  --red-bd:    rgba(239,68,68,.2);

  --yellow:    #eab308;
  --yellow-bg: rgba(234,179,8,.1);
  --yellow-bd: rgba(234,179,8,.2);

  --blue:      #3b82f6;
  --blue-bg:   rgba(59,130,246,.1);

  --fg:        #f5f5f5;
  --fg2:       #a3a3a3;
  --fg3:       #6b6b6b;
  --fg4:       #3f3f3f;

  --radius:    10px;
  --radius-sm: 7px;
  --radius-xs: 5px;

  --sidebar-w: 240px;
  --topbar-h:  58px;
  --transition: .15s ease;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code {
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: .82em;
  background: var(--surface3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--fg2);
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════ */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: opacity 0.2s;
}

.sidebar-logo-img:hover {
  opacity: 0.85;
}

/* Legacy — kept for fallback */
.brand-logo { display: none; }
.brand-name  { display: none; }

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

.nav-section {
  font-size: .68rem;
  font-weight: 600;
  color: var(--fg3);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 12px 8px 5px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--fg3);
  font-size: .855rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover { background: var(--surface2); color: var(--fg2); }
.nav-item.active { background: var(--accent-bg); color: var(--fg); }
.nav-item.active i { color: var(--accent); }
.nav-item i { width: 16px; text-align: center; flex-shrink: 0; font-size: .82rem; }
.nav-item.hidden { display: none; }

.nav-badge {
  margin-left: auto;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-bd);
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 50px;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  margin-bottom: 8px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
}

.user-name {
  font-size: .83rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-balance { font-size: .75rem; color: var(--green); font-weight: 500; }

/* ── Content ──────────────────────────────────────────────── */
.content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 12px;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: .93rem; font-weight: 600; color: var(--fg); }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.balance-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 50px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  color: var(--cyan);
  transition: all var(--transition);
  white-space: nowrap;
}

.balance-chip:hover { border-color: var(--border2); }
.balance-chip i { font-size: .72rem; color: var(--fg3); }
.balance-chip .pbc-name {
  font-size: .68rem;
  font-weight: 400;
  color: var(--fg3);
  margin-right: 2px;
}

/* External panel balance chips in topbar */
.panel-bal-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 50px;
  cursor: pointer;
  font-size: .78rem;
  font-weight: 600;
  color: var(--cyan);
  transition: all var(--transition);
  white-space: nowrap;
}
.panel-bal-chip:hover { border-color: var(--border2); }
.panel-bal-chip i     { font-size: .72rem; color: var(--fg3); }
.panel-bal-chip .pbc-name {
  font-size: .68rem;
  font-weight: 400;
  color: var(--fg3);
  margin-right: 2px;
}
/* Hide panel chips on very small screens — show only main balance */
@media (max-width: 640px) {
  #panelBalanceChips { display: none !important; }
}

.sidebar-toggle-btn {
  background: none;
  border: none;
  color: var(--fg3);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  font-size: .9rem;
  display: none;
  transition: color var(--transition);
}
.sidebar-toggle-btn:hover { color: var(--fg); }

/* ── Pages ────────────────────────────────────────────────── */
.pages { flex: 1; overflow-y: auto; overflow-x: hidden; }
.page { display: none; padding: 24px; animation: pageFade .2s ease; }
.page.active { display: block; }
@keyframes pageFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Page header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.page-header-left h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 3px; }
.page-header-left h2 i { color: var(--accent); margin-right: 6px; font-size: 1rem; }
.page-header-left p { font-size: .82rem; color: var(--fg3); }

/* ═══════════════════════════════════════════════════════════
   COMPONENTS
═══════════════════════════════════════════════════════════ */

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-title {
  font-size: .88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--fg);
}
.card-title i { color: var(--accent); font-size: .85rem; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-header-title {
  font-size: .88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-header-title i { color: var(--accent); font-size: .82rem; }

.mt-16 { margin-top: 16px; }
.mt-12 { margin-top: 12px; }
.mt-8 { margin-top: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }

/* ── Stat cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border2); }

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  margin-bottom: 6px;
}
.stat-icon.green  { background: var(--green-bg); color: var(--green); }
.stat-icon.purple { background: var(--accent-bg); color: var(--accent); }
.stat-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }
.stat-icon.blue   { background: var(--blue-bg); color: var(--blue); }
.stat-icon.red    { background: var(--red-bg); color: var(--red); }
.stat-icon.cyan   { background: rgba(6,182,212,.1); color: #06b6d4; }
.stat-icon.pink   { background: rgba(236,72,153,.1); color: #ec4899; }

.stat-label { font-size: .78rem; color: var(--fg3); font-weight: 500; }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-sub   { font-size: .72rem; color: var(--fg3); }
.stat-action {
  margin-top: 2px;
  font-size: .76rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-family: inherit;
}
.stat-action:hover { text-decoration: underline; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .83rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-h); border-color: var(--accent-h); }

.btn-secondary {
  background: var(--surface2);
  color: var(--fg2);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface3); color: var(--fg); border-color: var(--border2); }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-bd);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,68,68,.18); }

.btn-success {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green-bd);
}
.btn-success:hover:not(:disabled) { background: rgba(34,197,94,.18); }

.btn-sm  { padding: 6px 12px; font-size: .78rem; }
.btn-xs  { padding: 4px 9px; font-size: .73rem; }
.btn-full { width: 100%; justify-content: center; }

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fg3);
  transition: all var(--transition);
  font-size: .78rem;
}
.btn-icon:hover { background: var(--surface3); color: var(--fg); border-color: var(--border2); }

.btn .spin { animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--fg2);
  margin-bottom: 6px;
}
.form-label i { color: var(--accent); margin-right: 4px; font-size: .75rem; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: .85rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.form-input::placeholder { color: var(--fg4); }
.form-textarea { resize: vertical; min-height: 80px; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b6b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-hint { font-size: .73rem; color: var(--fg3); margin-top: 4px; }
.form-group.has-error .form-input { border-color: var(--red); }

.form-row   { display: grid; gap: 12px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.input-group { display: flex; }
.input-group .form-input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); flex: 1; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; flex-shrink: 0; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 50px;
  cursor: pointer;
  transition: .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; top: 2px;
  background: var(--fg3);
  border-radius: 50%;
  transition: .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); background: #fff; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green  { background: var(--green-bg); color: var(--green); }
.badge-red    { background: var(--red-bg); color: var(--red); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-gray   { background: var(--surface3); color: var(--fg3); border: 1px solid var(--border); }
.badge-purple { background: var(--accent-bg); color: var(--accent); }
.badge-blue   { background: var(--blue-bg); color: var(--blue); }
.badge-cyan   { background: rgba(6,182,212,.1); color: #06b6d4; }
.badge-orange { background: rgba(249,115,22,.1); color: #f97316; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  line-height: 1.4;
}
.alert.show { display: flex; }
.alert-error   { background: var(--red-bg); border: 1px solid var(--red-bd); color: #fca5a5; }
.alert-success { background: var(--green-bg); border: 1px solid var(--green-bd); color: #86efac; }
.alert-info    { background: var(--accent-bg); border: 1px solid var(--accent-bd); color: #a5b4fc; }
.alert-warning { background: var(--yellow-bg); border: 1px solid var(--yellow-bd); color: #fde68a; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.vf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
}

.vf-table th {
  padding: 9px 12px;
  text-align: left;
  color: var(--fg3);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.vf-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--fg);
}

.vf-table tr:last-child td { border-bottom: none; }
.vf-table tbody tr:hover { background: rgba(255,255,255,.015); }

.td-muted  { color: var(--fg2); }
.td-url    { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg3); font-size: .79rem; }
.td-actions { display: flex; gap: 5px; align-items: center; }
.empty-row td { text-align: center; color: var(--fg3); padding: 32px !important; }

/* ── OS Strategy Builder \u2014 Slot Table ───────────────────────── */
.os-slot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .75rem;
}
.os-slot-table thead tr {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
}
.os-slot-table th {
  padding: 5px 7px;
  text-align: left;
  font-weight: 600;
  color: var(--fg3);
  white-space: nowrap;
  font-size: .72rem;
}
.os-slot-table td {
  padding: 3px 5px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.os-slot-table tbody tr:nth-child(even) { background: rgba(255,255,255,.018); }
.os-slot-table tbody tr:hover           { background: rgba(108,122,224,.07); }
.os-slot-table tbody tr:last-child td   { border-bottom: none; }
.os-slot-table input[type=number] {
  padding: 2px 4px;
  font-size: .74rem;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: right;
  outline: none;
  transition: border-color .15s;
}
.os-slot-table input[type=number]:focus { border-color: var(--accent); }
.os-slot-table .cell-views  { color: var(--accent); font-weight: 700; }
.os-slot-table .cell-cumv   { color: var(--accent); font-weight: 700; border-left: 1px solid var(--border); white-space: nowrap; }
.os-slot-table .cell-cume   { color: var(--fg3); white-space: nowrap; font-size: .71rem; }
.os-slot-table .cell-slot   { color: var(--fg3); font-weight: 600; }
.os-slot-table .cell-time   { color: var(--fg3); white-space: nowrap; }
.os-slot-table .btn-eng-add {
  background: transparent;
  cursor: pointer;
  font-size: .67rem;
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.4;
}
.os-slot-table .btn-eng-rm {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--red, #ef4444);
  font-size: .67rem;
  padding: 0 2px;
  vertical-align: middle;
  margin-left: 2px;
}

/* ── Organic Strategy — Card stat pills ─────────────────────── */
.os-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--fg2);
  white-space: nowrap;
}
.os-stat-views    { color: var(--accent); border-color: rgba(108,122,224,.25); background: rgba(108,122,224,.08); }
.os-stat-slots    { color: var(--fg2); }
.os-stat-interval { color: var(--fg2); }
.os-stat-dur      { color: var(--fg3); }

/* ── Organic Strategy — Engagement type chips ───────────────── */
.os-eng-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface3);
  border: 1px solid var(--border);
  font-size: .7rem;
  cursor: default;
  transition: opacity .15s;
}

/* ── Organic Strategy — Curve badge (card top-right) ────────── */
.os-curve-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .64rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .2px;
}

/* ── Organic Strategy — Card (grid view) ────────────────────── */
.os-strat-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, box-shadow .15s;
}
.os-strat-card:hover {
  border-color: rgba(108,122,224,.35);
  box-shadow: 0 4px 18px rgba(108,122,224,.1);
}

/* ── Organic Strategy — List view ───────────────────────────── */
.os-list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--surface3);
  border-bottom: 2px solid var(--border);
  font-size: .68rem;
  font-weight: 700;
  color: var(--fg3);
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}
.os-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.os-list-row:last-child { border-bottom: none; }
.os-list-row:hover { background: rgba(108,122,224,.05) !important; }

/* Curve colour dot (list view) */
.os-curve-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Modals ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 900;
  backdrop-filter: blur(3px);
  padding: 16px;
}
.modal-overlay.open { display: flex; animation: pageFade .15s ease; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg { max-width: 680px; }
.modal-xl { max-width: 900px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-title i { color: var(--accent); font-size: .9rem; }

.modal-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--fg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--surface3); color: var(--fg); }

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ── Toast ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: .83rem;
  font-weight: 500;
  animation: toastIn .2s ease;
  min-width: 230px;
  max-width: 340px;
  pointer-events: all;
}
.toast.hide { animation: toastOut .2s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(100%); } }

.toast-success { border-color: var(--green-bd); color: #86efac; }
.toast-error   { border-color: var(--red-bd); color: #fca5a5; }
.toast-warning { border-color: var(--yellow-bd); color: #fde68a; }
.toast-info    { border-color: var(--accent-bd); color: #a5b4fc; }

/* ── My Campaigns Search Box ────────────────────────────────── */
#mcSearchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
#mcSearchInput::placeholder { color: var(--fg4); }
#mcSearchInput:focus + #mcSearchClear,
#mcSearchClear:hover { color: var(--fg1) !important; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 5px; margin-top: 14px; flex-wrap: wrap; }

.page-btn {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fg3);
  font-size: .8rem;
  font-weight: 600;
  transition: all var(--transition);
}
.page-btn:hover { background: var(--surface3); color: var(--fg); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-info { font-size: .78rem; color: var(--fg3); margin-left: 4px; }

/* ── Search box ─────────────────────────────────────────────── */
.search-box { position: relative; }
.search-box i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--fg3); font-size: .8rem; }
.search-box input { padding-left: 32px; }

/* ── Loading & Empty ────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--fg3);
  padding: 28px;
  justify-content: center;
  font-size: .84rem;
}
.loading i { color: var(--accent); font-size: 1rem; animation: spin .7s linear infinite; }

.empty { text-align: center; padding: 40px 24px; }
.empty-icon { font-size: 2rem; margin-bottom: 10px; opacity: .3; }
.empty h3 { font-size: .9rem; font-weight: 600; margin-bottom: 5px; color: var(--fg2); }
.empty p  { font-size: .8rem; color: var(--fg3); }

/* ── Skeleton ────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 5px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Misc helpers ────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-12 { gap: 12px; }
.text-muted { color: var(--fg3); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

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

/* ═══════════════════════════════════════════════════════════
   PAGE-SPECIFIC STYLES
═══════════════════════════════════════════════════════════ */

/* ── Dashboard ───────────────────────────────────────────── */
.dash-welcome {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.dash-welcome-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 3px; }
.dash-welcome-title span { color: var(--accent); }
.dash-welcome-sub { font-size: .82rem; color: var(--fg3); }

.dash-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }

.topup-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.topup-cta-icon { font-size: 1.6rem; color: var(--accent); }
.topup-cta h3 { font-size: .9rem; font-weight: 700; }
.topup-cta p { font-size: .79rem; color: var(--fg3); line-height: 1.6; }

.crypto-tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.crypto-tag {
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-size: .72rem;
  font-weight: 600;
  color: var(--fg3);
}

/* ── New Campaign (Order) ────────────────────────────────── */
.order-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

.cat-tabs { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }

.cat-tab {
  padding: 5px 13px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--fg3);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 5px;
}
.cat-tab:hover { color: var(--fg2); border-color: var(--border2); }
.cat-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.services-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - 310px);
  overflow-y: auto;
}

.svc-item {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.svc-item:hover { border-color: var(--border2); background: var(--surface2); }
.svc-item.selected { border-color: var(--accent); background: var(--accent-bg); }

.svc-name { font-size: .84rem; font-weight: 600; margin-bottom: 4px; }
.svc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.svc-rate { font-size: .78rem; color: var(--green); font-weight: 700; }
.svc-range { font-size: .73rem; color: var(--fg3); }
.svc-type { font-size: .68rem; padding: 2px 6px; border-radius: 4px; background: var(--surface3); color: var(--fg3); border: 1px solid var(--border); }

.order-form-card { position: sticky; top: 0; }

.sel-svc-box {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  border: 1px solid var(--accent-bd);
  margin-bottom: 14px;
}
.sel-svc-name { font-size: .85rem; font-weight: 700; margin-bottom: 3px; }
.sel-svc-meta { font-size: .76rem; color: var(--fg2); }

.charge-preview {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
}
.charge-row { display: flex; justify-content: space-between; font-size: .8rem; padding: 3px 0; color: var(--fg2); }
.charge-total {
  font-weight: 700;
  color: var(--fg);
  font-size: .86rem;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.balance-low { color: var(--red) !important; }

/* ── Wallet ──────────────────────────────────────────────── */
.wallet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.wallet-balance-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.wallet-balance-label { font-size: .78rem; color: var(--fg3); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.wallet-balance-value { font-size: 2.2rem; font-weight: 700; margin-bottom: 4px; }
.wallet-balance-value span { font-size: 1rem; color: var(--fg3); margin-right: 3px; }
.wallet-stats { display: flex; gap: 16px; margin-top: 10px; }
.wallet-stat { font-size: .76rem; color: var(--fg3); }
.wallet-stat b { color: var(--fg2); font-weight: 600; }

.deposit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.deposit-card h3 {
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.deposit-card h3 i { color: var(--accent); font-size: .82rem; }

.crypto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.crypto-badge {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--fg3);
}

.quick-amounts { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.quick-amount {
  padding: 5px 11px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--fg3);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.quick-amount:hover, .quick-amount.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.deposit-amount-row { display: flex; gap: 6px; margin-bottom: 6px; }

.payment-popup {
  background: var(--surface);
  border: 1px solid var(--green-bd);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 12px;
  animation: pageFade .2s ease;
}
.payment-popup-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Admin Wallet / Credits page (Option C) ─────────────── */
.admin-panel-bal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.apb-loading {
  grid-column: 1/-1;
  padding: 32px;
  text-align: center;
  color: var(--fg3);
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.apb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.apb-card:hover { border-color: var(--border2); }
.apb-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--apb-accent, var(--cyan));
  border-radius: var(--radius) var(--radius) 0 0;
}
.apb-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.apb-card-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--fg3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.apb-card-name i { color: var(--apb-accent, var(--cyan)); font-size: .8rem; }
.apb-refresh-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fg3);
  padding: 3px 5px;
  border-radius: var(--radius-xs);
  font-size: .72rem;
  transition: color var(--transition);
}
.apb-refresh-btn:hover { color: var(--fg); }
.apb-balance {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -.02em;
  line-height: 1;
}
.apb-balance.bal-high  { color: var(--cyan); }
.apb-balance.bal-low   { color: var(--yellow); }
.apb-balance.bal-empty { color: var(--red); }
.apb-balance.bal-load  { color: var(--fg3); font-size: 1.1rem; }
.apb-currency {
  font-size: .7rem;
  color: var(--fg3);
  font-weight: 500;
  margin-top: 2px;
}

/* Admin recent orders status badges */
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.status-pill.placed     { background: rgba(34,197,94,.12);  color: var(--green); }
.status-pill.completed  { background: rgba(59,130,246,.12); color: var(--blue); }
.status-pill.error      { background: rgba(239,68,68,.12);  color: var(--red); }
.status-pill.dry_run    { background: rgba(168,85,247,.12); color: var(--purple, #a855f7); }
.status-pill.pending    { background: rgba(234,179,8,.12);  color: var(--yellow); }
.status-pill.processing { background: rgba(234,179,8,.12);  color: var(--yellow); }

/* Fallback indicator in recent orders */
.fb-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .65rem;
  font-weight: 700;
  background: rgba(251,146,60,.15);
  color: #fb923c;
}
@media (max-width: 768px) {
  .admin-panel-bal-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* ── Orders / Campaigns ──────────────────────────────────── */
.orders-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}

.status-filter-btn,
.job-filter-btn,
.raw-status-filter,
.admin-camp-filter {
  padding: 5px 11px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--fg3);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}
.status-filter-btn:hover,
.job-filter-btn:hover,
.raw-status-filter:hover,
.admin-camp-filter:hover {
  color: var(--fg2);
  border-color: var(--border2);
  background: var(--surface3);
}
.status-filter-btn.active,
.job-filter-btn.active,
.raw-status-filter.active,
.admin-camp-filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Profile ─────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* ── Admin ───────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.admin-tab {
  padding: 9px 18px;
  border: none;
  background: none;
  color: var(--fg3);
  font-size: .83rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-tab:hover { color: var(--fg2); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-section { display: none; }
.admin-section.active { display: block; animation: pageFade .2s ease; }

.stats-admin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.markup-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

/* Services visibility filters */
.svc-vis-filter.active {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent-bd);
}

/* ── Mobile nav ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar-toggle-btn { display: flex; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    transform: translateX(-100%);
    z-index: 201;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-admin-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .wallet-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .order-layout { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
  .page { padding: 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .topbar-right .btn span { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   Organic Strategy — Curve Shape Buttons
   ══════════════════════════════════════════════════════════════ */

/* Each curve button: stack sparkline above label */
.os-curve-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 10px 6px !important;
  min-width: 82px;
  transition: border-color .15s, background .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}

.os-curve-btn .os-curve-sparkline {
  display: block;
  width: 52px;
  height: 22px;
  color: var(--fg3);
  transition: color .15s;
  pointer-events: none;
  flex-shrink: 0;
}

.os-curve-btn .os-curve-label {
  font-size: .72rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: .01em;
}

/* Active state — highlight sparkline in accent color */
.os-curve-btn.active {
  border-color: var(--accent, #6366f1) !important;
  background: rgba(99,102,241,.13) !important;
  box-shadow: 0 0 0 1px var(--accent, #6366f1) inset;
}
.os-curve-btn.active .os-curve-sparkline {
  color: var(--accent, #6366f1);
}
.os-curve-btn.active .os-curve-label {
  color: var(--accent, #6366f1);
}

/* Hover state */
.os-curve-btn:not(.active):hover {
  border-color: rgba(99,102,241,.45) !important;
  background: rgba(99,102,241,.06) !important;
}
.os-curve-btn:not(.active):hover .os-curve-sparkline {
  color: var(--fg2);
}

/* ══════════════════════════════════════════════════════════════
   SvcSearch — Searchable Service Dropdown
   ══════════════════════════════════════════════════════════════ */
.svc-search-wrapper {
  position: relative;
  width: 100%;
}

/* Trigger button (replaces the visible native <select>) */
.svc-search-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 8px 32px 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: .85rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Chevron arrow (same as .form-select) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b6b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 11px;
  box-sizing: border-box;
}
.svc-search-trigger.placeholder {
  color: var(--fg4, #555);
}
.svc-search-wrapper.focused .svc-search-trigger,
.svc-search-trigger:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

/* Floating panel */
.svc-search-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--surface, #161616);
  border: 1px solid var(--accent, #6366f1);
  border-radius: var(--radius-sm, 8px);
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: svcFadeIn .1s ease;
  /* GPU composite layer — prevents repaint of background on scroll */
  will-change: transform, opacity;
  contain: layout style;
  transform: translateZ(0);
}
.svc-search-panel.open {
  display: flex;
}

@keyframes svcFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Search input row */
.svc-search-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border, #2a2a2a);
  background: var(--surface2, #1e1e1e);
  flex-shrink: 0;
}
.svc-search-icon {
  color: var(--fg3, #6b6b6b);
  font-size: .78rem;
  flex-shrink: 0;
}
.svc-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg, #f5f5f5);
  font-size: .83rem;
  font-family: 'Inter', sans-serif;
  caret-color: var(--accent, #6366f1);
}
.svc-search-input::placeholder {
  color: var(--fg4, #555);
}

/* Scrollable list — position:relative required for virtual scroll absolute children */
.svc-search-list {
  overflow-y: auto;
  /* Fixed height (not max-height) so virtual scroller knows exact viewport */
  height: 280px;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border, #2a2a2a) transparent;
  /* Smooth momentum scroll on iOS */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.svc-search-list::-webkit-scrollbar { width: 4px; }
.svc-search-list::-webkit-scrollbar-thumb { background: var(--border2, #363636); border-radius: 3px; }
/* The sentinel div inside uses position:absolute — needs relative parent */
.svc-search-list > div:first-child { position: relative; }

/* Platform group header (virtual row) */
.svc-search-group {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg3, #6b6b6b);
  border-top: 1px solid var(--border, #2a2a2a);
  background: var(--surface, #161616);
}

/* Individual service item (virtual row — fixed height = ITEM_H in JS) */
.svc-search-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  cursor: pointer;
  font-size: .82rem;
  color: var(--fg2, #a3a3a3);
  /* No transition on background — eliminates repaints during scroll */
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
}
.svc-search-item:hover,
.svc-search-item.keyboard-focus {
  background: var(--surface3, #252525);
  color: var(--fg, #f5f5f5);
}
.svc-search-item.active {
  background: rgba(99,102,241,.14);
  color: var(--accent, #6366f1);
}
.svc-search-item.active:hover {
  background: rgba(99,102,241,.22);
}

/* Service ID prefix (muted) */
.svc-item-id {
  font-size: .73rem;
  color: var(--fg3, #6b6b6b);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Slot type tag */
.svc-item-slot {
  font-size: .7rem;
  color: var(--fg3, #6b6b6b);
  flex-shrink: 0;
}

/* Service name */
.svc-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Empty state */
.svc-search-empty {
  padding: 18px 12px;
  text-align: center;
  font-size: .8rem;
  color: var(--fg3, #6b6b6b);
}
