﻿/* ================================================================
   DEECLIQ  —  PROFESSIONAL CRM  (deep navy / electric blue)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Accessibility: skip link + visible keyboard focus ──────────── */
.dl-skip-link {
  position: absolute; left: 8px; top: -60px;
  background: #111827; color: #fff;
  padding: 10px 18px; border-radius: 8px;
  font-weight: 700; font-size: .9rem;
  text-decoration: none;
  z-index: 100000;
  transition: top .15s ease;
}
.dl-skip-link:focus { top: 8px; }
.dl-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, [tabindex]:focus-visible, .dl-team-card:focus-visible,
.nav-item:focus-visible, summary:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
  border-radius: 4px;
}
html[data-theme="dark"] a:focus-visible, html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] input:focus-visible, html[data-theme="dark"] textarea:focus-visible,
html[data-theme="dark"] select:focus-visible, html[data-theme="dark"] [tabindex]:focus-visible,
html[data-theme="dark"] .dl-team-card:focus-visible, html[data-theme="dark"] .nav-item:focus-visible {
  outline-color: #60a5fa;
}
html.theme-neon a:focus-visible, html.theme-neon button:focus-visible,
html.theme-neon input:focus-visible, html.theme-neon textarea:focus-visible,
html.theme-neon select:focus-visible, html.theme-neon [tabindex]:focus-visible {
  outline-color: #39FF14;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

:root {
  --brand:       #2563eb;
  --brand-dark:  #1d4ed8;
  --brand-light: #eff6ff;
  --brand-mid:   #bfdbfe;

  --sb-bg:       #ffffff;
  --sb-hover:    rgba(37,99,235,.06);
  --sb-active:   rgba(37,99,235,.1);
  --sb-txt:      #475569;
  --sb-txt-h:    #0f172a;
  --sb-accent:   #2563eb;
  --sb-w:        256px;
  /* The sidebar is always light, even when the workspace is in dark mode —
     so it needs its own fixed-light tokens instead of the themed
     --page-bg/--border/--brand-light/--red-bg, which flip dark with
     [data-theme="dark"] and would otherwise leave dark boxes floating
     inside an otherwise-light sidebar. */
  --sb-border:     #e5e7eb;
  --sb-inset:      #f1f5f9;
  --sb-tint:       #eff6ff;
  --sb-tint-mid:   #bfdbfe;
  --sb-tint-dark:  #1d4ed8;
  --sb-red-tint:   #fef2f2;
  --sb-red-bd:     #fca5a5;

  --topbar-h:    58px;
  --page-bg:     #f8fafc;
  --surface:     #ffffff;
  --border:      #e5e7eb;
  --border-2:    #f1f5f9;

  --txt:         #111827;
  --txt-2:       #4b5563;
  --txt-3:       #9ca3af;

  --green:  #10b981; --green-bg:  #ecfdf5; --green-bd:  #6ee7b7;
  --red:    #ef4444; --red-bg:    #fef2f2; --red-bd:    #fca5a5;
  --amber:  #f59e0b; --amber-bg:  #fffbeb; --amber-bd:  #fde68a;
  --blue:   #3b82f6; --blue-bg:   #eff6ff; --blue-bd:   #93c5fd;
  --indigo: #6366f1;

  --sh0: 0 1px 2px rgba(0,0,0,.05);
  --sh1: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --sh2: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
  --sh3: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --sh4: 0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);

  --r:    8px;
  --r-sm: 6px;
  --r-lg: 12px;
  --r-xl: 16px;
  --t:    .15s ease;

  /* backwards-compat */
  --primary: var(--brand);
  --primary-dark: var(--brand-dark);
  --primary-light: var(--brand-light);
  --primary-mid: var(--brand-mid);
  --text: var(--txt);
  --muted: var(--txt-2);
  --light: var(--txt-3);
  --surface-2: var(--page-bg);
  --success: var(--green);
  --success-light: var(--green-bg);
  --danger: var(--red);
  --danger-light: var(--red-bg);
  --warning: var(--amber);
  --warning-light: var(--amber-bg);
  --info: var(--blue);
  --info-light: var(--blue-bg);
  --bg: var(--page-bg);
  --radius: var(--r);
  --radius-sm: var(--r-sm);
  --shadow-xs: var(--sh0);
  --shadow-sm: var(--sh1);
  --shadow: var(--sh2);
  --shadow-lg: var(--sh3);
  --shadow-xl: var(--sh4);
}

/* ── Dark mode ──────────────────────────────────────────────────────
   Toggled via [data-theme="dark"] on <html>, set/persisted by the
   theme-toggle button in base.php (localStorage key: "deecliq-theme").
   The sidebar shifts to a muted grey (not stark white, not as dark as the
   workspace) so it doesn't look out of place next to the dark content. */
html[data-theme="dark"] {
  --page-bg:   #0f172a;
  --surface:   #1e293b;
  --border:    #334155;
  --border-2:  #2c3a50;

  --txt:   #f1f5f9;
  --txt-2: #cbd5e1;
  --txt-3: #94a3b8;

  --brand-light: #1e3a5f;
  --brand-mid:   #2c5282;

  --green-bg: #0f3d2e; --red-bg: #3f1d1d; --amber-bg: #4a3414; --blue-bg: #1e3a5f;

  --sh0: 0 1px 2px rgba(0,0,0,.4);
  --sh1: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
  --sh2: 0 4px 6px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.3);
  --sh3: 0 10px 15px rgba(0,0,0,.45), 0 4px 6px rgba(0,0,0,.3);
  --sh4: 0 20px 25px rgba(0,0,0,.5), 0 10px 10px rgba(0,0,0,.3);

  --sb-bg:        #2a2e35;
  --sb-border:    #3c4049;
  --sb-inset:     #343843;
  --sb-txt:       #b3b8c2;
  --sb-txt-h:     #f3f4f6;
  --sb-hover:     rgba(255,255,255,.06);
  --sb-active:    rgba(96,165,250,.18);
  --sb-accent:    #60a5fa;
  --sb-tint:      #34405a;
  --sb-tint-mid:  #4a5a7a;
  --sb-tint-dark: #93c5fd;
  --sb-red-tint:  #4a2a2a;
  --sb-red-bd:    #7f3737;
}
html[data-theme="dark"] body { background: var(--page-bg); color: var(--txt); }
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: var(--surface);
  color: var(--txt);
  border-color: var(--border);
}
html[data-theme="dark"] .qh-hero-bg { opacity: .4; }

/* ── Neon theme, "day" variant ───────────────────────────────────────
   When neon is toggled on while day mode is still active, it should tint
   the existing light dashboard with the neon-green accent rather than
   force the black "night" neon skin below — that one only kicks in once
   [data-theme="dark"] is ALSO set. */
html.theme-neon:not([data-theme="dark"]) {
  --brand:       #16a34a;
  --brand-dark:  #15803d;
  --brand-light: #dcfce7;
  --brand-mid:   #86efac;
  --page-bg:     #f0fdf4;
  --surface:     #ffffff;
  --border:      #d4f4dd;
  --border-2:    #e8fbee;
  --sb-bg:       #ffffff;
  --sb-border:   #d4f4dd;
  --sb-accent:   #16a34a;
  --sb-active:   rgba(22,163,74,.1);
  --sb-hover:    rgba(22,163,74,.06);
  --sb-tint:       #dcfce7;
  --sb-tint-mid:   #86efac;
  --sb-tint-dark:  #15803d;
}
html.theme-neon:not([data-theme="dark"]) body { background: var(--page-bg); color: var(--txt); }

/* ── Neon theme, "night" variant ──────────────────────────────────────
   Independent overlay toggled via the .theme-neon class (separate from
   [data-theme], which keeps tracking light/dark underneath — turning neon
   off simply resumes whatever light/dark was already set). Persisted via
   localStorage key "deecliq-neon". Equal selector specificity to
   html[data-theme="dark"], so source order here makes neon win regardless
   of which of light/dark is currently active. */
html[data-theme="dark"].theme-neon {
  --brand:       #39FF14;
  --brand-dark:  #2ECC0F;
  --brand-light: #16321a;
  --brand-mid:   #2c5232;

  --page-bg:   #0B0B0F;
  --surface:   #171A20;
  --border:    #2A2F38;
  --border-2:  #111317;

  --txt:   #F8FAFC;
  --txt-2: #A1A1AA;
  --txt-3: #71717A;

  --green:  #10B981; --green-bg:  #0f3d2e; --green-bd:  #1e7a55;
  --red:    #EF4444; --red-bg:    #3f1d1d; --red-bd:    #7f3737;
  --amber:  #F59E0B; --amber-bg:  #4a3414; --amber-bd:  #8a661f;
  --blue:   #3b82f6; --blue-bg:   #111317; --blue-bd:   #2A2F38;

  --sh0: 0 1px 2px rgba(0,0,0,.5);
  --sh1: 0 1px 3px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.4);
  --sh2: 0 4px 6px rgba(0,0,0,.5), 0 2px 4px rgba(0,0,0,.4);
  --sh3: 0 10px 15px rgba(0,0,0,.55), 0 4px 6px rgba(0,0,0,.4);
  --sh4: 0 20px 25px rgba(0,0,0,.6), 0 10px 10px rgba(0,0,0,.4);

  --sb-bg:        #111317;
  --sb-border:    #2A2F38;
  --sb-inset:     #1E232D;
  --sb-txt:       #A1A1AA;
  --sb-txt-h:     #F8FAFC;
  --sb-hover:     #1E232D;
  --sb-active:    rgba(57,255,20,.16);
  --sb-accent:    #39FF14;
  --sb-tint:      #16321a;
  --sb-tint-mid:  #2c5232;
  --sb-tint-dark: #39FF14;
  --sb-red-tint:  #3f1d1d;
  --sb-red-bd:    #7f3737;
}
html[data-theme="dark"].theme-neon body { background: var(--page-bg); color: var(--txt); }
html[data-theme="dark"].theme-neon input,
html[data-theme="dark"].theme-neon textarea,
html[data-theme="dark"].theme-neon select {
  background: var(--surface);
  color: var(--txt);
  border-color: var(--border);
}
html[data-theme="dark"].theme-neon .qh-hero-bg { opacity: .4; }

*,*::before,*::after { box-sizing: border-box; }
html { font-size: 14px; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--page-bg);
  color: var(--txt);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
p { margin: 0 0 .5rem; }
p:last-child { margin-bottom: 0; }
h1,h2,h3,h4,h5,h6 { margin: 0; line-height: 1.3; font-weight: 700; }


/* ================================================================
   CRM LAYOUT
   ================================================================ */

.crm-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */

.crm-sidebar {
  width: var(--sb-w);
  background: var(--sb-bg);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow .3s ease;
  border-right: 1px solid var(--sb-border);
  box-shadow: 2px 0 12px rgba(0,0,0,.04);
}
/* Top gradient accent line on sidebar */
.crm-sidebar::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #9333ea 0%, #6366f1 50%, #0ea5e9 100%);
  flex-shrink: 0;
}
.crm-sidebar.sidebar-open {
  box-shadow: 6px 0 32px rgba(0,0,0,.2);
}

/* Only the tool-category list scrolls — search box, filter chips, and the
   General/Dashboard/Admin section + user card below always stay in place. */
.nav-cats-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.15) transparent;
  padding-right: 2px;
}
.nav-cats-scroll::-webkit-scrollbar { width: 6px; }
.nav-cats-scroll::-webkit-scrollbar-track { background: transparent; }
.nav-cats-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }
.nav-cats-scroll::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.25); }

/* Logo */
.sidebar-logo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 14px 14px 16px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
}

/* Mobile close button — hidden on desktop */
.sidebar-mobile-close {
  display: none;
  margin-left: auto;
  width: 38px; height: 38px; border-radius: 11px; border: none;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff; font-size: .9rem; cursor: pointer;
  align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(239,68,68,.35);
  transition: transform .18s, box-shadow .18s; flex-shrink: 0;
}
.sidebar-mobile-close:hover { transform: scale(1.07); }
.sidebar-mobile-close:active { transform: scale(.92); }

/* Mobile user card — hidden on desktop */
.sidebar-mobile-user-card {
  display: none;
  position: relative; overflow: hidden;
  margin: 10px 10px 6px;
  border-radius: 20px;
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 35%, #7c3aed 70%, #1d4ed8 100%);
  padding: 18px 16px 14px;
  flex-direction: column; gap: 0;
  box-shadow: 0 8px 32px rgba(79,70,229,.45), 0 2px 8px rgba(0,0,0,.15);
  flex-shrink: 0;
}
/* Decorative circles */
.sidebar-mobile-user-orb {
  position: absolute; border-radius: 50%; pointer-events: none;
}
.sidebar-mobile-user-orb-1 {
  width: 110px; height: 110px; top: -35px; right: -25px;
  background: rgba(255,255,255,.08);
}
.sidebar-mobile-user-orb-2 {
  width: 65px; height: 65px; bottom: -20px; left: 14px;
  background: rgba(255,255,255,.07);
}
/* Top row: avatar + info + badge */
.sidebar-mobile-user-top {
  display: flex; align-items: center; gap: 12px;
  position: relative; z-index: 1; margin-bottom: 14px;
}
.sidebar-mobile-user-avatar {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.3), rgba(255,255,255,.12));
  display: grid; place-items: center;
  color: #fff; font-size: 1.3rem; font-weight: 900;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
  letter-spacing: -.02em;
}
.sidebar-mobile-user-info { flex: 1; min-width: 0; }
.sidebar-mobile-user-info strong {
  display: block; font-size: .92rem; font-weight: 800;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-mobile-user-info small {
  display: block; font-size: .7rem; color: rgba(255,255,255,.65); margin-top: 2px;
}
.sidebar-mobile-user-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(6px);
  color: #fff; font-size: .68rem; font-weight: 700;
  padding: 5px 10px; border-radius: 99px;
  border: 1px solid rgba(255,255,255,.25);
  white-space: nowrap; flex-shrink: 0;
}
/* Stats row */
.sidebar-mobile-user-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 8px; position: relative; z-index: 1;
}
.sidebar-mobile-stat {
  background: rgba(255,255,255,.12);
  border-radius: 12px; padding: 9px 8px;
  text-align: center; border: 1px solid rgba(255,255,255,.15);
}
.sidebar-mobile-stat-val {
  display: block; font-size: .95rem; font-weight: 800; color: #fff; line-height: 1;
}
.sidebar-mobile-stat-lbl {
  display: block; font-size: .6rem; color: rgba(255,255,255,.6);
  margin-top: 3px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}

@media (max-width: 820px) {
  .sidebar-mobile-close { display: flex; }
  .sidebar-mobile-user-card { display: flex; }
}
.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.sidebar-logo .dl-logo-tagline { margin-left: 39px; }

.sidebar-logo-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  display: grid; place-items: center;
  font-size: .95rem; font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(37,99,235,.4), 0 4px 12px rgba(37,99,235,.35);
}

.sidebar-logo-img {
  width: 44px; height: 44px; border-radius: 11px; object-fit: cover;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.sidebar-logo:hover .sidebar-logo-img { transform: scale(1.04) rotate(-2deg); }

/* ── Recreated logo (SVG mark + CSS text, no image file) ────────── */
.dl-logo-mark {
  position: relative; /* anchors the speed-line wind streaks (public.css)
    to the logo itself, so they're correctly placed in every context that
    uses this partial — not just nav/footer, which have their own
    dedicated positioned wrapper. */
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
a:hover .dl-logo-mark { transform: scale(1.04); }
.dl-logo-wordmark {
  background: linear-gradient(90deg,#9333ea,#6d5ef0 55%,#0ea5e9);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.dl-logo-tagline { color: var(--txt-3); font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }

.sidebar-logo-text strong {
  display: block;
  font-size: .9rem;
  font-weight: 800;
  color: var(--sb-txt-h);
  letter-spacing: -.01em;
}
.sidebar-logo-text span {
  display: block;
  font-size: .68rem;
  font-weight: 500;
  color: var(--sb-txt);
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
  padding: 12px 10px 8px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-section-label {
  padding: 10px 12px 5px;
  font-size: .6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #a0aec0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px 7px 12px;
  border-radius: var(--r);
  color: var(--sb-txt);
  font-size: .8rem;
  font-weight: 500;
  transition: background var(--t), color var(--t);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.nav-item > span:not(.nav-num) {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item i:not(.nav-item-popout) {
  width: 16px;
  text-align: center;
  font-size: .75rem;
  flex-shrink: 0;
  color: #94a3b8;
  transition: color var(--t);
}
.nav-item:hover i:not(.nav-item-popout),
.nav-item.active i:not(.nav-item-popout) { color: inherit; }

/* Collapsible sidebar tool categories */
.nav-cat {
  margin-bottom: 2px;
  border-radius: var(--r);
  border-left: 2.5px solid transparent;
  transition: border-color .2s;
}
.nav-cat[open] {
  border-left-color: var(--cat-color, var(--brand));
  background: rgba(0,0,0,.015);
  border-radius: var(--r);
}
html[data-theme="dark"] .nav-cat[open] { background: rgba(255,255,255,.025); }
.nav-cat[open] .nav-item { padding-left: 10px; }
.nav-cat[open] .nav-item.active { padding-left: 7.5px; }
.nav-cat-title {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px 8px 8px;
  margin: 0;
  border-radius: var(--r);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--sb-txt);
  display: flex;
  align-items: center;
  gap: 7px;
  user-select: none;
  transition: background .15s, color .15s;
}
.nav-cat-title:hover { background: var(--sb-hover); color: var(--sb-txt-h); }
.nav-cat-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.2);
}
.wf-results-title {
  padding: 9px 10px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #9ca3af;
}
.nav-cat-title::-webkit-details-marker { display: none; }
.nav-cat-name { flex: 1; min-width: 0; }
.nav-cat-title::after {
  content: '\f078';
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: .55rem;
  transition: transform .2s ease;
  flex-shrink: 0;
  color: #94a3b8;
}
.nav-cat[open] > .nav-cat-title::after { transform: rotate(180deg); }
.nav-cat-count {
  font-size: .62rem;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 6px;
  text-transform: none;
  letter-spacing: 0;
  flex-shrink: 0;
}
.nav-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
.nav-item:has(.nav-num) i { width: auto; }
/* Flat list mode (non-admin ≤12 tools): uniform brand color numbers, subtle dividers */
.nav-num-flat { background-color: var(--brand) !important; }
.nav-item-flat { border-bottom: 1px solid var(--sb-border); border-radius: 0; }
.nav-item-flat:first-of-type { border-radius: var(--r) var(--r) 0 0; }
.nav-item-flat:last-of-type { border-bottom: none; border-radius: 0 0 var(--r) var(--r); }
.nav-item-flat.active { border-radius: var(--r); }
.nav-item:hover { background: var(--sb-hover); color: var(--sb-txt-h); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(37,99,235,.12) 0%, rgba(37,99,235,.04) 100%);
  color: var(--brand);
  font-weight: 700;
  border-left: 2.5px solid var(--brand);
  padding-left: 9.5px;
}
.nav-item.active .nav-num { box-shadow: 0 2px 8px rgba(37,99,235,.35); }

.nav-item-popout {
  margin-left: auto;
  opacity: 0;
  font-size: .7rem !important;
  width: auto !important;
  padding: 4px;
  border-radius: 4px;
  color: #94a3b8;
  transition: opacity .15s, background .15s;
}
.nav-item:hover .nav-item-popout { opacity: 1; }
.nav-item-popout:hover { background: var(--sb-hover); color: var(--brand); }

/* Tool search box */
.nav-tool-search {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 10px 8px;
  padding: 8px 11px;
  background: var(--sb-inset);
  border: 1.5px solid var(--sb-border);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.nav-tool-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}
.nav-tool-search i { color: #94a3b8; font-size: .72rem; flex-shrink: 0; }
.nav-tool-search input {
  background: none; border: none; outline: none;
  color: var(--sb-txt-h);
  font-size: .78rem; width: 100%;
  font-family: inherit;
}
.nav-tool-search input::placeholder { color: #b0b8c8; }

/* Workflow quick-filter chips */
.nav-workflow-chips {
  display: flex; align-items: stretch; gap: 5px;
  margin: 0 10px 12px;
}
.wf-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--sb-border);
  background: var(--sb-inset);
  color: var(--sb-txt);
  font-size: .62rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 5px 5px;
  border-radius: 7px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.wf-chip i { font-size: .6rem; flex-shrink: 0; }
.wf-chip:hover { background: var(--sb-tint); border-color: var(--sb-tint-mid); color: var(--sb-tint-dark); }
.wf-chip.wf-active.wf-update {
  background: linear-gradient(135deg, #fef3c7, #fde68a20);
  border-color: #f59e0b; color: #92400e; font-weight: 700;
}
.wf-chip.wf-active.wf-create {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe20);
  border-color: #6366f1; color: #4338ca; font-weight: 700;
}
.wf-chip.wf-clear {
  flex: 0 0 auto;
  width: 28px;
  background: none; border: 1.5px solid var(--sb-border);
  color: #dc2626; padding: 7px 0;
}
.wf-chip.wf-clear:hover { background: var(--sb-red-tint); color: #dc2626; border-color: var(--sb-red-bd); }

.nav-no-results {
  padding: 14px 10px;
  text-align: center;
  font-size: .78rem;
  color: #94a3b8;
}

.nav-sub {
  margin-left: 18px;
  padding-left: 14px;
  font-size: .8rem;
  border-left: 2px solid var(--sb-border);
  border-radius: 0 var(--r) var(--r) 0;
  margin-top: -4px;
}


.nav-divider {
  height: 1px;
  background: var(--sb-border);
  margin: 6px 2px;
}

.nav-item.nav-logout { color: #dc2626; }
.nav-item.nav-logout:hover { background: var(--sb-red-tint); color: #dc2626; }

/* Error tracking section in sidebar */
.sidebar-error-section {
  padding: 8px 0 12px;
  border-top: 1px solid var(--sb-border);
  margin-top: auto;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sb-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  transition: background .18s;
  border-radius: 0 0 0 0;
}
.sidebar-footer:hover { background: var(--sb-inset); }
.sf-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: .76rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(37,99,235,.3);
}
.sf-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--sb-txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(8,6,24,.6);
  z-index: 250;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .32s ease;
}
.sidebar-overlay.active {
  display: block;
  animation: overlayFadeIn .32s ease forwards;
}
@keyframes overlayFadeIn {
  from { opacity: 0; backdrop-filter: blur(0); }
  to   { opacity: 1; backdrop-filter: blur(8px); }
}


/* ── Main area ──────────────────────────────────────────────── */

.crm-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sb-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .32s cubic-bezier(.4,0,.2,1);
  background: var(--page-bg);
  overflow-x: hidden;
}

/* Topbar */
.crm-topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 var(--border), 0 2px 12px rgba(0,0,0,.04);
  gap: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.topbar-left  { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; overflow: hidden; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ── Hamburger toggle (CRM sidebar) ─────────────────────────── */
@keyframes sbPulse {
  0%   { box-shadow: 0 2px 8px rgba(99,102,241,.35), 0 0 0 0 rgba(99,102,241,.3); }
  60%  { box-shadow: 0 2px 8px rgba(99,102,241,.35), 0 0 0 10px rgba(99,102,241,.0); }
  100% { box-shadow: 0 2px 8px rgba(99,102,241,.35), 0 0 0 0 rgba(99,102,241,.0); }
}
@keyframes sbPulseOpen {
  0%   { box-shadow: 0 2px 10px rgba(225,29,72,.4), 0 0 0 0 rgba(225,29,72,.28); }
  60%  { box-shadow: 0 2px 10px rgba(225,29,72,.4), 0 0 0 10px rgba(225,29,72,.0); }
  100% { box-shadow: 0 2px 10px rgba(225,29,72,.4), 0 0 0 0 rgba(225,29,72,.0); }
}
.sidebar-toggle {
  display: none;
  width: 42px; height: 42px;
  border: none; border-radius: 13px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative; overflow: hidden;
  box-shadow: 0 3px 12px rgba(99,102,241,.4);
  transition: transform .18s, box-shadow .18s;
}
.sidebar-toggle:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 20px rgba(99,102,241,.5);
}
.sidebar-toggle:active { transform: scale(.92); }

/* Shine overlay */
.sidebar-toggle::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255,255,255,.22) 0%, transparent 55%);
  pointer-events: none;
}

/* Hamburger icon — 3 lines */
.sidebar-toggle .sb-icon {
  display: flex; flex-direction: column;
  gap: 5px; width: 20px; pointer-events: none;
  position: relative; z-index: 1;
}
.sidebar-toggle .sb-icon span {
  display: block; height: 2px; border-radius: 4px;
  background: #fff;
  transform-origin: center;
  transition: transform .38s cubic-bezier(.68,-.15,.265,1.35),
              opacity .25s ease,
              width .3s ease;
}
.sidebar-toggle .sb-icon span:nth-child(1) { width: 20px; }
.sidebar-toggle .sb-icon span:nth-child(2) { width: 13px; margin-left: 0; }
.sidebar-toggle .sb-icon span:nth-child(3) { width: 20px; }

/* Open state → X + color shift to rose */
.sidebar-toggle.sidebar-toggle-open {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 3px 12px rgba(239,68,68,.4);
}
.sidebar-toggle.sidebar-toggle-open:hover {
  box-shadow: 0 6px 20px rgba(239,68,68,.5);
}
.sidebar-toggle.sidebar-toggle-open .sb-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg); width: 20px;
}
.sidebar-toggle.sidebar-toggle-open .sb-icon span:nth-child(2) {
  opacity: 0; width: 0; transform: scaleX(0);
}
.sidebar-toggle.sidebar-toggle-open .sb-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg); width: 20px;
}

/* ── Desktop sidebar collapse toggle ────────────────────────── */
.sb-collapse-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--txt-2); cursor: pointer;
  transition: background .28s cubic-bezier(.4,0,.2,1),
              border-color .28s, color .28s,
              box-shadow .28s, transform .2s;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  font-size: .82rem;
  position: relative; overflow: hidden;
}
.sb-collapse-btn::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 60%);
  opacity: 0; transition: opacity .28s;
  pointer-events: none;
}
.sb-collapse-btn:hover {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,235,.3);
  transform: scale(1.06);
}
.sb-collapse-btn:hover::after { opacity: 1; }
.sb-collapse-btn:active { transform: scale(.9); }
@media (max-width: 900px) { .sb-collapse-btn { display: none; } }

/* Collapsed state */
body.sb-collapsed .crm-sidebar { transform: translateX(-100%); }
body.sb-collapsed .crm-main { margin-left: 0; }
body.sb-collapsed .sb-collapse-btn {
  background: linear-gradient(135deg, #818cf8, #6366f1, #4338ca);
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 14px rgba(99,102,241,.4);
}
body.sb-collapsed .sb-collapse-btn::after { opacity: 1; }

.topbar-breadcrumb {
  display: flex; align-items: center; gap: 5px;
  font-size: .82rem; color: var(--txt-2);
  white-space: nowrap;
  min-width: 0; overflow: hidden;
}
.topbar-breadcrumb a { color: var(--txt-2); font-weight: 500; flex-shrink: 0; }
.topbar-breadcrumb a:hover { color: var(--brand); }
.topbar-breadcrumb .bc-sep { color: var(--txt-3); font-size: .7rem; flex-shrink: 0; }
.topbar-breadcrumb .bc-current {
  color: var(--txt); font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Knowledge Base / Error Report search mode toggle (reused on home hero + /search page) */
.hero-search-toggle {
  display: flex; gap: 6px; margin-bottom: 16px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 30px; padding: 4px; width: fit-content;
}
.hst-btn {
  padding: 7px 18px; border: none; border-radius: 24px; cursor: pointer;
  font-family: inherit; font-size: .83rem; font-weight: 600;
  background: none; color: var(--txt-3); transition: all .2s; display: flex; align-items: center; gap: 6px;
}
.hst-btn:hover { color: var(--txt); }
.hst-active { background: var(--brand) !important; color: #fff !important; }
#hstErr.hst-active, .hst-btn[id$="Err"].hst-active { background: #f59e0b !important; }

/* Global search */
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--page-bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  flex: 0 0 220px;
  transition: flex-basis 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease,
              background 0.25s ease,
              border-radius 0.3s ease;
}
.topbar-search.ts-expanded {
  flex: 1 1 auto;
  border-color: var(--brand);
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 0 0 4px rgba(37,99,235,.13), 0 2px 12px rgba(37,99,235,.10);
}
.topbar-search-toggle { display: flex; gap: 2px; flex-shrink: 0; }
.tst-btn {
  border: none; background: transparent; color: var(--txt-3);
  width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; transition: all .15s;
}
.tst-btn:hover { color: var(--txt); background: var(--page-bg); }
.tst-btn.tst-active { color: #fff; background: var(--brand); }
#tstErr.tst-active { background: #f59e0b; }
.topbar-search i { transition: color 0.2s ease; }
.topbar-search.ts-expanded i { color: var(--brand); }
.topbar-search i   { color: var(--txt-3); font-size: .8rem; flex-shrink: 0; }
.topbar-search input {
  border: none; background: transparent;
  font-size: .84rem; color: var(--txt);
  font-family: inherit; width: 100%; outline: none;
}
.topbar-search input::placeholder { color: var(--txt-3); }
.topbar-search { position: relative; }
.search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  z-index: 9999;
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
}
.sg-group {
  padding: 6px 14px 3px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--txt-3);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.sg-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.sg-item:hover, .sg-item.sg-active { background: var(--bg); }
.sg-text { flex: 1; min-width: 0; }
.sg-label {
  font-size: .83rem;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-label mark {
  background: rgba(37,99,235,.18);
  color: var(--brand);
  border-radius: 2px;
  padding: 0 1px;
}
.sg-sub {
  font-size: .72rem;
  color: var(--txt-3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sg-footer {
  padding: 7px 14px;
  font-size: .72rem;
  color: var(--txt-3);
  background: var(--bg);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* Topbar icon button */
.topbar-icon-btn {
  width: 34px; height: 34px;
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--txt-2); font-size: .85rem;
  cursor: pointer; transition: all var(--t);
  text-decoration: none;
}
.topbar-icon-btn:hover {
  background: var(--brand-light);
  color: var(--brand);
  border-color: var(--brand-mid);
  transform: scale(1.08);
}
.topbar-icon-btn:active { transform: scale(.9); }

/* Day/night toggle icon-flip animation */
#themeToggleIcon { display: inline-block; }
@keyframes themeIconFlip {
  0%   { transform: rotate(0deg) scale(1); opacity: 1; }
  45%  { transform: rotate(180deg) scale(.3); opacity: .25; }
  100% { transform: rotate(360deg) scale(1); opacity: 1; }
}
#themeToggleIcon.theme-icon-flip { animation: themeIconFlip .85s cubic-bezier(.34,1.56,.64,1); }

/* Neon theme toggle button — glows green once active */
#neonToggleIcon.theme-icon-flip { animation: themeIconFlip .85s cubic-bezier(.34,1.56,.64,1); }
#neonToggleBtn.neon-active {
  background: #39FF14;
  color: #0B0B0F;
  border-color: #39FF14;
  box-shadow: 0 0 10px 1px rgba(57,255,20,.6);
}
#neonToggleBtn.neon-active:hover { background: #2ECC0F; }

/* Circular "wipe" reveal when switching day/night (driven from toggleTheme() via the View Transitions API) */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* ── Tool launch animations (static/js/tool-launch-fx.js) ──────────────
   Soft, subtle, and never blocks navigation — the link follows immediately;
   this just plays alongside it for the instant before the new page loads.
   New-tab click: a ghost copy of the card lifts and glides away (not
   shrinking to a point — that reads as "closing"). */
@keyframes toolZoomLaunch {
  0%   { transform: scale(1);     opacity: 1; }
  100% { transform: scale(1.015); opacity: .92; }
}
html.tool-zoom-launching {
  transform-origin: 50% 50% !important;
  animation: toolZoomLaunch .18s cubic-bezier(.4,0,.2,1) forwards;
  will-change: transform, opacity;
}

@keyframes toolFlyToTab {
  0%   { transform: translate(0,0)     scale(1);   opacity: 1; }
  35%  { transform: translate(0,-6px)  scale(1.04); opacity: 1; }
  100% { transform: translate(var(--fly-x), var(--fly-y)) scale(.7); opacity: 0; }
}
.tool-fly-ghost {
  position: fixed; z-index: 99999; pointer-events: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-radius: var(--r-lg);
  box-shadow: 0 12px 30px rgba(0,0,0,.3);
  animation: toolFlyToTab .55s ease-in-out forwards;
}

/* Topbar user chip */
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 5px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--t);
  background: var(--surface);
}
.topbar-user:hover { border-color: var(--brand-mid); background: var(--brand-light); }

.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: .74rem;
  flex-shrink: 0;
}
.user-name { font-size: .8rem; font-weight: 700; color: var(--txt); }

/* Content area */
.crm-content { flex: 1; min-width: 0; padding: 26px 28px 40px; }

/* Small legal-links footer shown at the bottom of every logged-in page and
   every public (no-login) tool page, so Privacy/Terms/Refund stay reachable
   everywhere on the site, not just the marketing pages. */
.crm-legal-footer {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: .76rem; color: var(--txt-3);
}
.crm-legal-footer a { display: inline-flex; align-items: center; gap: 6px; color: var(--txt-3); text-decoration: none; transition: color .2s; }
.crm-legal-footer a:hover { color: var(--brand); }
.crm-legal-footer a i { font-size: .85rem; color: var(--brand); }
.crm-legal-footer span { margin-left: auto; }
.auth-legal-footer { justify-content: center; margin-top: 22px; }

/* ── Public (no-login) tool shell — same fixed, scroll-contained chrome for
   every free tool. The outer shell never scrolls; only the tool content
   area does, so there's a single contained scrollbar instead of the page
   itself growing taller than the viewport. ── */
.public-tool-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 50%, #e0e7ff 100%);
  position: relative;
}
html[data-theme="dark"] .public-tool-shell { background: linear-gradient(135deg, #0f172a 0%, #131c33 50%, #0f1a2e 100%); }
html[data-theme="dark"].theme-neon .public-tool-shell { background: linear-gradient(135deg, #0B0B0F 0%, #0e1410 50%, #0B0B0F 100%); }
html.theme-violet:not([data-theme="dark"]) .public-tool-shell { background: linear-gradient(135deg, #ede9ff 0%, #f7f5ff 50%, #fff 100%); }
html.theme-violet[data-theme="dark"] .public-tool-shell { background: linear-gradient(135deg, #170f2e 0%, #1f1637 50%, #120a26 100%); }
html.theme-cyber:not([data-theme="dark"]) .public-tool-shell { background: linear-gradient(135deg, #f0f7ff 0%, #e3f0ff 50%, #fff 100%); }
html.theme-cyber[data-theme="dark"] .public-tool-shell { background: linear-gradient(135deg, #06070a 0%, #0d1117 50%, #06070a 100%); }
html.theme-sunshine:not([data-theme="dark"]) .public-tool-shell { background: linear-gradient(135deg, #fffdf5 0%, #fbf6e3 50%, #fff 100%); }
html.theme-sunshine[data-theme="dark"] .public-tool-shell { background: linear-gradient(135deg, #1a1610 0%, #241d12 50%, #15110c 100%); }
html.theme-aurora:not([data-theme="dark"]) .public-tool-shell { background: linear-gradient(135deg, #faf5ff 0%, #f6ebff 50%, #fff 100%); }
html.theme-aurora[data-theme="dark"] .public-tool-shell { background: linear-gradient(135deg, #0d0a1a 0%, #161029 50%, #110c22 100%); }
.public-tool-shell::before, .public-tool-shell::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
}
.public-tool-shell::before {
  width: 500px; height: 500px; top: -200px; right: -150px;
  background: radial-gradient(circle, rgba(37,99,235,.1) 0%, transparent 70%);
}
.public-tool-shell::after {
  width: 400px; height: 400px; bottom: -160px; left: -120px;
  background: radial-gradient(circle, rgba(37,99,235,.08) 0%, transparent 70%);
}
.public-tool-bar, .public-tool-content { position: relative; z-index: 1; }
.public-tool-bar {
  flex-shrink: 0;
  display: flex; align-items: center;
  padding: 8px 20px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.public-tool-back {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--txt-2);
  text-decoration: none;
  font-size: .85rem; font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--r);
  transition: background .15s, color .15s, transform .15s;
}
.public-tool-back:hover { background: var(--sb-hover); color: var(--brand); transform: translateX(-2px); }
.public-tool-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 20px 18px;
}
@media (max-width: 640px) {
  .public-tool-content { padding: 12px 14px 16px; }
}


/* ================================================================
   PAGE HEADER
   ================================================================ */

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

.page-header h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--txt);
  letter-spacing: -.02em;
}
.page-subtitle  { font-size: .82rem; color: var(--txt-2); margin-top: 3px; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Breadcrumbs */
.breadcrumbs {
  display: flex; align-items: center; gap: 5px;
  font-size: .78rem; color: var(--txt-2); margin-bottom: 16px;
}
.breadcrumbs a { color: var(--txt-2); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { color: var(--txt-3); }
.breadcrumbs .current { color: var(--txt); font-weight: 700; }


/* ================================================================
   STAT CARDS
   ================================================================ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Each stat card — flat light card with a colored left accent + icon badge */
.stat-card {
  border-radius: var(--r-lg);
  padding: 20px 22px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--brand);
  color: var(--txt);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

/* Colour variants — accent border + a soft colour wash across the card,
   instead of just a thin line, so each card reads as "that colour" at a glance. */
.stat-card.purple { border-left-color: #6366f1; background: linear-gradient(120deg, #eef2ff 0%, var(--surface) 65%); }
.stat-card.blue   { border-left-color: #2563eb; background: linear-gradient(120deg, #eff6ff 0%, var(--surface) 65%); }
.stat-card.green  { border-left-color: #10b981; background: linear-gradient(120deg, #ecfdf5 0%, var(--surface) 65%); }
.stat-card.orange { border-left-color: #f59e0b; background: linear-gradient(120deg, #fffbeb 0%, var(--surface) 65%); }
.stat-card.teal   { border-left-color: #14b8a6; background: linear-gradient(120deg, #f0fdfa 0%, var(--surface) 65%); }
.stat-card.rose   { border-left-color: #f43f5e; background: linear-gradient(120deg, #fff1f2 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card.purple { background: linear-gradient(120deg, rgba(99,102,241,.16) 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card.blue   { background: linear-gradient(120deg, rgba(37,99,235,.16) 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card.green  { background: linear-gradient(120deg, rgba(16,185,129,.16) 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card.orange { background: linear-gradient(120deg, rgba(245,158,11,.16) 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card.teal   { background: linear-gradient(120deg, rgba(20,184,166,.16) 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card.rose   { background: linear-gradient(120deg, rgba(244,63,94,.16) 0%, var(--surface) 65%); }

/* Icon */
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--brand-light); color: var(--brand);
  display: grid; place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.stat-card.purple .stat-icon { background: #eef2ff; color: #6366f1; }
.stat-card.blue   .stat-icon { background: #eff6ff; color: #2563eb; }
.stat-card.green  .stat-icon { background: #ecfdf5; color: #059669; }
.stat-card.orange .stat-icon { background: #fffbeb; color: #d97706; }
.stat-card.teal   .stat-icon { background: #f0fdfa; color: #0d9488; }
.stat-card.rose   .stat-icon { background: #fff1f2; color: #e11d48; }

/* Older usage puts the colour class on the icon itself rather than the card */
.stat-icon.purple { background: #eef2ff; color: #6366f1; }
.stat-icon.blue   { background: #eff6ff; color: #2563eb; }
.stat-icon.green  { background: #ecfdf5; color: #059669; }
.stat-icon.orange { background: #fffbeb; color: #d97706; }
.stat-icon.teal   { background: #f0fdfa; color: #0d9488; }
.stat-icon.rose   { background: #fff1f2; color: #e11d48; }
.stat-card:has(.stat-icon.purple) { border-left-color: #6366f1; background: linear-gradient(120deg, #eef2ff 0%, var(--surface) 65%); }
.stat-card:has(.stat-icon.blue)   { border-left-color: #2563eb; background: linear-gradient(120deg, #eff6ff 0%, var(--surface) 65%); }
.stat-card:has(.stat-icon.green)  { border-left-color: #10b981; background: linear-gradient(120deg, #ecfdf5 0%, var(--surface) 65%); }
.stat-card:has(.stat-icon.orange) { border-left-color: #f59e0b; background: linear-gradient(120deg, #fffbeb 0%, var(--surface) 65%); }
.stat-card:has(.stat-icon.teal)   { border-left-color: #14b8a6; background: linear-gradient(120deg, #f0fdfa 0%, var(--surface) 65%); }
.stat-card:has(.stat-icon.rose)   { border-left-color: #f43f5e; background: linear-gradient(120deg, #fff1f2 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card:has(.stat-icon.purple) { background: linear-gradient(120deg, rgba(99,102,241,.16) 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card:has(.stat-icon.blue)   { background: linear-gradient(120deg, rgba(37,99,235,.16) 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card:has(.stat-icon.green)  { background: linear-gradient(120deg, rgba(16,185,129,.16) 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card:has(.stat-icon.orange) { background: linear-gradient(120deg, rgba(245,158,11,.16) 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card:has(.stat-icon.teal)   { background: linear-gradient(120deg, rgba(20,184,166,.16) 0%, var(--surface) 65%); }
html[data-theme="dark"] .stat-card:has(.stat-icon.rose)   { background: linear-gradient(120deg, rgba(244,63,94,.16) 0%, var(--surface) 65%); }

.stat-body { position: relative; z-index: 1; flex: 1; min-width: 0; }
.stat-value { font-size: 2rem; font-weight: 900; line-height: 1; letter-spacing: -1.5px; color: var(--txt); }
.stat-label { font-size: .76rem; font-weight: 600; color: var(--txt-2); margin-top: 3px; letter-spacing: .01em; }
.stat-link  { font-size: .71rem; font-weight: 700; color: var(--brand); opacity: .85; margin-top: 7px; display: block; }
.stat-link:hover { opacity: 1; }


/* ================================================================
   CARDS
   ================================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--sh1);
  margin-bottom: 18px;
}

.card-accent-left { border-left: 3px solid var(--brand); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 8px;
}
.card-header h2 { font-size: .92rem; font-weight: 700; color: var(--txt); margin: 0; }
.card-header h3 { font-size: .88rem; font-weight: 700; color: var(--txt); margin: 0; }
.card h2 { font-size: .92rem; font-weight: 700; color: var(--txt); margin-bottom: 14px; }


/* ================================================================
   BUTTONS
   ================================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: .83rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--t);
  text-decoration: none; white-space: nowrap;
  font-family: inherit; line-height: 1.4;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 2px 6px rgba(37,99,235,.25);
}
.btn-primary:hover {
  background: var(--brand-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface); color: var(--txt-2);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--page-bg); color: var(--txt); border-color: #d1d5db; }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; transform: translateY(-1px); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; transform: translateY(-1px); }

.btn-link-open {
  background: var(--brand-light); color: var(--brand);
  border: 1.5px solid var(--brand-mid);
}
.btn-link-open:hover { background: var(--brand-mid); color: var(--brand-dark); }

.btn-ghost {
  background: transparent; color: var(--txt-2);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--page-bg); color: var(--txt); }

.btn-full  { width: 100%; }
.btn-sm    { padding: 5px 11px; font-size: .775rem; }
.btn-lg    { padding: 10px 22px; font-size: .92rem; }
.btn-icon  { width: 32px; height: 32px; padding: 0; border-radius: var(--r-sm); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:active { transform: translateY(0) !important; }


/* ================================================================
   FORMS
   ================================================================ */

.form-group { margin-bottom: 14px; }

.form-group label {
  display: block; margin-bottom: 5px;
  font-size: .8rem; font-weight: 700;
  color: var(--txt); letter-spacing: .01em;
}

.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=password],
.form-group input[type=url],
.form-group input[type=date],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  font-size: .86rem; color: var(--txt);
  background: var(--surface); font-family: inherit;
  transition: border-color var(--t), box-shadow var(--t);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.form-group textarea { resize: vertical; min-height: 80px; }

/* Search box */
.search-box { display: flex; gap: 8px; }
.search-box input {
  flex: 1; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: var(--r);
  font-size: .86rem; color: var(--txt);
  background: var(--surface); font-family: inherit;
  transition: border-color var(--t), box-shadow var(--t);
}
.search-box input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Quill editor */
.ql-container.ql-snow { border: 1.5px solid var(--border) !important; border-top: none !important; border-radius: 0 0 var(--r) var(--r) !important; }
.ql-toolbar.ql-snow   { border: 1.5px solid var(--border) !important; border-bottom: none !important; border-radius: var(--r) var(--r) 0 0 !important; background: var(--page-bg); }
.ql-editor { min-height: 90px; font-family: 'Inter', sans-serif; font-size: .87rem; }


/* ================================================================
   DOMAIN CARDS
   ================================================================ */

.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

.domain-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--sh1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
}
.domain-card:hover {
  box-shadow: var(--sh3);
  border-color: var(--brand-mid);
  transform: translateY(-2px);
}

.domain-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.domain-card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand-mid) 100%);
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: .9rem;
  color: var(--brand);
  border: 1px solid var(--brand-mid);
}

.domain-card-info h3 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--txt);
  line-height: 1.3;
}

.link-count {
  font-size: .73rem;
  color: var(--txt-3);
  font-weight: 500;
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.domain-card-desc {
  font-size: .81rem;
  color: var(--txt-2);
  line-height: 1.55;
  flex: 1;
}

.domain-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-2);
  margin-top: auto;
}
.domain-actions .btn { font-size: .77rem; padding: 6px 12px; }
.domain-actions .btn-icon { width: 30px; height: 30px; font-size: .75rem; }


/* ================================================================
   LINK ITEMS
   ================================================================ */

.link-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow var(--t), border-color var(--t);
  position: relative;
  border-left: 4px solid var(--brand);
}
.link-item:hover { box-shadow: var(--sh2); border-color: var(--brand-mid); }

.link-item-icon {
  width: 38px; height: 38px;
  border-radius: var(--r);
  background: var(--brand-light);
  display: grid; place-items: center;
  flex-shrink: 0;
  color: var(--brand);
  font-size: .85rem;
  border: 1px solid var(--brand-mid);
}

.link-item-body { flex: 1; min-width: 0; }
.link-item-body h3 { font-size: .9rem; font-weight: 700; color: var(--txt); margin-bottom: 3px; }

.link-item-meta {
  font-size: .75rem; color: var(--txt-3);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 4px;
}
.link-item-url {
  font-size: .75rem; color: var(--brand);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 300px; display: block; margin-top: 2px;
}
.link-item-desc { font-size: .8rem; color: var(--txt-2); margin-top: 4px; }

.link-item-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start; }
.link-item-actions .btn { padding: 5px 10px; font-size: .76rem; }


/* ================================================================
   NOTE ITEMS
   ================================================================ */

.note-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-2);
}
.note-item:last-child { border-bottom: none; }

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 10px;
  box-shadow: var(--sh0);
  transition: box-shadow var(--t);
}
.note-card:hover { box-shadow: var(--sh2); }

.note-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 8px;
}

.tag-badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid var(--brand-mid);
  border-radius: 20px;
  font-size: .7rem; font-weight: 700;
  letter-spacing: .01em;
}

.note-meta {
  font-size: .75rem; color: var(--txt-3);
  margin-top: 8px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.note-actions { display: flex; gap: 6px; margin-top: 8px; }
.note-actions .btn { padding: 4px 10px; font-size: .75rem; }

/* Note content (rich) */
.note-content img { max-width: 100%; border-radius: var(--r-sm); }
.note-content p { margin: .3rem 0; }


/* ================================================================
   STATUS / BADGE
   ================================================================ */

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .71rem; font-weight: 700;
  letter-spacing: .02em;
}
.badge-success { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-bd); }
.badge-danger  { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-bd); }
.badge-warning { background: var(--amber-bg);  color: var(--amber);  border: 1px solid var(--amber-bd); }
.badge-info    { background: var(--blue-bg);   color: var(--blue);   border: 1px solid var(--blue-bd); }
.badge-purple  { background: var(--brand-light); color: var(--brand); border: 1px solid var(--brand-mid); }
.badge-gray    { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }


/* ================================================================
   TABLES
   ================================================================ */

.table-wrapper { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; }
th {
  background: var(--page-bg);
  padding: 10px 14px;
  text-align: left; font-size: .74rem;
  font-weight: 700; color: var(--txt-2);
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  font-size: .83rem;
  border-bottom: 1px solid var(--border-2);
  color: var(--txt);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--page-bg); }

.table-wrap { overflow-x: auto; overflow-y: auto; max-height: 60vh; border-radius: var(--r-lg); border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table thead th { position: sticky; top: 0; z-index: 2; }
.admin-table th { background: var(--page-bg); padding: 10px 14px; text-align: left; font-size: .73rem; font-weight: 700; color: var(--txt-2); text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table td { padding: 10px 14px; font-size: .83rem; border-bottom: 1px solid var(--border-2); color: var(--txt); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--page-bg); }


/* ================================================================
   FLASH MESSAGES
   ================================================================ */

.flash-overlay {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}

.flash-popup {
  display: flex; flex-direction: column; gap: 6px;
}

.flash-message {
  padding: 13px 18px;
  border-radius: var(--r-lg);
  font-size: .84rem; font-weight: 600;
  box-shadow: var(--sh3);
  animation: slideUp .25s ease;
  max-width: 340px;
  display: flex; align-items: center; gap: 8px;
  backdrop-filter: blur(10px);
}

.flash-message::before {
  content: '●';
  font-size: .5rem;
  flex-shrink: 0;
}

.flash-success { background: #fff; color: var(--green); border: 1.5px solid var(--green-bd); border-left: 4px solid var(--green); }
.flash-error, .flash-danger { background: #fff; color: var(--red); border: 1.5px solid var(--red-bd); border-left: 4px solid var(--red); }
.flash-warning { background: #fff; color: var(--amber); border: 1.5px solid var(--amber-bd); border-left: 4px solid var(--amber); }
.flash-info { background: #fff; color: var(--blue); border: 1.5px solid var(--blue-bd); border-left: 4px solid var(--blue); }

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


/* ================================================================
   MODAL
   ================================================================ */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn .15s ease;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh4);
  width: 100%; max-width: 460px;
  animation: scaleIn .2s ease;
  overflow: hidden;
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: .95rem; font-weight: 800; color: var(--txt); }
.modal-close {
  width: 30px; height: 30px;
  border: none; background: var(--page-bg);
  border-radius: var(--r-sm); cursor: pointer;
  font-size: 1.1rem; color: var(--txt-2);
  display: grid; place-items: center;
  transition: background var(--t), color var(--t);
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }

.modal-body { padding: 20px 22px 22px; }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }


/* ================================================================
   BOTTOM SHEET
   ================================================================ */

.bottom-sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 800;
  backdrop-filter: blur(4px);
  animation: fadeIn .15s ease;
}

.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh4);
  z-index: 801;
  padding: 22px 24px 32px;
  animation: slideUp .25s ease;
  max-height: 85vh;
  overflow-y: auto;
}

.sheet-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 18px;
}

.sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.sheet-header h3 { font-size: .97rem; font-weight: 800; color: var(--txt); }
.sheet-close {
  width: 30px; height: 30px;
  border: none; background: var(--page-bg); border-radius: var(--r-sm);
  cursor: pointer; font-size: 1.1rem; color: var(--txt-2);
  display: grid; place-items: center;
  transition: background var(--t), color var(--t);
}
.sheet-close:hover { background: var(--red-bg); color: var(--red); }


/* ================================================================
   EMPTY STATE
   ================================================================ */

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--txt-3);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; display: block; opacity: .4; }
.empty-state h3 { font-size: .97rem; font-weight: 700; color: var(--txt-2); margin-bottom: 6px; }
.empty-state p  { font-size: .83rem; color: var(--txt-3); }


/* ================================================================
   AUTH PAGES  (login / register)
   ================================================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 55% 45% at 92% 8%, rgba(99,102,241,.12) 0%, transparent 70%),
    radial-gradient(ellipse 45% 40% at 8% 92%, rgba(139,92,246,.10) 0%, transparent 65%),
    radial-gradient(ellipse 35% 30% at 50% 50%, rgba(37,99,235,.05) 0%, transparent 80%),
    #ffffff;
  padding: 90px 24px 24px;
  position: relative;
  overflow: hidden;
}
/* Dot grid */
.auth-page::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, #6366f118 1.5px, transparent 1.5px);
  background-size: 32px 32px;
  pointer-events: none; z-index: 0;
}
/* Top-right purple glow */
.auth-page::after {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  top: -280px; right: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.18) 0%, rgba(139,92,246,.08) 45%, transparent 70%);
  pointer-events: none; z-index: 0;
}

html[data-theme="dark"] .auth-page { background: #0f0f14; }
html[data-theme="dark"] .auth-card { background: #1a1a24; border-color: #2a2a3a; box-shadow: 0 20px 60px rgba(0,0,0,.4), 0 4px 16px rgba(99,102,241,.12); }
html[data-theme="dark"].theme-neon .auth-page { background: linear-gradient(135deg, #0B0B0F 0%, #0e1410 60%, #0B0B0F 100%); }
html.theme-neon:not([data-theme="dark"]) .auth-page::before { background: radial-gradient(circle, rgba(22,163,74,.12) 0%, transparent 70%); }
html.theme-neon:not([data-theme="dark"]) .auth-page::after { background: radial-gradient(circle, rgba(22,163,74,.1) 0%, transparent 70%); }
html.theme-violet:not([data-theme="dark"]) .auth-page { background: linear-gradient(135deg, #ede9ff 0%, #f7f5ff 50%, #fff 100%); }
html.theme-violet[data-theme="dark"] .auth-page { background: linear-gradient(135deg, #170f2e 0%, #1f1637 50%, #120a26 100%); }
html.theme-cyber:not([data-theme="dark"]) .auth-page { background: linear-gradient(135deg, #f0f7ff 0%, #e3f0ff 50%, #fff 100%); }
html.theme-cyber[data-theme="dark"] .auth-page { background: linear-gradient(135deg, #06070a 0%, #0d1117 50%, #06070a 100%); }
html.theme-sunshine:not([data-theme="dark"]) .auth-page { background: linear-gradient(135deg, #fffdf5 0%, #fbf6e3 50%, #fff 100%); }
html.theme-sunshine[data-theme="dark"] .auth-page { background: linear-gradient(135deg, #1a1610 0%, #241d12 50%, #15110c 100%); }
html.theme-aurora:not([data-theme="dark"]) .auth-page { background: linear-gradient(135deg, #faf5ff 0%, #f6ebff 50%, #fff 100%); }
html.theme-aurora[data-theme="dark"] .auth-page { background: linear-gradient(135deg, #0d0a1a 0%, #161029 50%, #110c22 100%); }
html[data-theme="dark"].theme-neon .auth-page::before { background: radial-gradient(circle, rgba(57,255,20,.1) 0%, transparent 70%); }
html[data-theme="dark"].theme-neon .auth-page::after { background: radial-gradient(circle, rgba(57,255,20,.08) 0%, transparent 70%); }


.auth-card {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 24px;
  padding: 40px 38px 34px;
  width: 100%; max-width: 420px;
  box-shadow: 0 4px 6px rgba(0,0,0,.03), 0 20px 60px rgba(99,102,241,.10), 0 8px 24px rgba(0,0,0,.06);
  position: relative; z-index: 1;
  animation: dlAuthCardIn .5s cubic-bezier(.2,.9,.3,1.2);
}
/* Shimmer sweep on load */
.auth-card::after {
  content: '';
  position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.45) 50%, transparent 60%);
  animation: authShimmer .9s .3s ease forwards;
  pointer-events: none; z-index: 2;
}
@keyframes authShimmer {
  0%   { left: -60%; opacity: 1; }
  100% { left: 130%; opacity: 0; }
}
/* Top accent bar */
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%;
  height: 3px; border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #2563eb);
}
@keyframes dlAuthCardIn {
  0%   { transform: translateY(22px) scale(.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.auth-back-home {
  position: absolute; top: 22px; left: 22px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--txt-2);
  font-size: .82rem; font-weight: 600;
  text-decoration: none;
  box-shadow: var(--sh2);
  opacity: 0;
  animation: dlAuthBackIn .5s ease .1s forwards;
  transition: transform .2s ease, color .2s ease, border-color .2s ease;
}
.auth-back-home:hover { transform: translateX(-3px); color: var(--brand); border-color: var(--brand); }
.auth-back-home i { font-size: .78rem; }
@keyframes dlAuthBackIn {
  0%   { opacity: 0; transform: translateX(-10px); }
  100% { opacity: 1; transform: translateX(0); }
}

.auth-card .form-group {
  opacity: 0;
  animation: dlAuthFieldIn .45s ease forwards;
}
.auth-card .form-group:nth-of-type(1) { animation-delay: .12s; }
.auth-card .form-group:nth-of-type(2) { animation-delay: .2s; }
.auth-card .form-group:nth-of-type(3) { animation-delay: .28s; }
.auth-card .form-group:nth-of-type(4) { animation-delay: .36s; }
@keyframes dlAuthFieldIn {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-back-home, .auth-card .form-group { animation: none; opacity: 1; }
}

.auth-card-logo {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; margin-bottom: 28px;
}

.auth-logo-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  display: grid; place-items: center;
  font-size: 1.35rem; font-weight: 900; color: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.25), 0 8px 20px rgba(37,99,235,.35);
  letter-spacing: -0.5px;
}

.auth-card-logo .dl-logo-mark {
  animation: dlAuthLogoFloat 3.6s ease-in-out infinite;
}
@keyframes dlAuthLogoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.auth-logo-text {
  text-align: center;
}
.auth-logo-text strong {
  display: block; font-size: 1.15rem;
  font-weight: 900; color: var(--txt); letter-spacing: -.02em;
}
.auth-logo-text span {
  font-size: .75rem; color: var(--txt-3);
  font-weight: 500; letter-spacing: .02em;
}

.auth-title  { font-size: 1.2rem; font-weight: 800; color: var(--txt); margin-bottom: 4px; text-align: center; }
.auth-sub    { font-size: .82rem; color: var(--txt-3); text-align: center; margin-bottom: 24px; }

.auth-footer { text-align: center; margin-top: 20px; font-size: .81rem; color: var(--txt-2); }
.auth-footer a { color: var(--brand); font-weight: 600; }

/* ════════════════════════════════════════════════════════════
   SETTINGS PAGE
   ════════════════════════════════════════════════════════════ */
.stg-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 20px;
  align-items: start;
  width: 100%;
}
/* Left nav */
.stg-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  position: sticky; top: calc(var(--topbar-h) + 14px);
  display: flex; flex-direction: column; gap: 2px;
}
.stg-nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 10px;
  font-size: .855rem; font-weight: 600; color: var(--txt-2);
  background: none; border: none; cursor: pointer;
  transition: background .18s, color .18s;
}
.stg-nav-item i { width: 16px; text-align: center; font-size: .85rem; }
.stg-nav-item:hover { background: var(--bg); color: var(--txt); }
.stg-nav-item.stg-active { background: var(--brand-light); color: var(--brand); }
.stg-nav-user {
  display: flex; align-items: center; gap: 10px;
  margin-top: 8px; padding: 10px 8px 4px;
  border-top: 1px solid var(--border);
}
/* Right content */
.stg-content { min-width: 0; }
.stg-tab { display: none; }
.stg-tab-active { display: block; }
/* Section */
.stg-section { padding: 22px 0; }
.stg-section:first-child { padding-top: 4px; }
.stg-section-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.stg-section-title { font-size: .95rem; font-weight: 700; color: var(--txt); }
.stg-section-sub { font-size: .78rem; color: var(--txt-3); margin-top: 3px; }
.stg-divider { border: none; border-top: 1px solid var(--border); margin: 0; }
/* Avatar row */
.stg-avatar-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
/* Locked badge */
.stg-locked-badge {
  font-size: .7rem; color: var(--txt-3); font-weight: 400;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 1px 7px; margin-left: 6px;
  vertical-align: middle;
}
/* Form grid */
.stg-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stg-form-group { margin: 0 !important; }
.stg-full { grid-column: 1 / -1; }
.stg-disabled-input { background: var(--bg) !important; color: var(--txt-3) !important; cursor: not-allowed; }
.stg-form-actions { margin-top: 16px; display: flex; gap: 10px; }
/* Meta row */
.stg-meta-row { display: flex; gap: 24px; flex-wrap: wrap; }
.stg-meta-item { display: flex; align-items: center; gap: 10px; }
.stg-meta-item > i { font-size: 1.1rem; }
.stg-meta-label { font-size: .72rem; color: var(--txt-3); }
.stg-meta-val { font-size: .86rem; font-weight: 700; color: var(--txt); }
/* Info box */
.stg-info-box {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--brand-light); border: 1px solid var(--brand-mid);
  border-radius: 10px; padding: 12px 14px;
  font-size: .82rem; color: var(--txt-2); line-height: 1.5;
}
/* Session card */
.stg-session-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg);
}
.stg-session-current { border-color: var(--brand-mid); background: var(--brand-light); }
.stg-session-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; color: var(--txt-2); flex-shrink: 0;
}
.stg-session-info { flex: 1; min-width: 0; }
.stg-session-name { font-size: .84rem; font-weight: 700; color: var(--txt); }
.stg-session-sub { font-size: .75rem; color: var(--txt-3); margin-top: 2px; }
.stg-badge-current {
  display: inline-block; font-size: .65rem; font-weight: 700;
  background: #10b981; color: #fff;
  border-radius: 20px; padding: 1px 7px; margin-left: 6px; vertical-align: middle;
}
/* Logout all button */
.stg-logout-all-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px dashed #dc2626; background: #dc26261a; color: #dc2626;
  cursor: pointer; text-align: left; font-family: inherit;
  transition: background .2s, border-color .2s;
}
.stg-logout-all-btn:hover { background: #dc262622; }
.stg-logout-all-btn > i:first-child { font-size: 1rem; flex-shrink: 0; }
.stg-logout-all-title { font-size: .84rem; font-weight: 700; }
.stg-logout-all-sub { font-size: .73rem; opacity: .75; margin-top: 2px; }
/* Login rows (security tab) */
.stg-login-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  background: var(--bg);
}
.stg-login-current { background: var(--brand-light); }
.stg-login-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; color: var(--txt-2); flex-shrink: 0;
}
.stg-login-device { font-size: .82rem; font-weight: 600; color: var(--txt); }
.stg-login-meta { font-size: .72rem; color: var(--txt-3); margin-top: 2px; }
/* Activity rows */
.stg-act-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.stg-act-border { border-bottom: 1px solid var(--border); }
.stg-act-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.stg-act-body { flex: 1; min-width: 0; }
.stg-act-name { font-size: .84rem; font-weight: 600; color: var(--txt); }
.stg-act-detail { font-size: .73rem; color: var(--txt-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stg-act-time { font-size: .73rem; color: var(--txt-3); white-space: nowrap; flex-shrink: 0; }
/* Table */
.stg-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.stg-table th { padding: 8px 10px; font-weight: 600; color: var(--txt-3); text-align: left; border-bottom: 1px solid var(--border); }
.stg-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.stg-table tr:last-child td { border-bottom: none; }
.stg-table-current td { background: var(--brand-light); }
/* Text buttons */
.stg-text-btn { background: none; border: none; cursor: pointer; font-size: .78rem; text-decoration: underline; padding: 0; }
.stg-text-danger { color: #dc2626; }

/* Overview cards */
.stg-overview-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 12px;
}
.stg-ov-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 14px; text-align: center;
  transition: border-color .2s, box-shadow .2s;
}
.stg-ov-card:hover { border-color: var(--ov-c,var(--brand)); box-shadow: 0 3px 12px rgba(0,0,0,.07); }
.stg-ov-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: color-mix(in srgb, var(--ov-c,#6366f1) 12%, transparent);
  color: var(--ov-c,#6366f1);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px; font-size: .88rem;
}
.stg-ov-val { font-size: 1.3rem; font-weight: 900; color: var(--txt); line-height: 1; }
.stg-ov-label { font-size: .72rem; color: var(--txt-3); margin-top: 4px; }

/* Tool usage bar */
.stg-tool-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px; border-radius: 12px;
  text-decoration: none; color: inherit;
  border: 1px solid transparent;
  transition: background .18s, border-color .18s;
}
.stg-tool-bar:hover { background: var(--bg); border-color: var(--border); }
.stg-tool-bar-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; flex-shrink: 0;
}
.stg-tool-bar-body { flex: 1; min-width: 0; }
.stg-tool-bar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.stg-tool-bar-name { font-size: .84rem; font-weight: 700; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stg-tool-bar-count { font-size: .72rem; color: var(--txt-3); white-space: nowrap; flex-shrink: 0; }
.stg-tool-bar-track {
  height: 5px; border-radius: 4px; background: var(--border);
  overflow: hidden;
}
.stg-tool-bar-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  transition: width .4s ease;
}

/* Responsive */
@media (max-width: 760px) {
  .stg-layout { grid-template-columns: 1fr; }
  .stg-nav {
    position: static; flex-direction: row; flex-wrap: wrap;
    padding: 8px; gap: 4px; border-radius: 12px;
  }
  .stg-nav-item {
    flex: 1 1 auto; min-width: 100px;
    justify-content: center; border-radius: 8px;
    padding: 8px 10px; font-size: .8rem;
  }
  .stg-nav-item i { display: none; }
  .stg-nav-user { display: none; }
  .stg-form-grid { grid-template-columns: 1fr; }
  .stg-full { grid-column: 1; }
  .stg-overview-grid { grid-template-columns: 1fr 1fr; }
  .stg-section { padding: 16px 0; }
  .stg-logout-all-btn { width: 100%; justify-content: center; }
  .stg-table { font-size: .78rem; }
  .stg-table th, .stg-table td { padding: 8px 10px; }
}
@media (max-width: 480px) {
  .stg-overview-grid { grid-template-columns: 1fr; }
  .stg-nav-item { font-size: .78rem; padding: 7px 8px; }
  .stg-session-card { flex-direction: column; align-items: flex-start; gap: 8px; }
  .stg-login-row { flex-wrap: wrap; gap: 4px; }
}

/* ── Remember me row ────────────────────────────────────────── */
.auth-remember-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.auth-remember-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.auth-remember-cb { display: none; }
.auth-remember-check {
  width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s, border-color .2s, transform .15s;
  font-size: .65rem; color: transparent;
}
.auth-remember-cb:checked + .auth-remember-check {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: scale(1.08);
}
.auth-remember-text {
  font-size: .82rem; color: var(--txt-2); font-weight: 500;
}
.auth-remember-hint {
  font-size: .75rem; color: var(--txt-3); margin-left: 2px;
}
.auth-forgot-link {
  font-size: .82rem; color: #dc2626; font-weight: 600;
  text-decoration: none;
}
.auth-forgot-link:hover { text-decoration: underline; }

/* Password toggle */
.password-field, .password-wrap { position: relative; }
.password-field input, .password-wrap input { padding-right: 42px; width: 100%; }
.toggle-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--txt-3); font-size: .85rem; padding: 4px;
  transition: color var(--t); line-height: 1;
}
.toggle-eye:hover { color: var(--brand); }


/* ================================================================
   PUBLIC (unauthenticated) PAGES
   ================================================================ */

.public-topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  height: 56px;
}

.public-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: .95rem; font-weight: 900;
  color: var(--txt); text-decoration: none;
  letter-spacing: -.01em;
}
.public-brand-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  display: grid; place-items: center;
  font-size: .85rem; font-weight: 900; color: #fff;
}
.public-nav { display: flex; align-items: center; gap: 8px; }

.hero-section {
  text-align: center;
  padding: 80px 24px 60px;
  background: linear-gradient(180deg, var(--brand-light) 0%, transparent 100%);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-light); color: var(--brand);
  border: 1px solid var(--brand-mid); border-radius: 20px;
  padding: 5px 14px; font-size: .76rem; font-weight: 700;
  margin-bottom: 20px; letter-spacing: .02em;
}
.hero-title {
  font-size: 3rem; font-weight: 900; color: var(--txt);
  line-height: 1.15; margin-bottom: 16px; letter-spacing: -.04em;
}
.hero-title span { color: var(--brand); }
.hero-subtitle {
  font-size: .97rem; color: var(--txt-2); max-width: 520px;
  margin: 0 auto 28px; line-height: 1.7;
}
.hero-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.public-container { max-width: 1100px; margin: 0 auto; padding: 0 24px 60px; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 24px;
  box-shadow: var(--sh1);
  transition: box-shadow var(--t), transform var(--t);
}
.feature-card:hover { box-shadow: var(--sh3); transform: translateY(-2px); }
.feature-icon {
  width: 44px; height: 44px;
  border-radius: 12px; display: grid; place-items: center;
  font-size: 1.1rem; margin-bottom: 14px;
}
.feature-card h3 { font-size: .92rem; font-weight: 700; margin-bottom: 6px; }
.feature-card p  { font-size: .82rem; color: var(--txt-2); line-height: 1.6; }

.how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.how-step { text-align: center; padding: 16px 12px; }
.how-step-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: .9rem; font-weight: 900;
  margin: 0 auto 12px;
}
.how-step h4 { font-size: .87rem; font-weight: 700; margin-bottom: 6px; }
.how-step p  { font-size: .8rem; color: var(--txt-2); }


/* ================================================================
   SETTINGS / PROFILE
   ================================================================ */

.profile-card { text-align: center; padding: 28px 24px; }
.profile-avatar {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; display: grid; place-items: center;
  font-size: 1.8rem; font-weight: 900;
  margin: 0 auto 12px;
  box-shadow: 0 0 0 4px var(--brand-light), 0 8px 20px rgba(37,99,235,.25);
}
.profile-name  { font-size: 1.1rem; font-weight: 800; color: var(--txt); }
.profile-email { font-size: .8rem; color: var(--txt-3); margin-top: 4px; }
.profile-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px; margin-top: 8px;
  font-size: .72rem; font-weight: 700;
}

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .field-grid { grid-template-columns: 1fr; } }

.field-label { font-size: .75rem; font-weight: 700; color: var(--txt-2); letter-spacing: .03em; text-transform: uppercase; margin-bottom: 4px; }
.field-value { font-size: .88rem; font-weight: 600; color: var(--txt); }


/* ================================================================
   SEARCH RESULTS
   ================================================================ */

.search-section { margin-bottom: 20px; }
.search-section-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.search-section-header h3 { font-size: .85rem; font-weight: 800; color: var(--txt); }

.search-result-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  transition: background var(--t);
  text-decoration: none; color: var(--txt);
  margin-bottom: 4px;
}
.search-result-item:hover { background: var(--page-bg); }

.search-result-icon {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  flex-shrink: 0; font-size: .8rem;
}

.search-result-body { flex: 1; min-width: 0; }
.search-result-title { font-size: .86rem; font-weight: 700; color: var(--txt); margin-bottom: 2px; }
.search-result-sub   { font-size: .76rem; color: var(--txt-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ================================================================
   TABS (Admin panel)
   ================================================================ */

.tabs {
  display: flex; gap: 0; margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  padding: 10px 18px;
  background: none; border: none;
  font-size: .845rem; font-weight: 600;
  color: var(--txt-2); cursor: pointer;
  transition: color var(--t);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  display: flex; align-items: center; gap: 6px;
}
.tab-btn:hover { color: var(--txt); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }


/* ================================================================
   MOBILE  (responsive)
   ================================================================ */

@media (max-width: 900px) {
  :root { --sb-w: 280px; }

  .crm-sidebar {
    transform: translateX(-100%);
    transition: transform .38s cubic-bezier(.32,.72,0,1), box-shadow .38s ease;
  }
  .crm-sidebar.sidebar-open {
    transform: translateX(0);
    box-shadow: 12px 0 50px rgba(0,0,0,.22), 4px 0 12px rgba(99,102,241,.08);
  }
  .sidebar-toggle { display: flex !important; }
  .crm-main { margin-left: 0; }
  .crm-topbar { padding: 0 12px; gap: 6px; }
  .topbar-left { gap: 8px; }
  .topbar-right { gap: 6px; }
  .crm-content { padding: 16px 14px 40px; }

  /* Prevent horizontal overflow in tool cards */
  .crm-content .card,
  .crm-content > * { max-width: 100%; box-sizing: border-box; }
  .crm-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .topbar-search { display: none; }
  .user-name { display: none; }
  .topbar-user { padding: 4px 5px; }

  .domain-grid { grid-template-columns: 1fr; }
  .stat-grid   { grid-template-columns: repeat(2, 1fr); }
  .field-grid  { grid-template-columns: 1fr; }

  /* Page header responsive */
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-header-actions { width: 100%; justify-content: stretch; }
  .page-header-actions .btn { flex: 1; text-align: center; justify-content: center; }

  /* Controls row wrapping */
  .controls { flex-wrap: wrap; gap: 8px; }
  .controls .btn { flex: 1 1 auto; min-width: 120px; text-align: center; justify-content: center; }

  /* Form inputs full-width */
  .form-group input, .form-group select, .form-group textarea { width: 100%; box-sizing: border-box; }
}

@media (max-width: 640px) {
  :root { --sb-w: 92vw; }
  .crm-content { padding: 12px 12px 32px; }
  .stat-grid   { grid-template-columns: 1fr; }
  .card { padding: 14px 14px; }
  .page-header h1 { font-size: 1.05rem; }
  .page-subtitle { font-size: .82rem; }

  /* Topbar — hide secondary buttons, shrink gaps */
  #neonToggleBtn { display: none; }
  .topbar-icon-btn { width: 32px; height: 32px; font-size: .8rem; }
  .sidebar-toggle  { width: 40px !important; height: 40px !important; }
  .topbar-left { gap: 6px; }
  .topbar-right { gap: 4px; }
  .topbar-user { padding: 3px 5px; gap: 6px; }
  .topbar-user .user-name { display: none; }

  /* Buttons stack nicely on very small screens */
  .controls { flex-direction: column; }
  .controls .btn { width: 100%; justify-content: center; }

  /* Tables scroll horizontally */
  .card table, table.data-table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 480px) {
  .crm-content { padding: 10px 10px 28px; }
  .card { padding: 12px 12px; border-radius: 12px; }
  .hero-title { font-size: 2rem; }
  .auth-card  { padding: 22px 16px; }
  .topbar-user .user-name { display: none; }
  .topbar-right { gap: 4px; }
  .topbar-icon-btn { width: 30px; height: 30px; font-size: .78rem; }
  .sidebar-toggle { width: 38px !important; height: 38px !important; }
  #themeToggleBtn { display: none; }
}


/* ================================================================
   REGISTER PAGE — extra classes
   ================================================================ */

.reg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) { .reg-grid { grid-template-columns: 1fr; } }

.req { color: var(--red); font-weight: 700; }

.field-error {
  font-size: .75rem;
  color: var(--red);
  margin-top: 4px;
  display: none;
}

.pw-strength {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.pw-strength.is-visible { display: flex; }

.pw-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--red);
  transition: width .3s ease, background .3s ease;
}
.strength-text {
  font-size: .72rem;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
  min-width: 38px;
}

.pw-checklist {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pw-checklist li {
  font-size: .74rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pw-checklist li.passed { color: var(--green); }
.pw-checklist li.failed { color: var(--txt-3); }
.pw-checklist .pw-icon { font-size: .7rem; font-weight: 900; width: 12px; text-align: center; }

/* backwards compat alias */
.password-strength { display: none; margin-top: 6px; }
.password-strength.is-visible { display: block; }
.password-checklist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.password-checklist li { font-size: .74rem; display: flex; align-items: center; gap: 6px; }
.password-checklist li.passed { color: var(--green); }
.password-checklist li.failed { color: var(--txt-3); }
.strength-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }

/* ================================================================
   DASHBOARD HOME — new layout classes
   ================================================================ */

/* Big search bar */
.dash-search-wrap {
  margin-bottom: 22px;
}
.dash-search-form { width: 100%; }
.dash-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 10px 16px;
  transition: border-color var(--t), box-shadow var(--t);
}
.dash-search-inner:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37,99,235,.1);
}
.dash-search-inner > i {
  color: var(--txt-3);
  font-size: 1rem;
  flex-shrink: 0;
}
.dash-search-inner input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: .95rem;
  color: var(--txt);
  font-family: inherit;
  outline: none;
}
.dash-search-inner input::placeholder { color: var(--txt-3); }

/* Two-column grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.dash-card-recent { grid-column: 1; }
@media (max-width: 760px) { .dash-grid { grid-template-columns: 1fr; } .dash-card-recent { grid-column: 1; } }

.card-link {
  font-size: .78rem;
  color: var(--brand);
  font-weight: 700;
  white-space: nowrap;
}
.card-link:hover { color: var(--brand-dark); }

/* Domain rows inside card */
.dash-domain-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-2);
}
.dash-domain-row:last-child { border-bottom: none; }

.dash-domain-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--brand-light);
  border: 1px solid var(--brand-mid);
  display: grid; place-items: center;
  color: var(--brand);
  font-size: .8rem;
  flex-shrink: 0;
}
.dash-domain-info { flex: 1; min-width: 0; }
.dash-domain-name {
  display: block;
  font-size: .86rem;
  font-weight: 700;
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-domain-name:hover { color: var(--brand); }
.dash-domain-meta {
  font-size: .72rem;
  color: var(--txt-3);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Note rows inside card */
.dash-note-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-2);
}
.dash-note-row:last-child { border-bottom: none; }
.dash-note-text {
  font-size: .82rem;
  color: var(--txt);
  line-height: 1.5;
}
.dash-note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.dash-note-meta {
  font-size: .72rem;
  color: var(--txt-3);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Activity log rows */
.dash-log-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-2);
}
.dash-log-row:last-child { border-bottom: none; }
.dash-log-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}
.dash-log-body { flex: 1; font-size: .82rem; color: var(--txt); }
.dash-log-action { font-weight: 700; }
.dash-log-by { color: var(--txt-2); margin-left: 4px; }
.dash-log-model { color: var(--txt-3); font-size: .76rem; margin-left: 4px; }
.dash-log-time { font-size: .72rem; color: var(--txt-3); white-space: nowrap; flex-shrink: 0; }

/* Empty state inside card */
.dash-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--txt-3);
}
.dash-empty i { font-size: 2rem; display: block; margin-bottom: 8px; opacity: .35; }
.dash-empty p { font-size: .82rem; }
.dash-empty a { color: var(--brand); font-weight: 600; }

/* ── Dashboard Banner ─────────────────────────────────────────── */
.dash-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #1e40af 0%, #4f46e5 50%, #7c3aed 100%);
  border-radius: var(--r-lg); padding: 28px 30px 24px;
  margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  box-shadow: 0 4px 24px rgba(79,70,229,.28);
}
.dash-banner::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 80% at 80% 50%, rgba(255,255,255,.08) 0%, transparent 70%);
  pointer-events: none;
}
.dash-banner-left { position: relative; z-index: 1; flex: 1; min-width: 0; }
.dash-greeting { font-size: .75rem; font-weight: 800; color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 3px; }
.dash-hero-title { font-size: 1.9rem; font-weight: 900; color: #fff; margin: 0 0 7px; line-height: 1.15; letter-spacing: -.5px; }
.dash-hero-sub { font-size: .85rem; color: rgba(255,255,255,.68); margin: 0; line-height: 1.5; }
.dash-banner-right { position: relative; z-index: 1; display: flex; gap: 10px; flex-shrink: 0; }
.dash-stat-pill {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18); border-radius: 14px;
  padding: 12px 18px; min-width: 80px; gap: 2px;
}
.dash-stat-pill-val { font-size: 1.3rem; font-weight: 900; color: #fff; line-height: 1; }
.dash-stat-pill-ico { font-size: .78rem; color: rgba(255,255,255,.6); margin-bottom: 2px; }
.dash-stat-pill-lbl { font-size: .66rem; color: rgba(255,255,255,.65); font-weight: 600; letter-spacing: .02em; text-align: center; }

/* ── Dashboard Search bar ────────────────────────────────────── */
.dash-search-wrap { margin-bottom: 20px; }
.dash-search-form { width: 100%; }
.dash-search-inner {
  position: relative; display: flex; align-items: center;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: border-color .18s, box-shadow .18s;
}
.dash-search-inner:focus-within {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.dash-search-inner > i { padding: 0 14px; color: var(--txt-3); font-size: .9rem; flex-shrink: 0; }
.dash-search-inner input {
  flex: 1; border: none; background: transparent; outline: none;
  font-size: .9rem; color: var(--txt); padding: 12px 0; font-family: inherit;
}
.dash-search-inner .btn { margin: 5px 6px; border-radius: 9px; }

/* ── Dashboard main grid ─────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}
.dash-card-recent { grid-column: 1; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } .dash-card-recent { grid-column: 1; } }

/* ── Recently used rows ──────────────────────────────────────── */
.dash-recent-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: background .18s;
}
.dash-recent-row:hover { background: var(--brand-light); }
.dash-recent-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #4f46e5; display: flex; align-items: center;
  justify-content: center; font-size: .82rem; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(79,70,229,.15);
}
html[data-theme="dark"] .dash-recent-icon { background: rgba(99,102,241,.18); color: #818cf8; }
.dash-recent-body { flex: 1; min-width: 0; }
.dash-recent-name { font-size: .85rem; font-weight: 700; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-recent-meta { font-size: .71rem; color: var(--txt-3); margin-top: 1px; }
.dash-recent-badge { font-size: .68rem; background: var(--brand-light); color: var(--brand); border-radius: 20px; padding: 2px 9px; font-weight: 700; white-space: nowrap; }
.dash-recent-arrow { color: var(--txt-3); font-size: .65rem; flex-shrink: 0; transition: transform .18s; }
.dash-recent-row:hover .dash-recent-arrow { transform: translateX(3px); color: var(--brand); }

/* ── Quick action buttons ────────────────────────────────────── */
.dash-quick-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  text-decoration: none; color: inherit;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .18s, background .18s, transform .15s, box-shadow .18s;
  margin-bottom: 8px;
}
.dash-quick-btn:hover { border-color: var(--brand); background: var(--brand-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.1); }
.dash-quick-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .92rem; flex-shrink: 0;
}
.dash-quick-label { font-size: .84rem; font-weight: 700; color: var(--txt); }
.dash-quick-sub { font-size: .71rem; color: var(--txt-3); margin-top: 1px; }

/* ── My Tools card grid ──────────────────────────────────────── */
.dash-tool-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 14px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none; color: inherit;
  background: var(--surface);
  transition: border-color .18s, box-shadow .18s, transform .15s;
  position: relative; overflow: hidden;
}
.dash-tool-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 4%, transparent), transparent 60%);
  opacity: 0; transition: opacity .2s;
}
.dash-tool-card:hover { border-color: var(--brand); box-shadow: 0 4px 16px rgba(37,99,235,.12); transform: translateY(-2px); }
.dash-tool-card:hover::after { opacity: 1; }
.dash-tool-card-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .88rem; flex-shrink: 0;
  transition: transform .2s;
}
.dash-tool-card:hover .dash-tool-card-icon { transform: scale(1.08); }
.dash-tool-card-name { font-size: .82rem; font-weight: 700; color: var(--txt); line-height: 1.3; }
.dash-tool-card-cat  { font-size: .68rem; color: var(--txt-3); font-weight: 500; }

/* Responsive banner */
@media (max-width: 640px) {
  .dash-banner { flex-direction: column; padding: 20px; gap: 16px; }
  .dash-banner-right { width: 100%; justify-content: space-between; gap: 8px; }
  .dash-stat-pill { flex: 1; min-width: 0; padding: 10px 8px; }
  .dash-stat-pill-val { font-size: 1.1rem; }
  .dash-stat-pill-lbl { font-size: .6rem; }
  .dash-hero-title { font-size: 1.4rem; }
}
@media (max-width: 380px) {
  .dash-banner-right { gap: 6px; }
  .dash-stat-pill { padding: 8px 6px; }
  .dash-stat-pill-val { font-size: 1rem; }
  .dash-stat-pill-ico { display: none; }
}
@media (max-width: 640px) {
  .dash-tool-card-icon { width: 30px; height: 30px; }
}


/* ================================================================
   PUBLIC SEARCH  (home page + search results for non-auth)
   ================================================================ */

.public-search-form {
  margin-top: 28px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.public-search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  padding: 10px 16px;
  box-shadow: var(--sh2);
  transition: border-color var(--t), box-shadow var(--t);
}
.public-search-inner:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12), var(--sh2);
}
.public-search-inner > i {
  color: var(--txt-3);
  font-size: 1rem;
  flex-shrink: 0;
}
.public-search-inner input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: .97rem;
  color: var(--txt);
  font-family: inherit;
  outline: none;
}
.public-search-inner input::placeholder { color: var(--txt-3); }

.public-search-hint {
  text-align: center;
  font-size: .76rem;
  color: var(--txt-3);
  margin-top: 10px;
}
.public-search-hint a { color: var(--brand); font-weight: 700; }

/* Public search results page wrapper */
.public-search-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.pub-search-header {
  margin-bottom: 20px;
}
.pub-search-header h1 { font-size: 1.4rem; font-weight: 800; color: var(--txt); }
.pub-search-header .page-subtitle { font-size: .82rem; color: var(--txt-2); margin-top: 3px; }


/* ================================================================
   SEARCH RESULT ROWS
   ================================================================ */

.search-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-2);
}
.search-row:last-child { border-bottom: none; }

.search-row-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: .82rem;
  flex-shrink: 0;
}

.search-row-body { flex: 1; min-width: 0; }

.search-row-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-row-sub {
  font-size: .78rem;
  color: var(--txt-2);
  line-height: 1.5;
  margin-top: 2px;
}

.search-row-url {
  display: block;
  font-size: .74rem;
  color: var(--brand);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-row-url:hover { color: var(--brand-dark); }

.search-row-meta {
  font-size: .72rem;
  color: var(--txt-3);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-row-actions { flex-shrink: 0; }
.search-row-actions .btn { white-space: nowrap; }


/* ================================================================
   PUBLIC HOME  —  Query Solver Theme
   ================================================================ */

/* Nav */
.qh-nav {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 60px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  gap: 20px;
}
.qh-nav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--txt);
  font-size: .97rem; letter-spacing: -.01em; flex-shrink: 0;
}
.qh-nav-brand strong { font-weight: 900; }
.qh-nav-brand span { font-weight: 400; }
.qh-nav-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  display: grid; place-items: center;
  font-weight: 900; font-size: .9rem; color: #fff; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}
.qh-nav-links {
  display: flex; align-items: center; gap: 24px;
  flex: 1; justify-content: center;
}
.qh-nav-links a {
  font-size: .84rem; font-weight: 600; color: var(--txt-2);
  text-decoration: none; transition: color var(--t);
}
.qh-nav-links a:hover { color: var(--brand); }
.qh-nav-links a.qh-nav-active { color: var(--brand); }
.qh-nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Hero */
.qh-hero {
  position: relative; padding: 72px 40px 60px;
  overflow: hidden;
  background: linear-gradient(160deg, #faf5ff 0%, #f0f4ff 50%, #f8fafc 100%);
  text-align: center;
}
.qh-hero-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(37,99,235,.10) 0%, transparent 70%),
    radial-gradient(ellipse 600px 500px at 0% 50%, rgba(37,99,235,.06) 0%, transparent 70%),
    radial-gradient(ellipse 600px 500px at 100% 60%, rgba(37,99,235,.06) 0%, transparent 70%);
}
.qh-hero-content { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; }

/* Database/search themed line-art illustrations filling the empty hero margins */
.qh-hero-art {
  position: absolute; top: 50%; z-index: 0; pointer-events: none;
  width: 320px; height: 460px; opacity: .18;
  animation: qh-art-drift 7s ease-in-out infinite;
}
.qh-hero-art-left  { left: -3%;  transform: translateY(-50%); }
.qh-hero-art-right { right: -3%; transform: translateY(-50%) scaleX(-1); animation-delay: 1.4s; }
@keyframes qh-art-drift {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%      { transform: translateY(-54%) translateX(4px); }
}
.qh-hero-art-right { animation-name: qh-art-drift-r; }
@keyframes qh-art-drift-r {
  0%, 100% { transform: translateY(-50%) scaleX(-1) translateX(0); }
  50%      { transform: translateY(-54%) scaleX(-1) translateX(4px); }
}
@media (max-width: 1300px) {
  .qh-hero-art { display: none; }
}

/* "Searching" motion cues inside the illustrations */
.qh-scanline {
  transform-origin: center;
  animation: qh-scan 2.6s ease-in-out infinite;
}
@keyframes qh-scan {
  0%   { transform: translateY(-3px); opacity: 0; }
  15%  { opacity: .8; }
  50%  { transform: translateY(30px); opacity: .8; }
  85%  { opacity: 0; }
  100% { transform: translateY(33px); opacity: 0; }
}
.qh-ping {
  transform-origin: 150px 190px;
  animation: qh-ping-pulse 2.2s ease-out infinite;
}
@keyframes qh-ping-pulse {
  0%   { transform: scale(1);   opacity: .7; }
  100% { transform: scale(1.9); opacity: 0; }
}
.qh-blinkdot {
  animation: qh-blink 2.2s ease-in-out infinite;
}
@keyframes qh-blink {
  0%, 100% { opacity: .3; r: 4; }
  50%      { opacity: 1;  r: 6; }
}
.qh-flowline {
  stroke-dasharray: 4 5;
  animation: qh-flow 1.4s linear infinite;
}
@keyframes qh-flow {
  to { stroke-dashoffset: -18; }
}

.qh-hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-light); color: var(--brand);
  border: 1px solid var(--brand-mid); border-radius: 20px;
  padding: 6px 16px; font-size: .76rem; font-weight: 700;
  letter-spacing: .03em; margin-bottom: 22px;
}
.qh-pill-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand);
  animation: qh-pulse 2s ease-in-out infinite;
}
@keyframes qh-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.7); }
}
.qh-hero-title {
  font-size: 3.2rem; font-weight: 900; color: var(--txt);
  line-height: 1.12; letter-spacing: -.04em; margin-bottom: 18px;
}
.qh-hero-title span { color: var(--brand); }
.qh-hero-sub {
  font-size: 1.05rem; color: var(--txt-2);
  max-width: 600px; margin: 0 auto 32px; line-height: 1.75;
}

/* Hero Search */
.qh-search-form { margin-bottom: 28px; }
.qh-search-box {
  display: flex; align-items: center;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-xl);
  padding: 12px 10px 12px 22px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.05);
  max-width: 640px; margin: 0 auto 10px;
  transition: border-color var(--t), box-shadow var(--t); gap: 10px;
}
.qh-search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(37,99,235,.1), 0 4px 20px rgba(0,0,0,.08);
}
.qh-search-icon { color: var(--txt-3); font-size: 1.1rem; flex-shrink: 0; }
.qh-search-box input {
  flex: 1; border: none; background: transparent;
  font-size: 1.05rem; color: var(--txt); font-family: inherit; outline: none;
}
.qh-search-box input::placeholder { color: var(--txt-3); }
.qh-search-box button {
  background: var(--brand); color: #fff; border: none; border-radius: var(--r-lg);
  padding: 12px 24px; font-size: .92rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; font-family: inherit;
  display: flex; align-items: center; gap: 6px;
  transition: background var(--t), transform var(--t); flex-shrink: 0;
}
.qh-search-box button:hover { background: var(--brand-dark); transform: scale(1.02); }
.qh-search-sub {
  font-size: .74rem; color: var(--txt-3); text-align: center; margin: 0;
}
.qh-search-sub a { color: var(--brand); font-weight: 700; }
.qh-hero-cta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* Hero stat chips */
.qh-hero-stats {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 48px;
}
.qh-stat-chip {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 12px 18px; box-shadow: var(--sh1);
}
.qh-stat-chip-icon {
  width: 38px; height: 38px; border-radius: 9px;
  display: grid; place-items: center; font-size: .9rem; color: #fff; flex-shrink: 0;
}
.qh-stat-chip-icon.purple { background: linear-gradient(135deg,#2563eb,#1d4ed8); }
.qh-stat-chip-icon.blue   { background: linear-gradient(135deg,#3b82f6,#2563eb); }
.qh-stat-chip-icon.green  { background: linear-gradient(135deg,#10b981,#059669); }
.qh-stat-num { font-size: 1.1rem; font-weight: 900; color: var(--txt); line-height: 1; }
.qh-stat-lbl { font-size: .71rem; color: var(--txt-3); font-weight: 600; margin-top: 2px; }

/* Sections */
.qh-section { padding: 72px 40px; text-align: center; max-width: 1100px; margin: 0 auto; }
.qh-section-alt { background: var(--page-bg); padding: 72px 40px; }
.qh-section-alt > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.qh-section-label {
  display: inline-block; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em; color: var(--brand); margin-bottom: 12px;
}
.qh-section-title {
  font-size: 2rem; font-weight: 900; color: var(--txt);
  letter-spacing: -.03em; line-height: 1.2; margin-bottom: 44px;
}

/* Feature cards */
.qh-features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px; text-align: left;
}
.qh-feature-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 24px 22px; box-shadow: var(--sh1);
  transition: box-shadow var(--t), transform var(--t);
}
.qh-feature-card:hover { box-shadow: var(--sh3); transform: translateY(-3px); }
.qh-feature-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1rem; color: #fff; margin-bottom: 16px;
}
.qh-feature-card h3 { font-size: .92rem; font-weight: 800; color: var(--txt); margin-bottom: 8px; }
.qh-feature-card p  { font-size: .81rem; color: var(--txt-2); line-height: 1.65; margin: 0; }

/* Steps */
.qh-steps {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 6px; flex-wrap: wrap; text-align: center;
}
.qh-step { flex: 1; min-width: 160px; max-width: 220px; padding: 20px 16px; }
.qh-step-num {
  font-size: 2.2rem; font-weight: 900; color: var(--brand-mid); line-height: 1; margin-bottom: 10px;
}
.qh-step-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  display: grid; place-items: center; font-size: 1.1rem; color: #fff;
  margin: 0 auto 14px; box-shadow: 0 4px 14px rgba(37,99,235,.3);
}
.qh-step h4 { font-size: .9rem; font-weight: 800; color: var(--txt); margin-bottom: 6px; }
.qh-step p  { font-size: .79rem; color: var(--txt-2); line-height: 1.6; margin: 0; }
.qh-step-arrow { color: var(--brand-mid); font-size: 1.1rem; align-self: center; padding: 0 4px; flex-shrink: 0; }

/* CTA Banner */
.qh-cta-banner {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 60%, #2563eb 100%);
  padding: 72px 40px; text-align: center; position: relative; overflow: hidden;
}
.qh-cta-banner::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 600px 300px at 70% 50%, rgba(255,255,255,.07) 0%, transparent 70%);
  pointer-events: none;
}
.qh-cta-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.qh-cta-banner h2 { font-size: 2rem; font-weight: 900; color: #fff; letter-spacing: -.03em; margin-bottom: 12px; }
.qh-cta-banner p  { font-size: .92rem; color: rgba(255,255,255,.8); margin-bottom: 28px; }
.qh-cta-btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* Footer */
.qh-footer {
  padding: 32px 40px; text-align: center; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.qh-footer-brand { display: flex; align-items: center; gap: 8px; }

/* Responsive */
@media (max-width: 760px) {
  .qh-nav { padding: 0 18px; }
  .qh-nav-links { display: none; }
  .qh-hero { padding: 48px 20px 40px; }
  .qh-hero-title { font-size: 2.1rem; }
  .qh-section { padding: 48px 20px; }
  .qh-section-alt { padding: 48px 20px; }
  .qh-cta-banner { padding: 48px 20px; }
  .qh-cta-banner h2 { font-size: 1.5rem; }
  .qh-steps { flex-direction: column; align-items: center; }
  .qh-step-arrow { transform: rotate(90deg); }
  .qh-hero-stats { gap: 10px; }
}

/* ── Toast Notifications (center pop) ──────────────────────────────────────── */
.toast-msg {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: 14px; min-width: 300px; max-width: 420px;
  background: var(--surface); box-shadow: 0 6px 28px rgba(0,0,0,0.15);
  border-left: 4px solid var(--brand);
  font-size: 0.875rem; font-weight: 500; color: var(--txt);
  animation: toastIn 0.4s cubic-bezier(.22,1,.36,1);
}
@keyframes toastIn {
  from { opacity:0; transform: scale(0.7); }
  to   { opacity:1; transform: scale(1); }
}
.toast-success { border-left-color: #059669; }
.toast-error   { border-left-color: #dc2626; }
.toast-warning { border-left-color: #d97706; }
.toast-info    { border-left-color: #2563eb; }
.toast-icon { font-size: 1.05rem; flex-shrink: 0; }
.toast-success .toast-icon { color: #059669; }
.toast-error   .toast-icon { color: #dc2626; }
.toast-warning .toast-icon { color: #d97706; }
.toast-info    .toast-icon { color: #2563eb; }
.toast-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--txt-3); font-size: 1.1rem; line-height: 1; padding: 0 2px;
}
.toast-close:hover { color: var(--txt); }

/* Tool toast — bottom-right, non-blocking notifications for the converted
   tools (replaces native alert()/confirm() popups). See window.showToast(). */
#toolToastContainer {
  /* bottom: 110px, not 24px — the chatbot widget (#cbWidget) sits at
     bottom:24px;right:24px in this exact same corner, so anything lower
     than this gets hidden behind its floating bubble/hint. */
  position: fixed; bottom: 110px; right: 24px; z-index: 99997;
  display: flex; flex-direction: column; gap: 10px; max-width: 360px;
}
.tool-toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--brand); border-radius: 10px;
  padding: 12px 14px; box-shadow: var(--sh3);
  font-size: .85rem; color: var(--txt); line-height: 1.5;
  animation: toolToastIn .25s ease;
}
.tool-toast i { flex-shrink: 0; margin-top: 1px; color: var(--brand); }
.tool-toast span { flex: 1; white-space: pre-line; }
.tool-toast-close {
  background: none; border: none; color: var(--txt-3); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0; flex-shrink: 0;
}
.tool-toast-close:hover { color: var(--txt); }
.tool-toast-success { border-left-color: var(--green); }
.tool-toast-success i { color: var(--green); }
.tool-toast-error   { border-left-color: var(--red); }
.tool-toast-error i  { color: var(--red); }
.tool-toast-warning  { border-left-color: var(--amber); }
.tool-toast-warning i { color: var(--amber); }
@keyframes toolToastIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Custom confirm()/prompt() replacements — window.dlConfirm /
   window.dlPrompt. Centered, on-brand dialogs instead of native browser
   popups, usable from any tool. ── */
.dl-dialog-overlay {
  position: fixed; inset: 0; z-index: 100003;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(15,23,42,0); pointer-events: none;
  opacity: 0; transition: opacity .15s ease, background .15s ease;
}
.dl-dialog-overlay.dl-dialog-open {
  background: rgba(15,23,42,.6); pointer-events: auto; opacity: 1;
}
.dl-dialog-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 26px 28px; max-width: 380px; width: 100%;
  text-align: center; box-shadow: 0 30px 60px rgba(0,0,0,.3);
  transform: scale(.92) translateY(10px); transition: transform .15s ease;
}
.dl-dialog-overlay.dl-dialog-open .dl-dialog-box { transform: scale(1) translateY(0); }
.dl-dialog-title i { font-size: 2rem; color: var(--brand); margin-bottom: 8px; display: block; }
.dl-dialog-msg { font-size: .92rem; color: var(--txt); line-height: 1.5; margin: 4px 0 16px; white-space: pre-line; }
.dl-dialog-input {
  width: 100%; margin-bottom: 16px; text-align: center;
}
.dl-dialog-actions { display: flex; gap: 10px; justify-content: center; }
@media (prefers-reduced-motion: reduce) {
  .dl-dialog-overlay, .dl-dialog-box { transition: none; }
}

/* ── Profile Dropdown ───────────────────────────────────────────────────────── */
.profile-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13); min-width: 230px; z-index: 500;
  padding: 6px 0; animation: pdIn 0.18s ease;
}
@keyframes pdIn {
  from { opacity:0; transform: translateY(-6px); }
  to   { opacity:1; transform: translateY(0); }
}
.pd-header { display: flex; gap: 10px; align-items: center; padding: 14px 16px 10px; }
.pd-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.pd-name { font-weight: 700; font-size: 0.9rem; color: var(--txt); }
.pd-email { font-size: 0.75rem; color: var(--txt-3); margin-top: 1px; }
.pd-badge { display:inline-block; margin-top:4px; font-size:0.68rem; font-weight:700; padding:2px 8px; border-radius:99px; background:var(--brand-light); color:var(--brand); }
.pd-divider { height: 1px; background: var(--border); margin: 4px 0; }
.pd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; font-size: 0.855rem; color: var(--txt); text-decoration: none;
  transition: background 0.15s; cursor: pointer;
}
.pd-item:hover { background: var(--bg); }
.pd-item i { width: 16px; color: var(--txt-2); font-size: 0.85rem; }
.pd-logout { color: #dc2626; }
.pd-logout i { color: #dc2626; }

/* ── Floating QueryHub tab: collapsed to just its logo, slides in on hover ── */
.dl-queryhub-tab {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%) translateX(-26px);
  z-index: 99997;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border-radius: 0 12px 12px 0;
  box-shadow: 2px 0 10px rgba(79,70,229,.35);
  transition: transform .25s ease, box-shadow .25s ease;
  overflow: hidden;
}
.dl-queryhub-tab-mark {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: #4f46e5;
  border-radius: 7px;
  font-weight: 800; font-size: .95rem; font-family: inherit;
}
.dl-queryhub-tab:hover { transform: translateY(-50%) translateX(0); box-shadow: 3px 0 16px rgba(79,70,229,.5); }
@media (max-width: 640px) { .dl-queryhub-tab { display: none; } }

/* ── Accent theme picker popup ───────────────────────────────────── */
.theme-picker-popup {
  position: fixed; z-index: 9999; min-width: 190px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.16); padding: 8px;
  animation: pdIn 0.18s ease;
}
.theme-picker-title {
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--txt-3); padding: 4px 10px 8px;
}
.theme-picker-option {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; text-align: left; cursor: pointer;
  padding: 8px 10px; border-radius: 9px; font-size: .85rem; font-family: inherit;
  color: var(--txt); transition: background .15s;
}
.theme-picker-option:hover { background: var(--bg); }
.theme-picker-option.theme-picker-active { background: var(--brand-light); color: var(--brand); font-weight: 700; }
.theme-picker-swatch { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,.08); }
.theme-swatch-none { background: linear-gradient(135deg,#fff 50%,#0f172a 50%); }
.theme-swatch-neon { background: linear-gradient(135deg,#39FF14,#0B0B0F); }
.theme-swatch-violet { background: linear-gradient(135deg,#a78bfa,#6d5ef0); }
.theme-swatch-cyber { background: linear-gradient(135deg,#3b9eff,#06070a); }
.theme-swatch-sunshine { background: linear-gradient(135deg,#fde68a,#a8e063); }
.theme-swatch-aurora { background: linear-gradient(135deg,#b9a6ff,#1a1033); }

/* ── Accent theme: Violet — day (dashboard) ─────────────────────────── */
html.theme-violet:not([data-theme="dark"]) {
  --brand: #6d5ef0; --brand-dark: #5b4dd6; --brand-light: #ede9ff; --brand-mid: #c4b5fd;
  --page-bg: #f5f3ff; --surface: #ffffff; --border: #e0d9ff; --border-2: #ede9ff;
  --txt: #1e1b3a; --txt-2: #4c4470; --txt-3: #8b80b3;
  --sb-bg: #ffffff; --sb-border: #e0d9ff; --sb-accent: #6d5ef0;
  --sb-hover: rgba(109,94,240,.08); --sb-active: rgba(109,94,240,.14);
  --sb-tint: #ede9ff; --sb-tint-mid: #c4b5fd; --sb-tint-dark: #5b4dd6;
}
/* ── Accent theme: Violet — night (dashboard) ───────────────────────── */
html.theme-violet[data-theme="dark"] {
  --brand: #a78bfa; --brand-dark: #8b6df0; --brand-light: #281d45; --brand-mid: #4a3a78;
  --page-bg: #170f2e; --surface: #1f1637; --border: #34285c; --border-2: #221937;
  --txt: #ece6ff; --txt-2: #b7a9e0; --txt-3: #7a6da3;
  --sb-bg: #1f1637; --sb-border: #34285c; --sb-accent: #a78bfa;
  --sb-hover: rgba(167,139,250,.1); --sb-active: rgba(167,139,250,.18);
  --sb-txt: #b7a9e0; --sb-txt-h: #ece6ff;
  --sb-tint: #281d45; --sb-tint-mid: #4a3a78; --sb-tint-dark: #a78bfa;
}

/* ── Accent theme: Cyber — day (dashboard) ──────────────────────────── */
html.theme-cyber:not([data-theme="dark"]) {
  --brand: #2563eb; --brand-dark: #1d4ed8; --brand-light: #e3f0ff; --brand-mid: #93c5fd;
  --page-bg: #f0f7ff; --surface: #ffffff; --border: #cfe3ff; --border-2: #e3f0ff;
  --txt: #0a1a2e; --txt-2: #38536e; --txt-3: #7d96ab;
  --sb-bg: #ffffff; --sb-border: #cfe3ff; --sb-accent: #2563eb;
  --sb-hover: rgba(37,99,235,.08); --sb-active: rgba(37,99,235,.14);
  --sb-tint: #e3f0ff; --sb-tint-mid: #93c5fd; --sb-tint-dark: #1d4ed8;
}
/* ── Accent theme: Cyber — night (dashboard) ────────────────────────── */
html.theme-cyber[data-theme="dark"] {
  --brand: #3b9eff; --brand-dark: #2580df; --brand-light: #0d1b2e; --brand-mid: #143a5c;
  --page-bg: #06070a; --surface: #0d1117; --border: #1c2533; --border-2: #131a24;
  --txt: #e8f1ff; --txt-2: #9fb3cc; --txt-3: #5c7290;
  --sb-bg: #0d1117; --sb-border: #1c2533; --sb-accent: #3b9eff;
  --sb-hover: rgba(59,158,255,.08); --sb-active: rgba(59,158,255,.16);
  --sb-txt: #9fb3cc; --sb-txt-h: #e8f1ff;
  --sb-tint: #0d1b2e; --sb-tint-mid: #143a5c; --sb-tint-dark: #3b9eff;
}

/* ── Accent theme: Sunshine — day (dashboard) ───────────────────────── */
html.theme-sunshine:not([data-theme="dark"]) {
  --brand: #d4a017; --brand-dark: #b3850f; --brand-light: #fff8e0; --brand-mid: #f5d742;
  --page-bg: #fffdf5; --surface: #ffffff; --border: #f0e6c4; --border-2: #fbf6e3;
  --txt: #1c1a10; --txt-2: #5c5640; --txt-3: #a39b78;
  --sb-bg: #ffffff; --sb-border: #f0e6c4; --sb-accent: #d4a017;
  --sb-hover: rgba(212,160,23,.08); --sb-active: rgba(212,160,23,.14);
  --sb-tint: #fff8e0; --sb-tint-mid: #f5d742; --sb-tint-dark: #b3850f;
}
/* ── Accent theme: Sunshine — night (dashboard) ─────────────────────── */
html.theme-sunshine[data-theme="dark"] {
  --brand: #fbbf24; --brand-dark: #f59e0b; --brand-light: #2e2516; --brand-mid: #5c4a23;
  --page-bg: #1a1610; --surface: #241d12; --border: #4a3c1f; --border-2: #2e2516;
  --txt: #f5ecd8; --txt-2: #c9b896; --txt-3: #8a7a5c;
  --sb-bg: #241d12; --sb-border: #4a3c1f; --sb-accent: #fbbf24;
  --sb-hover: rgba(251,191,36,.1); --sb-active: rgba(251,191,36,.18);
  --sb-txt: #c9b896; --sb-txt-h: #f5ecd8;
  --sb-tint: #2e2516; --sb-tint-mid: #5c4a23; --sb-tint-dark: #fbbf24;
}

/* ── Accent theme: Aurora — day (dashboard) ─────────────────────────── */
html.theme-aurora:not([data-theme="dark"]) {
  --brand: #8b5cf6; --brand-dark: #7c3aed; --brand-light: #f6ebff; --brand-mid: #d8b4fe;
  --page-bg: #faf5ff; --surface: #ffffff; --border: #ecd9ff; --border-2: #f6ebff;
  --txt: #2e1a47; --txt-2: #5e4577; --txt-3: #9a82b3;
  --sb-bg: #ffffff; --sb-border: #ecd9ff; --sb-accent: #8b5cf6;
  --sb-hover: rgba(139,92,246,.08); --sb-active: rgba(139,92,246,.14);
  --sb-tint: #f6ebff; --sb-tint-mid: #d8b4fe; --sb-tint-dark: #7c3aed;
}
/* ── Accent theme: Aurora — night (dashboard) ───────────────────────── */
html.theme-aurora[data-theme="dark"] {
  --brand: #b9a6ff; --brand-dark: #9d84ff; --brand-light: #1f1840; --brand-mid: #34285c;
  --page-bg: #0d0a1a; --surface: #161029; --border: #2c2350; --border-2: #1d1638;
  --txt: #f1ecff; --txt-2: #b7a9e8; --txt-3: #6f63a0;
  --sb-bg: #161029; --sb-border: #2c2350; --sb-accent: #b9a6ff;
  --sb-hover: rgba(185,166,255,.08); --sb-active: rgba(185,166,255,.16);
  --sb-txt: #b7a9e8; --sb-txt-h: #f1ecff;
  --sb-tint: #1f1840; --sb-tint-mid: #34285c; --sb-tint-dark: #b9a6ff;
}
html.theme-violet body, html.theme-cyber body, html.theme-sunshine body, html.theme-aurora body {
  background: var(--page-bg); color: var(--txt);
}
html.theme-violet input, html.theme-violet textarea, html.theme-violet select,
html.theme-cyber input, html.theme-cyber textarea, html.theme-cyber select,
html.theme-sunshine input, html.theme-sunshine textarea, html.theme-sunshine select,
html.theme-aurora input, html.theme-aurora textarea, html.theme-aurora select {
  background: var(--surface); color: var(--txt); border-color: var(--border);
}

/* ── Quill Editor Height Fix ────────────────────────────────────────────────── */
.ql-container { border-bottom-left-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.ql-toolbar { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.ql-editor { min-height: 120px; max-height: 320px; overflow-y: auto; font-size: 0.9rem; }

/* ── Quill Height Hard Fix ──────────────────────────────────────────────────── */
.ql-editor { min-height: 120px !important; max-height: 260px !important; overflow-y: auto !important; }
.ql-container.ql-snow { max-height: 280px !important; overflow: hidden !important; }

/* ── Sidebar Footer Dropdown (pops UP) ─────────────────────────────────────── */
.sf-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 12px; right: 12px;
  background: var(--sb-bg);
  border: 1px solid var(--sb-border);
  border-radius: 14px;
  box-shadow: 0 -8px 32px rgba(0,0,0,.18);
  padding: 6px 0;
  z-index: 600;
  animation: sfddIn .2s cubic-bezier(.22,1,.36,1);
}
@keyframes sfddIn {
  from { opacity:0; transform: translateY(10px); }
  to   { opacity:1; transform: translateY(0); }
}
.sf-dd-header {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px 10px;
}
.sf-dd-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg,#2563eb,#1d4ed8);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: .85rem; flex-shrink: 0;
}
.sf-dd-name  { font-size: .82rem; font-weight: 700; color: var(--sb-txt-h); }
.sf-dd-email { font-size: .7rem; color: var(--sb-txt); margin-top: 1px; }
.sf-dd-badge {
  display: inline-block; margin-top: 3px;
  font-size: .62rem; font-weight: 700;
  padding: 1px 7px; border-radius: 99px;
  background: var(--sb-tint); color: var(--brand);
}
.sf-dd-divider { height: 1px; background: var(--sb-border); margin: 4px 0; }
.sf-dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; font-size: .82rem;
  color: var(--sb-txt); text-decoration: none;
  transition: background .15s;
}
.sf-dd-item:hover { background: var(--sb-inset); color: var(--sb-txt-h); }
.sf-dd-item i { width: 14px; font-size: .78rem; color: #94a3b8; }
.sf-dd-item:hover i { color: var(--brand); }
.sf-dd-logout { color: #dc2626; }
.sf-dd-logout i { color: #dc2626; }
.sf-dd-logout:hover { background: var(--sb-red-tint); color: #dc2626; }
