/* ── AdCenter – Design System ──────────────────────────
   Palette: amber accent · deep navy dark · cool light
   Type: Outfit (display) · DM Sans (body) · JetBrains Mono (data)
──────────────────────────────────────────────────────── */

/* LIGHT tokens (default) */
:root {
  --bg:         #F2F5FB;
  --surface:    #FFFFFF;
  --surface-2:  #EDF0F8;
  --surface-3:  #E4E9F5;
  --border:     #DDE3F0;
  --text-1:     #111827;
  --text-2:     #4B5563;
  --text-3:     #9CA3AF;
  --accent:     #C27C0E;
  --accent-bg:  #FEF3C7;
  --green:      #059669;
  --green-bg:   #D1FAE5;
  --red:        #DC2626;
  --red-bg:     #FEE2E2;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 16px rgba(0,0,0,.09);
  --sidebar-bg: #0D1520;
}

/* DARK tokens – system */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0D1117;
    --surface:   #161C2D;
    --surface-2: #1E2538;
    --surface-3: #252D3E;
    --border:    #2A3347;
    --text-1:    #E6EAF4;
    --text-2:    #8A96B3;
    --text-3:    #56627D;
    --accent:    #F5A623;
    --accent-bg: rgba(245,166,35,.12);
    --green:     #10B981;
    --green-bg:  rgba(16,185,129,.12);
    --red:       #EF4444;
    --red-bg:    rgba(239,68,68,.12);
    --shadow-sm: 0 1px 4px rgba(0,0,0,.35);
    --shadow:    0 4px 20px rgba(0,0,0,.5);
    --sidebar-bg:#080E1A;
  }
}

/* DARK tokens – explicit toggle */
:root[data-theme="dark"] {
  --bg:        #0D1117;
  --surface:   #161C2D;
  --surface-2: #1E2538;
  --surface-3: #252D3E;
  --border:    #2A3347;
  --text-1:    #E6EAF4;
  --text-2:    #8A96B3;
  --text-3:    #56627D;
  --accent:    #F5A623;
  --accent-bg: rgba(245,166,35,.12);
  --green:     #10B981;
  --green-bg:  rgba(16,185,129,.12);
  --red:       #EF4444;
  --red-bg:    rgba(239,68,68,.12);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.35);
  --shadow:    0 4px 20px rgba(0,0,0,.5);
  --sidebar-bg:#080E1A;
}

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

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
a { text-decoration: none; }

/* ── App shell ── */
.app {
  display: flex;
  min-height: 100vh;
}

/* ═══════════════════════════════
   SIDEBAR  (always dark)
═══════════════════════════════ */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  transition: width .2s ease;
  z-index: 100;
  overflow: hidden;
}
.sidebar.collapsed { width: 64px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  min-height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}
.logo-icon { width: 30px; height: 30px; flex-shrink: 0; }
.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
  transition: opacity .2s;
}
.sidebar.collapsed .logo-text { opacity: 0; pointer-events: none; }

.sidebar-toggle {
  background: none;
  border: none;
  padding: 4px;
  border-radius: 6px;
  color: #7B8BAD;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-toggle svg  { width: 18px; height: 18px; }

/* nav */
.nav { flex: 1; padding: 10px 8px; overflow-y: auto; overflow-x: hidden; }
.nav-group { margin-bottom: 20px; }

.nav-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #3E4C6D;
  padding: 0 8px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .2s;
}
.sidebar.collapsed .nav-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #7B8BAD;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .12s, color .12s;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active {
  background: rgba(245,166,35,.11);
  color: #F5A623;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: #F5A623;
  border-radius: 0 2px 2px 0;
}
.sidebar.collapsed .nav-item span { opacity: 0; pointer-events: none; }

/* sidebar footer */
.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.theme-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: none;
  border: none;
  color: #7B8BAD;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .12s, color .12s;
  margin-bottom: 8px;
}
.theme-toggle:hover { background: rgba(255,255,255,.05); color: #fff; }
.theme-toggle svg  { width: 16px; height: 16px; flex-shrink: 0; }
.theme-toggle span { transition: opacity .2s; }
.sidebar.collapsed .theme-toggle span { opacity: 0; pointer-events: none; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  overflow: hidden;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #F5A623;
  color: #111827;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-info { flex: 1; overflow: hidden; transition: opacity .2s; }
.sidebar.collapsed .user-info { opacity: 0; pointer-events: none; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: #7B8BAD; }

/* ═══════════════════════════════
   MAIN
═══════════════════════════════ */
.main {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
  background: var(--bg);
  transition: margin-left .2s;
}
.main.sidebar-collapsed { margin-left: 64px; }

/* top bar */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-label { font-size: 12px; color: var(--text-3); margin-right: 4px; }

.client-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ── Content structure ── */
.view-header {
  padding: 28px 32px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.view-title {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text-1);
  text-wrap: balance;
}
.view-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.view-body { padding: 24px 32px 48px; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.select-period {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--text-1);
  font-size: 13px;
  cursor: pointer;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .14s;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary  { background: var(--accent); color: #111827; }
.btn-primary:hover  { filter: brightness(1.08); }
.btn-secondary{ background: var(--surface-2); color: var(--text-1); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-outline  { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface-2); color: var(--text-1); }
.btn-ghost    { background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 500; padding: 6px 10px; border-radius: 6px; }
.btn-ghost:hover { background: var(--accent-bg); }

/* ── Platform chips (dashboard status bar) ── */
.platform-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.platform-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
}
.platform-chip.connected { color: var(--text-1); }
.platform-chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}
.platform-chip.connected .dot { background: var(--green); }

.p-icon {
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -.02em;
  vertical-align: middle;
}

/* ── KPI cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.kpi-row { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.kpi-label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.kpi-sparkline { opacity: .8; }
.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text-1);
  line-height: 1;
  margin-bottom: 8px;
}
.kpi-value.mono { font-family: 'JetBrains Mono', monospace; font-size: 24px; font-variant-numeric: tabular-nums; }
.trend { font-size: 12px; font-weight: 500; }
.trend.up   { color: var(--green); }
.trend.down { color: var(--red); }
.trend.flat { color: var(--text-3); }

/* ── Charts ── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  margin-bottom: 22px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chart-title { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 600; color: var(--text-1); }
.legend { display: flex; gap: 14px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.chart-wrap { position: relative; }
.chart-wrap canvas { width: 100%; height: 220px; }
.donut-card { display: flex; flex-direction: column; }
.donut-wrap { display: flex; justify-content: center; margin: 4px 0 16px; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-leg-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.donut-leg-item strong { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500; color: var(--text-1); font-variant-numeric: tabular-nums; }
.donut-leg-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ── Tables ── */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.table-title { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 600; color: var(--text-1); }
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text-2); }
th.r, td.r { text-align: right; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
td { padding: 11px 12px; font-size: 13px; color: var(--text-1); white-space: nowrap; }
td.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-variant-numeric: tabular-nums; }
td.camp-name { font-weight: 500; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.badge-active  { background: var(--green-bg); color: var(--green); }
.badge-paused  { background: var(--accent-bg); color: var(--accent); }
.badge-ended   { background: var(--surface-3); color: var(--text-3); }

.type-chip {
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 20px;
}

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  background: none;
  border-radius: 6px;
  color: var(--text-3);
  transition: background .1s, color .1s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text-1); }
.icon-btn svg { width: 15px; height: 15px; }

/* ── Filters bar (campaigns) ── */
.filters-bar {
  display: flex;
  gap: 24px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.filter-group { display: flex; align-items: center; gap: 10px; }
.filter-label { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.filter-pills { display: flex; gap: 6px; }
.pill {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all .12s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #111827; }

/* ── Platform connection cards ── */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.platform-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}
.platform-card.connected { border-color: var(--green); }
.plat-logo {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.plat-info { flex: 1; }
.plat-name { font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.plat-account { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.plat-desc { font-size: 13px; color: var(--text-2); line-height: 1.55; margin-bottom: 14px; }
.plat-stats { display: flex; gap: 20px; margin-bottom: 14px; }
.plat-stats div { display: flex; flex-direction: column; gap: 2px; }
.plat-stats strong { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 600; color: var(--text-1); font-variant-numeric: tabular-nums; }
.plat-stats span  { font-size: 11px; color: var(--text-3); }

/* ── Reports ── */
.reports-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 20px;
}
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.form-select, .form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 13px;
}
.form-select:focus, .form-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check-group { display: flex; flex-direction: column; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check-item input { accent-color: var(--accent); width: 15px; height: 15px; }
.export-btns { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.preview-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; background: var(--surface-2); border-radius: 8px; margin-bottom: 20px; }
.preview-logo { font-size: 16px; font-weight: 700; font-family: 'Outfit', sans-serif; }
.preview-meta { font-size: 12px; color: var(--text-2); text-align: right; line-height: 1.6; }
.preview-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.prev-kpi { background: var(--surface-2); border-radius: 8px; padding: 14px; }
.prev-kpi span { display: block; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.prev-kpi strong { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 600; color: var(--text-1); }
.preview-note { font-size: 12px; color: var(--text-3); line-height: 1.6; padding-top: 12px; border-top: 1px solid var(--border); }

/* ── Settings ── */
.settings-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-1); }
.setting-row:last-child { border-bottom: none; }

/* toggle switch */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--surface-3); border-radius: 20px; cursor: pointer; transition: .2s; }
.slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider::before { transform: translateX(18px); }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1E2538;
  color: #E6EAF4;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  white-space: nowrap;
}
.toast.in { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .reports-layout { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .platforms-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .sidebar { width: 64px; }
  .sidebar .logo-text, .sidebar .nav-item span,
  .sidebar .nav-label, .sidebar .user-info,
  .sidebar .theme-toggle span { display: none; }
  .main { margin-left: 64px; }
  .view-header, .view-body { padding-left: 16px; padding-right: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .view-header { flex-direction: column; }
}

/* ── Login screen ── */
.login-screen {
  display: none;
  position: fixed; inset: 0; z-index: 9000;
  background: var(--bg);
  align-items: center; justify-content: center;
}
.login-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%; max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--text-1);
  margin-bottom: 24px;
}
.login-title {
  font-size: 20px; font-weight: 700;
  color: var(--text-1);
  margin: 0 0 20px;
  font-family: 'Outfit', sans-serif;
}
.login-error {
  background: rgba(239,68,68,.1);
  color: #EF4444;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ── Modal backdrop + box ── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,.55);
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%; max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-1); margin: 0 0 20px; font-family: 'Outfit', sans-serif; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ── Client row ── */
.client-row-cell { display: flex; align-items: center; gap: 10px; }
.client-av {
  width: 32px; height: 32px; border-radius: 8px;
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Role badge */
.role-badge { font-size: 12px; font-weight: 600; }

/* Info box */
.info-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.info-box strong { color: var(--text-1); margin-right: 4px; }

/* Color swatches */
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.color-swatch { width: 28px; height: 28px; border-radius: 7px; cursor: pointer; border: 3px solid transparent; transition: border-color .15s; }
.color-swatch.selected { border-color: var(--text-1); }

/* ── Wizard ── */
.wiz-box { max-width: 560px; padding: 0; overflow: hidden; }
.wiz-header { padding: 24px 28px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.wiz-steps { display: flex; align-items: center; gap: 0; }
.wiz-step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.wiz-step span { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--text-3); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: .2s; }
.wiz-step.done span { background: var(--accent); color: #fff; }
.wiz-step small { font-size: 10px; color: var(--text-3); text-align: center; }
.wiz-step.done small { color: var(--text-2); }
.wiz-line { flex: 0 0 24px; height: 1px; background: var(--border); }
.wiz-body { padding: 24px 28px; }
.wiz-footer { padding: 16px 28px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; background: var(--surface-2); }
.wiz-section { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; }
.wiz-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wiz-card { background: var(--surface-2); border: 2px solid transparent; border-radius: 10px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; transition: border-color .15s; }
.wiz-card:hover { border-color: var(--border-strong,#3a4460); }
.wiz-card.active { border-color: var(--accent); }
.wiz-card strong { font-size: 13px; font-weight: 600; color: var(--text-1); }
.wiz-kw-list { display: flex; flex-wrap: wrap; gap: 6px; }
.wiz-kw { background: var(--surface-3); border-radius: 6px; padding: 4px 10px; font-size: 12px; color: var(--text-2); }
.wiz-summary { background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.wiz-sum-row { display: flex; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.wiz-sum-row:last-child { border-bottom: none; }
.wiz-sum-row span { color: var(--text-3); }
.wiz-sum-row strong { color: var(--text-1); }

/* ── Help / Súgó ── */
.help-grid { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.help-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.help-card-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.help-card-header:hover { background: var(--surface-2); }
.help-icon { font-size: 20px; flex-shrink: 0; width: 32px; text-align: center; }
.help-title { font-size: 15px; font-weight: 600; color: var(--text-1); flex: 1; margin: 0; font-family: 'Outfit', sans-serif; }
.help-chevron { width: 18px; height: 18px; color: var(--text-3); transition: transform .2s; flex-shrink: 0; }
.help-card.open .help-chevron { transform: rotate(180deg); }
.help-body {
  display: none;
  padding: 0 20px 20px 64px;
  font-size: 14px; color: var(--text-2); line-height: 1.75;
  border-top: 1px solid var(--border);
}
.help-card.open .help-body { display: block; }
.help-body p { margin: 12px 0 8px; }
.help-body ul, .help-body ol { padding-left: 20px; margin: 8px 0; }
.help-body li { margin-bottom: 5px; }
.help-body strong { color: var(--text-1); }

/* ── Focus / a11y ── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
