/* ============================================================
   Behzat AI Hub — Admin Dashboard (dashboard/assets/app.css)
   EXACT aisensile.com language (design-tokens-aisensile.md §1–§3)
   bg #000 · grain feTurbulence · cyan #22d3ee · Geist fallback stack
   cards rounded-2xl border white/10 bg #111827 · hover border+glow
   All app.js class/id contracts preserved — styling only.
   ============================================================ */

:root {
  /* ── Color palette (aisensile exact) ───────────────────── */
  --bg:            #000000;                 /* pure black canvas */
  --surface:       #111827;                 /* card / panel fill */
  --surface-2:     #0b1020;                 /* darker panel (code, drawer, modal) */
  --cyan:          #22d3ee;                 /* cyan-400 accent */
  --cyan-dim:      rgba(34, 211, 238, 0.15);/* translucent cyan wash / tint */
  --cyan-ring:     rgba(34, 211, 238, 0.25);/* focus ring */
  --violet:        #8b5cf6;                 /* secondary accent */
  --violet-dim:    rgba(139, 92, 246, 0.15);
  --amber:         #f59e0b;                 /* warnings / alt */
  --green:         #22c55e;                 /* LIVE status / success */
  --danger:        #f87171;                 /* form error text */
  --ok:            #22c55e;

  --ink:           #ffffff;                 /* primary text (full white) */
  --ink-87:        rgba(255, 255, 255, 0.87);/* H1/H2 headings */
  --ink-70:        rgba(255, 255, 255, 0.70);/* nav links, strong body */
  --ink-50:        rgba(255, 255, 255, 0.50);/* labels, secondary text */
  --ink-40:        rgba(255, 255, 255, 0.40);/* meta text */
  --ink-30:        rgba(255, 255, 255, 0.30);/* placeholders */
  --border:        rgba(255, 255, 255, 0.10);/* card border (white/10) */
  --border-strong: rgba(255, 255, 255, 0.20);/* card hover border (white/20) */
  --border-faint:  rgba(255, 255, 255, 0.08);/* subtle separators */

  --gradient-text: linear-gradient(100deg, #22d3ee, #8b5cf6);

  /* ── Fonts (Geist fallback stack — NO external CDN) ───── */
  --font-sans: "Geist Variable", "Geist", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono Variable", "Geist Mono", ui-monospace, "SF Mono",
               SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* ── Radii ─────────────────────────────────────────────── */
  --radius-lg:   16px;   /* rounded-2xl — cards, buttons, form fields */
  --radius-md:   12px;   /* secondary panels, pills */
  --radius-full: 999px;  /* pills / badges / live dots */

  /* ── Shadows / glow (aisensile exact) ──────────────────── */
  --glow:          0 0 30px rgba(34, 211, 238, 0.30);  /* cyan glow (primary hover) */
  --glow-soft:     0 0 18px rgba(34, 211, 238, 0.18);  /* featured card */
  --card-shadow:   0 8px 24px rgba(0, 0, 0, 0.45);     /* resting card */
  --card-shadow-hover: 0 18px 44px rgba(0, 0, 0, 0.60);/* card hover */
  --focus-ring:    0 0 0 1px var(--cyan-ring), 0 0 0 4px rgba(34,211,238,0.10);

  /* ── Motion ────────────────────────────────────────────── */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast:   200ms;
  --reveal-dur: 0.7s;
  --reveal-stagger: 0.1s;

  /* ── Layout ────────────────────────────────────────────── */
  --sidebar-w: 252px;
  --topbar-h: 68px;
  --z-drawer: 1100;
  --z-backdrop: 1050;
  --z-grain: 9999;
}

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

html, body {
  overflow-x: clip;               /* clip (NOT hidden) — kills blob bleed */
  background: var(--bg);
  color: var(--ink-87);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* Subtle cyan/violet radial washes over pure black base */
body {
  background:
    radial-gradient(900px 520px at 12% -5%, rgba(34, 211, 238, 0.06), transparent 60%),
    radial-gradient(900px 520px at 88% 108%, rgba(139, 92, 246, 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* ── Grain overlay (exact feTurbulence, static — not motion) ── */
.grain::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);        /* 9999 */
  pointer-events: none;
  opacity: 0.025;
  background-repeat: repeat;
  background-size: 180px;         /* tile size */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 { color: var(--ink); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, select, textarea { font: inherit; color: var(--ink); }
::selection { background: var(--cyan); color: #000; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* Custom scrollbar (cyan gradient, 6px) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan), rgba(34,211,238,0.25));
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }
* { scrollbar-width: thin; scrollbar-color: var(--cyan) #000; }

.mono { font-family: var(--font-mono); }
.tabular { font-variant-numeric: tabular-nums; }
.grad {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[hidden] { display: none !important; }

/* Card surface helper (aisensile card language) */
.glass {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);          /* white/10 */
  background: var(--surface);               /* #111827 */
  box-shadow: var(--card-shadow);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease,
              transform var(--t-fast) var(--ease-out);
}
.glass:hover {
  border-color: var(--border-strong);       /* white/20 */
  box-shadow: var(--card-shadow-hover), var(--glow-soft);
}

/* ================= LOGIN (centered card) ================= */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(700px 420px at 15% 0%, rgba(34, 211, 238, 0.08), transparent 60%),
    radial-gradient(700px 420px at 85% 100%, rgba(139, 92, 246, 0.08), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 38px 34px 32px;
  border-radius: var(--radius-lg);          /* rounded-2xl */
  background: var(--surface);               /* #111827 */
  border: 1px solid var(--border);          /* white/10 */
  box-shadow: var(--card-shadow);
  animation: rise 0.6s cubic-bezier(.16,1,.3,1);
}
.login-card:hover { border-color: var(--border-strong); box-shadow: var(--card-shadow-hover), var(--glow-soft); }
.login-card.shake { animation: shake 0.4s ease; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--gradient-text);
  display: grid; place-items: center;
  font-weight: 700; font-size: 22px; color: #000;
  flex: none;
  box-shadow: var(--glow-soft);
}
.brand-text h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.brand-text p { font-size: 12px; color: var(--ink-50); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 2px; }
.login-card .brand-name { font-weight: 700; }

/* ── Forms (white/5 bg, cyan focus, ≥16px inputs) ───────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field .label, .label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-50); }
.field input, .field select, .field textarea,
.editor-form .field input, .editor-form .field textarea,
.filter-field input, .filter-field select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);   /* white/5 */
  border: 1px solid var(--border);          /* white/10 */
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  min-height: 48px;                         /* generous hit area */
  font-size: 16px !important;               /* ← ALWAYS ≥16px (iOS auto-zoom fix) */
  line-height: 1.5;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.field input:focus, .field select:focus, .field textarea:focus,
.editor-form .field input:focus, .editor-form .field textarea:focus,
.filter-field input:focus, .filter-field select:focus {
  border-color: var(--cyan);
  box-shadow: var(--focus-ring);
  background: rgba(255, 255, 255, 0.07);
}
.field input::placeholder, .field textarea::placeholder { color: var(--ink-30); }
.field textarea { resize: vertical; min-height: 120px; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2322d3ee' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}
select option { background: #0b1020; color: var(--ink); }

.login-error { color: var(--danger); font-size: 13px; margin: 4px 0 14px; }
.login-hint { margin-top: 20px; text-align: center; font-size: 12px; color: var(--ink-40); }

/* ================= BUTTONS (cyan glow) ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border-radius: var(--radius-lg);          /* rounded-2xl */
  border: 1px solid transparent;
  font-size: 16px; font-weight: 600;
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--cyan); color: #000; border-color: var(--cyan);
}
.btn-primary:hover { background: #67e8f9; box-shadow: var(--glow); }
.btn-block { width: 100%; }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-70);
  border-color: rgba(255, 255, 255, 0.20);
  padding: 0 16px; font-size: 15px;
}
.btn-ghost:hover { color: var(--cyan); border-color: var(--cyan); background: rgba(34, 211, 238, 0.08); }
.btn-danger { background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(244, 63, 94, 0.4); color: var(--danger); }
.btn-danger:hover { background: rgba(244, 63, 94, 0.22); }
.btn-sm { padding: 0 12px; font-size: 14px; min-height: 40px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn .btn-label { display: inline-flex; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  color: var(--ink-70); transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: rgba(255,255,255,.07); color: var(--ink); }

/* ================= APP LAYOUT ================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--surface-2);             /* #0b1020 — black sidebar */
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 50;
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.sidebar-head {
  display: flex; align-items: center; gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--border-faint);
}
.sidebar-head .brand-mark { width: 38px; height: 38px; font-size: 19px; border-radius: 10px; }
.sidebar-head .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.brand-sub { font-family: var(--font-mono); font-size: 11px; color: var(--ink-50); letter-spacing: 0.12em; text-transform: uppercase; }
.sidebar-close { margin-left: auto; display: none; }

.sidebar-nav { padding: 14px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--ink-70);
  font-weight: 500; font-size: 15px;
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
}
.nav-item svg { flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.nav-item.active { background: var(--cyan-dim); color: var(--cyan); }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 3px; background: var(--cyan);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}
.nav-badge {
  margin-left: auto;
  background: var(--cyan);
  color: #000;
  font-size: 11px; font-weight: 600;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-foot { padding: 16px 20px; border-top: 1px solid var(--border-faint); }
.foot-link { font-family: var(--font-mono); font-size: 12px; color: var(--ink-50); }
.foot-link:hover { color: var(--cyan); }

.sidebar-scrim { display: none; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-faint);
}
.burger { display: none; }
.page-title { font-family: var(--font-mono); font-size: 14px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-87); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--border); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #000;
  background: var(--gradient-text);
}
.user-name { font-family: var(--font-mono); font-size: 13px; color: var(--ink-70); }

.content { padding: 28px; max-width: 1200px; width: 100%; }

/* ================= VIEW HEADER ================= */
.view-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-head h3 { font-size: 22px; font-weight: 700; }
.view-head .view-sub { color: var(--ink-70); font-size: 14px; width: 100%; margin-top: -8px; }
.view-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ================= STAT CARDS (aisensile cards) ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  border-radius: var(--radius-lg);          /* rounded-2xl */
  border: 1px solid var(--border);          /* white/10 */
  background: var(--surface);               /* #111827 */
  box-shadow: var(--card-shadow);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-fast) ease, transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) ease;
  animation: rise 0.5s cubic-bezier(.16,1,.3,1) both;
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-6px); box-shadow: var(--card-shadow-hover), var(--glow-soft); }
.stat-card:nth-child(2) { animation-delay: .05s; }
.stat-card:nth-child(3) { animation-delay: .10s; }
.stat-card:nth-child(4) { animation-delay: .15s; }
.stat-card:nth-child(5) { animation-delay: .20s; }
.stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}
.stat-icon.cyan { color: var(--cyan); }
.stat-icon.violet { color: var(--violet); }
.stat-number { font-family: var(--font-mono); font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-label { font-family: var(--font-mono); color: var(--ink-50); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; }

/* ================= PANELS / CHART ================= */
.panel {
  border-radius: var(--radius-lg);          /* rounded-2xl */
  border: 1px solid var(--border);          /* white/10 */
  background: var(--surface);               /* #111827 */
  box-shadow: var(--card-shadow);
  padding: 22px;
  margin-bottom: 24px;
  animation: rise 0.5s cubic-bezier(.16,1,.3,1) both;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.panel:hover { border-color: var(--border-strong); box-shadow: var(--card-shadow-hover), var(--glow-soft); }
.panel-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 18px; }
.chart-wrap { height: 200px; display: flex; align-items: flex-end; gap: 14px; padding: 0 6px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar {
  width: 100%; max-width: 46px;
  min-height: 4px;
  border-radius: 6px 6px 4px 4px;
  background: linear-gradient(180deg, var(--cyan) 0%, rgba(34, 211, 238, 0.35) 100%);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.35);
  transition: height .6s cubic-bezier(.16,1,.3,1);
  position: relative;
}
.chart-bar:hover { filter: brightness(1.15); }
.chart-val { font-size: 11px; color: var(--ink-70); }
.chart-label { font-size: 11px; color: var(--ink-50); }

/* ================= TABLE (hover + uppercase mono headers) ================= */
.table-card { overflow: hidden; animation: rise 0.5s cubic-bezier(.16,1,.3,1) both; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  font-family: var(--font-mono);
  text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-50);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-weight: 600;
}
tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-faint);
  font-size: 15px;
  vertical-align: middle;
  color: var(--ink-87);
}
tbody tr { cursor: pointer; transition: background var(--t-fast); }
tbody tr:hover { background: rgba(255, 255, 255, 0.05); }
tbody tr:last-child td { border-bottom: none; }
.cell-mono { font-family: var(--font-mono); font-size: 13px; color: var(--ink-70); }
.cell-dim { color: var(--ink-70); }
.cell-sub { font-size: 12px; color: var(--ink-50); margin-top: 2px; }
.name-cell { font-weight: 600; color: var(--ink); }

/* ── Status pills (aisensile) ─────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 3px 10px; border-radius: var(--radius-full); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-new { color: var(--cyan); border: 1px solid rgba(34,211,238,0.35); background: var(--cyan-dim); }
.badge-read { color: var(--ink-70); border: 1px solid var(--border); background: rgba(255,255,255,0.04); }
.badge-replied { color: var(--violet); border: 1px solid rgba(139,92,246,0.4); background: var(--violet-dim); }
.badge-draft { color: var(--ink-70); border: 1px solid var(--border); background: rgba(255,255,255,0.04); }
.badge-published { color: var(--ok); border: 1px solid rgba(34,197,94,0.4); background: rgba(34,197,94,0.12); }
.badge-lane { color: var(--ink-70); border: 1px solid var(--border); background: rgba(255,255,255,0.04); }
.badge-lane::before { display: none; }

.row-actions { display: inline-flex; gap: 6px; }
.row-actions .icon-btn { width: 32px; height: 32px; }
.icon-btn.success { color: var(--cyan); }
.icon-btn.violet { color: var(--violet); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.success:hover, .icon-btn.violet:hover, .icon-btn.danger:hover { background: rgba(255,255,255,.08); }

.table-empty { text-align: center; padding: 60px 20px; color: var(--ink-70); }
.table-empty .empty-emoji { font-size: 34px; margin-bottom: 12px; }
.table-empty p { font-size: 15px; }
.table-empty .sub { font-size: 13px; color: var(--ink-50); margin-top: 6px; }

/* ================= FILTER BAR ================= */
.filters {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 16px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  align-items: flex-end;
}
.filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.filter-field label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-50); }
.filter-field.search { flex: 1; min-width: 200px; }
.filter-field.search input { width: 100%; }
.filters .btn { margin-left: auto; }

/* ================= MODAL ================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fade .2s ease;
}
.modal {
  width: 100%; max-width: 560px;
  border-radius: var(--radius-lg);
  background: var(--surface);               /* #111827 */
  border: 1px solid var(--border);          /* white/10 */
  box-shadow: 0 30px 60px rgba(0,0,0,.5);
  animation: pop .25s cubic-bezier(.16,1,.3,1);
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal.wide { max-width: 760px; }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-faint);
}
.modal-head h3 { font-size: 17px; font-weight: 700; flex: 1; color: var(--ink); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--border-faint);
}
.modal-foot .spacer { flex: 1; }

.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; margin-bottom: 20px; }
.detail-item .k { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-50); margin-bottom: 3px; }
.detail-item .v { font-size: 14px; word-break: break-word; color: var(--ink-87); }
.detail-item.full { grid-column: 1 / -1; }
.message-box {
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
}

/* ================= BLOG EDITOR ================= */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.editor-form { display: flex; flex-direction: column; gap: 16px; }
.editor-form .field textarea { font-family: var(--font-mono); font-size: 14px; line-height: 1.7; min-height: 340px; }
.field .slug-row { display: flex; align-items: center; gap: 8px; }
.field .slug-row span { color: var(--ink-50); font-size: 14px; }
.field .slug-row input { flex: 1; font-family: var(--font-mono); font-size: 14px; }

.toggle-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.toggle-row .toggle-label { font-weight: 600; font-size: 14px; color: var(--ink); }
.toggle-row .toggle-sub { font-size: 12px; color: var(--ink-70); }
.toggle { margin-left: auto; position: relative; width: 46px; height: 26px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle .track { position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,.14); transition: background var(--t-fast); }
.toggle .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform var(--t-fast);
}
.toggle input:checked + .track { background: linear-gradient(100deg, var(--cyan) 0%, var(--violet) 100%); }
.toggle input:checked + .track::after { transform: translateX(20px); }

.preview-pane {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  overflow-y: auto;
  max-height: 620px;
}
.preview-pane .pane-label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-50); margin-bottom: 12px; }
.preview-body { font-size: 15px; line-height: 1.7; color: var(--ink-87); }
.preview-body h1, .preview-body h2, .preview-body h3, .preview-body h4 { margin: 18px 0 10px; line-height: 1.3; }
.preview-body h1 { font-size: 26px; }
.preview-body h2 { font-size: 22px; }
.preview-body h3 { font-size: 18px; }
.preview-body p { margin-bottom: 12px; }
.preview-body a { color: var(--cyan); text-decoration: underline; }
.preview-body ul, .preview-body ol { margin: 0 0 12px 22px; }
.preview-body li { margin-bottom: 4px; }
.preview-body blockquote { border-left: 3px solid var(--violet); padding: 4px 14px; margin: 0 0 12px; color: var(--ink-70); font-style: italic; }
.preview-body code { font-family: var(--font-mono); font-size: 0.9em; background: rgba(139,92,246,.15); padding: 2px 6px; border-radius: 6px; color: var(--ink-87); }
.preview-body pre { background: rgba(0,0,0,.4); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; overflow-x: auto; margin-bottom: 12px; }
.preview-body pre code { background: none; padding: 0; }
.preview-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.preview-body img { max-width: 100%; border-radius: var(--radius-md); }
.preview-body strong { color: var(--ink); }

/* ================= SETTINGS ================= */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-section h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.settings-section .section-desc { font-size: 13px; color: var(--ink-70); margin-bottom: 16px; }
.toggle-row.settings-row { margin-bottom: 12px; }
.field textarea.reply { min-height: 90px; }

/* ================= TOASTS ================= */
.toast-root {
  position: fixed; top: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  min-width: 260px; max-width: 360px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);               /* #111827 */
  border: 1px solid var(--border);          /* white/10 */
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
  color: var(--ink-87);
  animation: toast-in .3s cubic-bezier(.16,1,.3,1);
}
.toast.out { animation: toast-out .3s ease forwards; }
.toast-icon { font-size: 16px; flex: none; }
.toast.success .toast-icon { color: var(--ok); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--cyan); }

/* ================= SKELETON ================= */
.skeleton { position: relative; overflow: hidden; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: 8px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  animation: shimmer 1.4s infinite;
}
.sk-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.sk-card { height: 120px; border-radius: var(--radius-lg); }
.sk-table { height: 320px; border-radius: var(--radius-lg); margin-bottom: 20px; }
.sk-list { height: 260px; border-radius: var(--radius-lg); }
.sk-row { height: 40px; margin: 12px; }

/* ================= ANIMATIONS ================= */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-10px)} 40%{transform:translateX(10px)} 60%{transform:translateX(-7px)} 80%{transform:translateX(7px)} }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(30px); } }

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  html, body { overflow-x: clip; }
  /* inputs ≥ 16px to prevent iOS zoom */
  input, textarea, select { font-size: 16px !important; }
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: inline-flex; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); z-index: 40; }
  .main { margin-left: 0; }
  .burger { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px; }
  .editor-grid, .settings-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .user-name { display: none; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filters .btn { width: 100%; margin-left: 0; }
  .view-head .actions { width: 100%; margin-left: 0; }
  .view-head .actions .btn { flex: 1; }
}

/* ================= REDUCED MOTION ================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .skeleton::after { animation: none !important; }
  .sidebar { transition: none; }
}
