/* =========================================================================
   NIMBUS DESIGN SYSTEM
   A small, deliberate token set — not a framework. Everything below is
   built on CSS variables so light/dark mode is a single attribute swap.
   ========================================================================= */

:root {
  /* -- brand gradient (the one signature accent used sparingly) -- */
  --accent-1: #6C5CE7;      /* electric violet */
  --accent-2: #00D9C0;      /* aurora teal */
  --accent-grad: linear-gradient(135deg, var(--accent-1), var(--accent-2));

  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --sidebar-w: 264px;
  --sidebar-w-collapsed: 84px;
  --navbar-h: 68px;

  --shadow-sm: 0 1px 2px rgba(15, 15, 35, 0.06), 0 1px 3px rgba(15,15,35,0.08);
  --shadow-md: 0 8px 24px rgba(15, 15, 35, 0.10);
  --shadow-lg: 0 20px 48px rgba(15, 15, 35, 0.18);

  --transition: 180ms cubic-bezier(.4,0,.2,1);
}

/* -------------------------------------------------- light theme (default) */
:root, [data-theme="light"] {
  --bg: #F5F6FB;
  --surface: #FFFFFF;
  --surface-2: #F9FAFF;
  --border: rgba(20, 22, 41, 0.08);
  --text: #1A1D29;
  --text-muted: #666B85;
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.5);
  --overlay-scrim: rgba(10, 12, 25, 0.45);
}

/* --------------------------------------------------------- dark theme --- */
[data-theme="dark"] {
  --bg: #0B0F1A;
  --surface: #12172A;
  --surface-2: #171D33;
  --border: rgba(255, 255, 255, 0.08);
  --text: #E7E9F5;
  --text-muted: #9096B5;
  --glass-bg: rgba(18, 23, 42, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --overlay-scrim: rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  transition: background var(--transition), color var(--transition);
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 .5rem; }
a { color: inherit; text-decoration: none; }
.text-muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }

/* ============================================================ SCROLLBAR */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* ============================================================ AUTH PAGES */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(108,92,231,.25), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(0,217,192,.2), transparent 45%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-brand .logo-mark { width: 34px; height: 34px; }
.auth-brand span { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-footer-link { text-align: center; margin-top: 20px; font-size: .9rem; color: var(--text-muted); }

/* ================================================================ LOGO */
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-grad);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}

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

/* --------------------------------------------------------------- SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; bottom: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: width var(--transition), transform var(--transition);
}
.app-shell.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.sidebar-brand {
  height: var(--navbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-brand span { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.app-shell.collapsed .sidebar-brand span,
.app-shell.collapsed .nav-label,
.app-shell.collapsed .nav-section-title { display: none; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-section-title {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); padding: 16px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500; font-size: .92rem;
  margin-bottom: 2px; position: relative;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-item i, .nav-item .bi { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
}
.nav-item.active::before {
  content: "";
  position: absolute; left: -12px; top: 6px; bottom: 6px; width: 4px;
  border-radius: 4px; background: var(--accent-grad);
}
.app-shell.collapsed .nav-item.active::before { left: 0; }
.nav-badge {
  margin-left: auto; font-size: .68rem; font-weight: 700;
  background: var(--accent-grad); color: #fff; border-radius: 20px;
  padding: 1px 7px;
}
.app-shell.collapsed .nav-badge { display: none; }

.sidebar-footer { padding: 14px 20px; border-top: 1px solid var(--border); }
.sidebar-toggle-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}

/* --------------------------------------------------------------- CONTENT */
.main-col {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  transition: margin-left var(--transition);
}
.app-shell.collapsed .main-col { margin-left: var(--sidebar-w-collapsed); }

/* ------------------------------------------------------------------ TOP NAV */
.topnav {
  height: var(--navbar-h);
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--glass-border);
}
.topnav .page-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.topnav .search-box {
  flex: 1; max-width: 420px; position: relative; display: none;
}
.topnav .search-box input {
  width: 100%; padding: 9px 14px 9px 38px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: .88rem;
}
.topnav .search-box .bi { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
@media (min-width: 640px) { .topnav .search-box { display: block; } }

.topnav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
  background: var(--accent-grad); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.6rem; }

.user-menu { position: relative; }
.user-menu-btn { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px; border-radius: 999px; }
.user-menu-btn:hover { background: var(--surface-2); }
.user-menu-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  width: 220px; padding: 8px; display: none; z-index: 50;
}
.user-menu.open .user-menu-dropdown { display: block; }
.user-menu-dropdown a, .user-menu-dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 8px; border: none; background: none; color: var(--text);
  font-size: .88rem; cursor: pointer; font-family: inherit;
}
.user-menu-dropdown a:hover, .user-menu-dropdown button:hover { background: var(--surface-2); }
.user-menu-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }

.suggestion-timeline { position: relative; padding-left: 20px; margin-top: 10px; }
.suggestion-timeline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 1px; background: var(--border); }
.suggestion-timeline-item { position: relative; padding: 8px 0; }
.suggestion-timeline-dot { position: absolute; left: -20px; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-1); }

/* --- media library (Phase 6) ------------------------------------------------ */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-top: 16px; }
.media-tile { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.media-tile-preview { height: 120px; background: var(--surface-2); }
.media-tile-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-tile-body { padding: 10px; }
.media-tile-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-tile-actions { display: flex; gap: 6px; margin-top: 8px; }
.media-delete-form { display: inline; }

/* --- blog editor SEO preview (Phase 6) -------------------------------------- */
.seo-preview-google { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.seo-preview-google-url { font-size: .78rem; color: #1a0dab; }
[data-theme="dark"] .seo-preview-google-url { color: #8ab4f8; }
.seo-preview-google-title { font-size: .95rem; color: #1a0dab; margin: 2px 0; }
[data-theme="dark"] .seo-preview-google-title { color: #8ab4f8; }
.seo-preview-google-desc { font-size: .82rem; color: var(--text-muted); }
.seo-preview-og { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seo-preview-og-image {
  width: 100px; height: 80px; flex-shrink: 0; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.4rem;
}
.seo-preview-og-image img { width: 100%; height: 100%; object-fit: cover; }
.seo-preview-og-body { padding: 8px 12px; background: var(--surface-2); flex: 1; }
.seo-preview-og-title { font-size: .85rem; font-weight: 600; }
.seo-preview-og-desc { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* --- notification center (Phase 5) ----------------------------------------- */
.notification-menu { position: relative; }
.notification-dropdown {
  position: absolute; right: 0; top: calc(100% + 10px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  width: 320px; max-height: 400px; overflow-y: auto; padding: 6px; display: none; z-index: 50;
}
.notification-menu.open .notification-dropdown { display: block; }
.notification-dropdown-header {
  font-size: .78rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted);
  padding: 8px 10px 6px;
}
.notification-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 8px; color: var(--text);
}
.notification-item:hover { background: var(--surface-2); }
.notification-item i { margin-top: 2px; color: var(--accent-1); }

/* --- command bar (Phase 5) -------------------------------------------------- */
.cmdk-trigger kbd {
  font-size: .68rem; font-family: inherit; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px;
}
.cmdk-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200;
  align-items: flex-start; justify-content: center; padding-top: 12vh;
}
.cmdk-overlay.open { display: flex; }
.cmdk-panel {
  width: min(560px, 92vw); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.cmdk-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cmdk-input-row i { color: var(--text-muted); }
.cmdk-input-row input { flex: 1; border: none; background: none; outline: none; font-size: .95rem; color: var(--text); }
.cmdk-input-row kbd { font-size: .7rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; }
#cmdk-results { max-height: 320px; overflow-y: auto; padding: 6px; }
.cmdk-result {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: .9rem;
}
.cmdk-result.active, .cmdk-result:hover { background: var(--surface-2); }
.cmdk-result i { color: var(--accent-1); width: 18px; text-align: center; }

/* --- breadcrumbs (Phase 5) -------------------------------------------------- */
.breadcrumb-bar {
  padding: 12px 24px 0; font-size: .82rem; color: var(--text-muted); display: flex; gap: 8px; align-items: center;
}
.breadcrumb-bar a { color: var(--text-muted); }
.breadcrumb-bar a:hover { color: var(--text); }

/* --- accessibility (Phase 5) ------------------------------------------------ */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 300; background: var(--accent-1); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; font-size: .85rem; font-weight: 600;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent-1); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* --- bulk action toolbar (Phase 6) ------------------------------------------ */
.bulk-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.bulk-toolbar[hidden] { display: none; }
.bulk-toolbar .bulk-toolbar-count { font-weight: 600; font-size: .85rem; }
.bulk-toolbar .bulk-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* ------------------------------------------------------------------ PAGE */
.page-content { padding: 24px; max-width: 1400px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1 { font-size: 1.5rem; margin: 0; }
.page-header p { margin: 4px 0 0; color: var(--text-muted); font-size: .9rem; }

/* mobile sidebar */
.sidebar-scrim { position: fixed; inset: 0; background: var(--overlay-scrim); z-index: 35; display: none; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  .app-shell.mobile-open .sidebar { transform: translateX(0); }
  .main-col, .app-shell.collapsed .main-col { margin-left: 0; }
  .app-shell.mobile-open .sidebar-scrim { display: block; }
}

/* =========================================================== COMPONENTS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
}
.card-body { padding: 22px; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-header h3 { font-size: 1rem; margin: 0; }

.grid { display: grid; gap: 20px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* --- stat cards -------------------------------------------------------- */
.stat-card {
  position: relative; overflow: hidden;
  padding: 20px 22px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-grad); color: #fff; font-size: 1.1rem; margin-bottom: 14px;
}
.stat-card .stat-value { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.stat-card .stat-label { color: var(--text-muted); font-size: .82rem; margin-top: 2px; }
.stat-card .stat-delta { font-size: .78rem; font-weight: 600; margin-top: 10px; display: inline-flex; align-items: center; gap: 4px; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }
.stat-card::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
  background: var(--accent-grad); opacity: .08; border-radius: 50%;
}

/* --- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: .88rem;
  border: 1px solid transparent; cursor: pointer; transition: all var(--transition);
  font-family: var(--font-body); line-height: 1;
}
.btn-sm { padding: 7px 12px; font-size: .8rem; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 16px rgba(108,92,231,.35); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* --- forms --------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.form-control, select.form-control, textarea.form-control {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-family: inherit; font-size: .9rem; transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, select.form-control:focus, textarea.form-control:focus {
  outline: none; border-color: var(--accent-1); box-shadow: 0 0 0 3px rgba(108,92,231,.18);
}
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: 4px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; }
.input-group { position: relative; }
.radio-pill-group { display: flex; gap: 8px; }
.radio-pill { display: none; }
.radio-pill-label {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer;
  font-size: .85rem; color: var(--text-muted);
}
.radio-pill:checked + .radio-pill-label { background: var(--accent-grad); color: #fff; border-color: transparent; }

/* --- badges / pills ------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700;
}
.badge-success { background: rgba(34,197,94,.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,.15); color: var(--danger); }
.badge-info { background: rgba(59,130,246,.15); color: var(--info); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

/* --- tables --------------------------------------------------------------- */
.table-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.table-toolbar .search-input { position: relative; flex: 1; min-width: 200px; }
.table-toolbar .search-input input { padding-left: 36px; }
.table-toolbar .search-input .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
table.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--surface); }
table.data-table th {
  text-align: left; padding: 13px 16px; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
table.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr { transition: background var(--transition); }
table.data-table tbody tr:hover { background: var(--surface-2); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable .bi { font-size: .7rem; opacity: .5; }

.row-actions { display: flex; gap: 6px; }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .name { font-weight: 600; }
.cell-user .email { color: var(--text-muted); font-size: .82rem; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .bi { font-size: 2.4rem; opacity: .35; margin-bottom: 12px; display: block; }
.empty-state h3 { color: var(--text); margin-bottom: 4px; }

/* --- pagination --------------------------------------------------------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; font-size: .85rem; color: var(--text-muted); border: 1px solid transparent;
  padding: 0 8px;
}
.pagination a:hover { background: var(--surface-2); }
.pagination .active { background: var(--accent-grad); color: #fff; font-weight: 700; }
.pagination .disabled { opacity: .4; }

/* --- skeleton loaders ----------------------------------------------------- */
@keyframes skeleton-pulse { 0% { opacity: .55; } 50% { opacity: 1; } 100% { opacity: .55; } }
.skeleton { background: var(--surface-2); border-radius: 8px; animation: skeleton-pulse 1.4s ease-in-out infinite; }
.skeleton-text { height: 12px; margin-bottom: 8px; border-radius: 6px; }
.skeleton-card { height: 110px; border-radius: var(--radius-md); }

/* --- toasts --------------------------------------------------------------- */
#toast-stack { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  font-size: .87rem; animation: toast-in .25s ease-out;
}
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast-item .bi { font-size: 1.1rem; margin-top: 1px; }
.toast-item.success .bi { color: var(--success); }
.toast-item.danger .bi { color: var(--danger); }
.toast-item.info .bi { color: var(--info); }
.toast-item.warning .bi { color: var(--warning); }
.toast-close { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; }

/* --- flash messages (server-rendered, become toasts via JS) -------------- */
.flash-seed { display: none; }

/* --- misc ----------------------------------------------------------------- */
.divider { height: 1px; background: var(--border); border: none; margin: 20px 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.progress-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-grad); border-radius: 999px; }

.filter-pop { position: relative; }
.filter-pop-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: 260px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 16px; display: none;
}
.filter-pop.open .filter-pop-panel { display: block; }

/* --- kanban-ish status columns for suggestions --------------------------- */
.status-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.status-column-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 700; font-size: .85rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }

/* --- blog ------------------------------------------------------------------ */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.blog-card { border-radius: var(--radius-md); overflow: hidden; background: var(--surface); border: 1px solid var(--border); transition: transform var(--transition), box-shadow var(--transition); }
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.blog-card .thumb { height: 160px; background: var(--accent-grad); position: relative; overflow: hidden; }
.blog-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.blog-card .thumb-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.85); font-size: 2rem; }
.blog-card .body { padding: 18px; }
.blog-card h3 { font-size: 1.02rem; margin-bottom: 6px; }
.blog-card p { color: var(--text-muted); font-size: .86rem; }
.blog-meta { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--text-muted); margin-top: 12px; }

.prose { font-size: 1rem; line-height: 1.75; }
.prose h2 { font-size: 1.3rem; margin-top: 1.6em; }
.prose p { margin: 0 0 1em; }
.prose ul { margin: 0 0 1em; padding-left: 1.2em; }

/* --- login/loading spinner --------------------------------------------- */
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading .btn-label { opacity: 0; }
.btn.is-loading { position: relative; }
.btn.is-loading .spinner { position: absolute; }

/* --- responsive tweaks -------------------------------------------------- */
@media (max-width: 640px) {
  .page-content { padding: 16px; }
  .grid-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .grid-stats { grid-template-columns: 1fr; }
}

/* --- utility for quill editor to inherit theme -------------------------- */
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--border) !important; }
.ql-editor { min-height: 260px; color: var(--text); font-family: var(--font-body); }
.ql-snow .ql-picker { color: var(--text); }
.ql-snow .ql-stroke { stroke: var(--text-muted); }
.ql-snow .ql-fill { fill: var(--text-muted); }

/* --- experience timeline (about page) -------------------------------------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 18px; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute; left: -26px; top: 22px; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--accent-1); background: var(--surface);
}

/* --- blog reader experience (Phase 4) -------------------------------------- */
#reading-progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--accent-grad); z-index: 100; transition: width 80ms linear;
}
.toc-link.active { color: var(--accent-1) !important; font-weight: 600; }
.code-copy-btn {
  position: absolute; top: 8px; right: 8px; font-size: .72rem; padding: 4px 9px;
  border-radius: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer; opacity: 0; transition: opacity var(--transition);
}
.prose pre { position: relative; }
.prose pre:hover .code-copy-btn { opacity: 1; }

/* --- public site footer --------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); margin-top: auto; }
.site-footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 28px 40px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.site-footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; }
.site-footer-brand .logo-mark { width: 28px; height: 28px; font-size: 13px; }
.site-footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer-links a { color: var(--text-muted); font-size: .88rem; transition: color var(--transition); }
.site-footer-links a:hover { color: var(--text); }
.site-footer-copy { font-size: .82rem; }
@media (max-width: 640px) {
  .site-footer-inner { padding: 24px 20px; justify-content: center; text-align: center; }
}

/* --- landing page --------------------------------------------------------- */
.landing-hero {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg);
}
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 40px; }
.landing-nav .links { display: flex; gap: 26px; align-items: center; }
.hero-inner { flex: 1; display: flex; align-items: center; padding: 40px; position: relative; overflow: hidden; }
.hero-inner::before {
  content: ""; position: absolute; width: 640px; height: 640px; border-radius: 50%;
  background: radial-gradient(circle, rgba(108,92,231,.25), transparent 60%);
  top: -200px; right: -160px; filter: blur(10px);
}
.hero-inner::after {
  content: ""; position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,217,192,.18), transparent 60%);
  bottom: -220px; left: -140px;
}
.hero-copy { max-width: 620px; position: relative; z-index: 2; margin: 0 auto; text-align: center; }
.hero-copy .eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: .78rem; font-weight: 600; margin-bottom: 20px;
}
.hero-copy h1 { font-size: 2.6rem; line-height: 1.1; margin-bottom: 16px; }
.hero-copy p.lead { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 640px) { .hero-copy h1 { font-size: 1.9rem; } .landing-nav { padding: 18px 20px; } }
