/* ─────────────────────────────────────────────────────────────────────────────
   RezSync Marketing — Design System
   Dark, precise, command-center. Single accent. Tabular numerics.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  /* Canvas */
  --bg:           #0A0B10;
  --bg-elev:      #0F1117;
  --surface:      #12141C;
  --surface-2:    #171A24;
  --surface-hi:   #1C2030;

  /* Borders */
  --border:       #1E2230;
  --border-hi:    #262B3B;
  --border-strong:#323849;

  /* Text */
  --text:         #E7E9EE;
  --text-mute:    #9095A6;
  --text-dim:     #5A5F73;
  --text-faint:   #3D4155;

  /* Accent */
  --accent:       #3B82F6;
  --accent-hi:    #60A5FA;
  --accent-lo:    #1E40AF;
  --accent-glow:  rgba(59,130,246,.18);
  --cyan:         #22D3EE;
  --violet:       #8B5CF6;

  /* Status */
  --ok:           #10B981;
  --ok-soft:      rgba(16,185,129,.12);
  --warn:         #F59E0B;
  --warn-soft:    rgba(245,158,11,.12);
  --danger:       #F43F5E;
  --danger-soft:  rgba(244,63,94,.12);

  /* Effects */
  --shadow-card:  0 1px 0 rgba(255,255,255,.02) inset, 0 1px 2px rgba(0,0,0,.3);
  --shadow-pop:   0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.02) inset;
  --ring:         0 0 0 1px var(--accent), 0 0 0 4px var(--accent-glow);

  /* Type */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: 'cv11','ss01','ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* Subtle radial backdrop — gives depth without noise */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(59,130,246,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(139,92,246,.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbars ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-hi);
  border: 2px solid var(--bg);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
.scrollbar-none::-webkit-scrollbar { display: none; }

/* ── Numerics — tabular mono for any data ──────────────────────────────── */
.num {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum','zero';
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ── Surface primitives ────────────────────────────────────────────────── */
.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative;
}
.surface-hi { background: var(--surface-2); }
.surface::after {
  /* Top hairline highlight — premium touch */
  content: '';
  position: absolute;
  top: 0; left: 12px; right: 12px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  pointer-events: none;
}

.divider-h { height: 1px; background: var(--border); }
.divider-v { width: 1px; background: var(--border); }

/* ── Pills / chips ─────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--border-hi);
  background: var(--surface-2);
  color: var(--text-mute);
  white-space: nowrap;
}
.chip-ok      { color: var(--ok);     background: var(--ok-soft);     border-color: rgba(16,185,129,.25); }
.chip-warn    { color: var(--warn);   background: var(--warn-soft);   border-color: rgba(245,158,11,.25); }
.chip-danger  { color: var(--danger); background: var(--danger-soft); border-color: rgba(244,63,94,.25); }
.chip-accent  { color: var(--accent-hi); background: rgba(59,130,246,.10); border-color: rgba(59,130,246,.25); }
.chip-violet  { color: #C4B5FD; background: rgba(139,92,246,.10); border-color: rgba(139,92,246,.25); }
.chip-cyan    { color: #67E8F9; background: rgba(34,211,238,.10); border-color: rgba(34,211,238,.25); }
.chip-amber   { color: #FCD34D; background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.25); }
.chip-rose    { color: #FDA4AF; background: rgba(244,63,94,.10); border-color: rgba(244,63,94,.25); }

/* Status dot with pulse */
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 999px; }
.dot-pulse {
  position: relative;
}
.dot-pulse::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: 999px;
  background: inherit;
  opacity: .5;
  animation: dot-pulse 2.4s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes dot-pulse {
  0%, 100% { transform: scale(1);   opacity: .5; }
  50%      { transform: scale(2.2); opacity: 0; }
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 32px; padding: 0 14px;
  border-radius: 8px;
  font-size: 12.5px; font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all .15s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
  border: 1px solid transparent;
  user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn i { font-size: 11px; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent) 0%, #2563EB 100%);
  color: #fff;
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 0 0 1px var(--accent-lo) inset, 0 4px 12px rgba(59,130,246,.25);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--accent-hi) 0%, var(--accent) 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 0 0 1px var(--accent-lo) inset, 0 6px 20px rgba(59,130,246,.35);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-mute);
  border-color: var(--border-hi);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-hi);
  border-color: var(--border-strong);
}

.btn-soft {
  background: rgba(59,130,246,.08);
  color: var(--accent-hi);
  border-color: rgba(59,130,246,.18);
}
.btn-soft:hover:not(:disabled) {
  background: rgba(59,130,246,.14);
  border-color: rgba(59,130,246,.3);
}

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-icon { padding: 0; width: 32px; }
.btn-icon.btn-sm { width: 28px; }

/* ── Inputs ────────────────────────────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border-hi);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  transition: all .15s;
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--surface);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239095A6' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}
.label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-mute);
  margin-bottom: 6px;
  letter-spacing: 0.005em;
}

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--surface-hi);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  transition: all .2s;
  cursor: pointer;
}
.toggle-track::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--text-mute);
  border-radius: 999px;
  transition: all .2s cubic-bezier(.4,0,.2,1);
}
.toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle input:checked + .toggle-track::before {
  transform: translateX(16px);
  background: #fff;
}

/* ── Tables ────────────────────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  white-space: nowrap;
}
.tbl tbody td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-mute);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.015); }
.tbl td.t-strong { color: var(--text); font-weight: 500; }
.tbl td.t-num { color: var(--text); }

/* ── Nav links (sidebar) ───────────────────────────────────────────────── */
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mute);
  transition: all .12s;
  position: relative;
  letter-spacing: -0.005em;
}
.nav-link i { width: 14px; font-size: 12.5px; text-align: center; opacity: .7; }
.nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,.025);
}
.nav-link.is-active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(59,130,246,.14), rgba(59,130,246,.04));
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-link.is-active i { color: var(--accent-hi); opacity: 1; }
.nav-section {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint);
  padding: 14px 10px 6px;
}

/* ── Animations ────────────────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fade-up .35s cubic-bezier(.22,.68,.18,1.05) both; }

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-hi) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite linear;
}

/* ── Toasts ────────────────────────────────────────────────────────────── */
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-hi);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 12px;
  min-width: 280px; max-width: 380px;
  box-shadow: var(--shadow-pop);
  animation: fade-up .25s cubic-bezier(.22,.68,.18,1.05) both;
}
.toast i { flex-shrink: 0; font-size: 14px; }
.toast.toast-ok i      { color: var(--ok); }
.toast.toast-error i   { color: var(--danger); }
.toast.toast-info i    { color: var(--accent-hi); }
.toast-out { animation: fade-down .2s ease forwards; }
@keyframes fade-down {
  to { opacity: 0; transform: translateY(-4px); }
}

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,7,12,.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  animation: fade-up .2s ease both;
}
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 101;
  pointer-events: none;
}
.modal > * { pointer-events: auto; }

/* ── Filter tab group ──────────────────────────────────────────────────── */
.tab-group {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.tab-btn {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mute);
  cursor: pointer;
  transition: all .15s;
  border: none;
  background: transparent;
  letter-spacing: -0.005em;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.is-active {
  background: var(--surface-hi);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 1px 2px rgba(0,0,0,.3);
}

/* ── Sparkbar (mini bars in metric cells) ──────────────────────────────── */
.bar-track {
  height: 6px;
  background: var(--surface-hi);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .8s cubic-bezier(.22,.68,.18,1);
}

/* ── Misc helpers ──────────────────────────────────────────────────────── */
.text-grad {
  background: linear-gradient(135deg, var(--text) 0%, var(--text-mute) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.glow-accent {
  box-shadow: 0 0 0 1px rgba(59,130,246,.3), 0 0 24px rgba(59,130,246,.15);
}

/* Empty-state */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 20px; gap: 14px;
  color: var(--text-dim);
}
.empty i { font-size: 28px; opacity: .4; }
.empty p { font-size: 13px; }
.empty .empty-title { color: var(--text-mute); font-weight: 500; font-size: 14px; }
