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

/* ═══════════════════════════════════════════════════════════════════════════
   CWL DPP — Gemstone Design System v1
   Philosophy: rare, precise, deep — like a cut stone catching light
   Themes: Pearl (light) · Obsidian (dark) · Dusk (warm dark) · Arctic (pure)
   Accents: Emerald · Sapphire · Rose · Amber · Sky · Violet · Coral · Slate
═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   DESIGN TOKENS — Pearl (Light, Default)
───────────────────────────────────────────────────────────── */
:root {
  /* Accent — Gemstone Emerald (default) */
  --accent:        #00c896;
  --accent-dark:   #00a87c;
  --accent-deeper: #007a5a;
  --accent-light:  #e6fff9;
  --accent-mid:    #5ee8c4;
  --accent-rgb:    0, 200, 150;
  --accent-glow:   rgba(0, 200, 150, 0.14);
  --accent-ring:   rgba(0, 200, 150, 0.30);

  /* Sidebar */
  --sidebar-bg:         #0b1120;
  --sidebar-top:        #0f1629;
  --sidebar-border:     rgba(255,255,255,0.06);
  --sidebar-text:       rgba(255,255,255,0.50);
  --sidebar-text-hover: rgba(255,255,255,0.88);
  --sidebar-text-active:rgba(255,255,255,1);
  --sidebar-active-bg:  rgba(0,200,150,0.13);
  --sidebar-hover-bg:   rgba(255,255,255,0.05);
  --sidebar-section:    rgba(255,255,255,0.22);
  --sidebar-icon:       rgba(255,255,255,0.35);

  /* Page backgrounds */
  --bg:          #f2f4f9;
  --bg-alt:      #eceef5;

  /* Surfaces */
  --surface:     #ffffff;
  --surface-2:   #f7f9fc;
  --surface-3:   #eff2f7;
  --surface-overlay: rgba(255,255,255,0.88);

  /* Text */
  --text:        #0d1526;
  --text-soft:   #364059;
  --text-muted:  #6a7898;
  --text-faint:  #9faabe;
  --text-invert: #ffffff;

  /* Borders */
  --border:        #e1e5ef;
  --border-strong: #cbd1e0;
  --border-focus:  var(--accent);
  --border-grey:   #e1e5ef;

  /* Header */
  --header-bg:     #ffffff;
  --header-border: #eaecf5;

  /* Shadows */
  --shadow-xs:   0 1px 2px rgba(13,21,38,0.04);
  --shadow-sm:   0 1px 4px rgba(13,21,38,0.06), 0 0 0 1px rgba(13,21,38,0.03);
  --shadow:      0 4px 16px rgba(13,21,38,0.08), 0 1px 4px rgba(13,21,38,0.04);
  --shadow-lg:   0 12px 40px rgba(13,21,38,0.12), 0 4px 12px rgba(13,21,38,0.06);
  --shadow-xl:   0 24px 64px rgba(13,21,38,0.16), 0 8px 24px rgba(13,21,38,0.08);
  --shadow-accent: 0 4px 20px rgba(var(--accent-rgb), 0.30);

  /* Radius */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-2xl:  28px;
  --radius-pill: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* Transitions */
  --t:        0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:   0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-expo:   0.5s cubic-bezier(0.16, 1, 0.3, 1);

  /* Legacy aliases */
  --green:        var(--accent);
  --green-dark:   var(--accent-dark);
  --green-deeper: var(--accent-deeper);
  --green-light:  var(--accent-light);
  --green-mid:    var(--accent-mid);
  --navy:         var(--sidebar-bg);
  --navy-mid:     #1a2540;
  --navy-top:     var(--sidebar-top);
  --off-white:    var(--surface-2);
}

/* ─────────────────────────────────────────────────────────────
   ACCENT VARIANTS (data-accent on <html>)
───────────────────────────────────────────────────────────── */
[data-accent="sapphire"] {
  --accent: #6366f1; --accent-dark: #4f46e5; --accent-deeper: #3730a3;
  --accent-light: #eef2ff; --accent-mid: #a5b4fc;
  --accent-rgb: 99,102,241; --accent-glow: rgba(99,102,241,.14);
  --accent-ring: rgba(99,102,241,.30); --sidebar-active-bg: rgba(99,102,241,.15);
}
[data-accent="rose"] {
  --accent: #f43f5e; --accent-dark: #e11d48; --accent-deeper: #be123c;
  --accent-light: #fff1f2; --accent-mid: #fda4af;
  --accent-rgb: 244,63,94; --accent-glow: rgba(244,63,94,.14);
  --accent-ring: rgba(244,63,94,.30); --sidebar-active-bg: rgba(244,63,94,.13);
}
[data-accent="amber"] {
  --accent: #f59e0b; --accent-dark: #d97706; --accent-deeper: #b45309;
  --accent-light: #fffbeb; --accent-mid: #fcd34d;
  --accent-rgb: 245,158,11; --accent-glow: rgba(245,158,11,.14);
  --accent-ring: rgba(245,158,11,.30); --sidebar-active-bg: rgba(245,158,11,.13);
}
[data-accent="sky"] {
  --accent: #0ea5e9; --accent-dark: #0284c7; --accent-deeper: #0369a1;
  --accent-light: #f0f9ff; --accent-mid: #7dd3fc;
  --accent-rgb: 14,165,233; --accent-glow: rgba(14,165,233,.14);
  --accent-ring: rgba(14,165,233,.30); --sidebar-active-bg: rgba(14,165,233,.13);
}
[data-accent="violet"] {
  --accent: #8b5cf6; --accent-dark: #7c3aed; --accent-deeper: #6d28d9;
  --accent-light: #f5f3ff; --accent-mid: #c4b5fd;
  --accent-rgb: 139,92,246; --accent-glow: rgba(139,92,246,.14);
  --accent-ring: rgba(139,92,246,.30); --sidebar-active-bg: rgba(139,92,246,.15);
}
[data-accent="coral"] {
  --accent: #f97316; --accent-dark: #ea580c; --accent-deeper: #c2410c;
  --accent-light: #fff7ed; --accent-mid: #fdba74;
  --accent-rgb: 249,115,22; --accent-glow: rgba(249,115,22,.14);
  --accent-ring: rgba(249,115,22,.30); --sidebar-active-bg: rgba(249,115,22,.13);
}
[data-accent="slate"] {
  --accent: #64748b; --accent-dark: #475569; --accent-deeper: #334155;
  --accent-light: #f8fafc; --accent-mid: #94a3b8;
  --accent-rgb: 100,116,139; --accent-glow: rgba(100,116,139,.14);
  --accent-ring: rgba(100,116,139,.30); --sidebar-active-bg: rgba(100,116,139,.15);
}

/* ─────────────────────────────────────────────────────────────
   THEMES
   Both body.theme-* and html.theme-* selectors are provided so
   the blocking pre-render script (applied to <html>) eliminates
   the flash of default theme on page load.
───────────────────────────────────────────────────────────── */
html.theme-dark, .theme-dark {
  --bg: #070c18; --bg-alt: #0c1324;
  --surface: #111827; --surface-2: #192235; --surface-3: #202f47; --surface-overlay: rgba(17,24,39,.92);
  --text: #eef2ff; --text-soft: #c4ceea; --text-muted: #7d90be; --text-faint: #4a5a7a; --text-invert: #0d1526;
  --border: #1c2b46; --border-strong: #273d60; --border-grey: #1c2b46;
  --header-bg: #111827; --header-border: #1c2b46;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.28); --shadow-sm: 0 1px 4px rgba(0,0,0,.38),0 0 0 1px rgba(255,255,255,.025);
  --shadow: 0 4px 16px rgba(0,0,0,.50),0 1px 4px rgba(0,0,0,.28); --shadow-lg: 0 12px 40px rgba(0,0,0,.60),0 4px 12px rgba(0,0,0,.32);
  --shadow-xl: 0 24px 64px rgba(0,0,0,.70),0 8px 24px rgba(0,0,0,.38);
}
html.theme-dusk, .theme-dusk {
  --bg: #0e0907; --bg-alt: #181008;
  --surface: #1d1610; --surface-2: #25201a; --surface-3: #2e281f; --surface-overlay: rgba(29,22,16,.92);
  --text: #fdf5ec; --text-soft: #e5d1b8; --text-muted: #9e7c58; --text-faint: #5c3e22; --text-invert: #0e0907;
  --border: #312419; --border-strong: #453322; --border-grey: #312419;
  --header-bg: #1d1610; --header-border: #312419;
  --sidebar-bg: #0b0805; --sidebar-top: #130e08;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.32); --shadow-sm: 0 1px 4px rgba(0,0,0,.42),0 0 0 1px rgba(255,255,255,.02);
  --shadow: 0 4px 16px rgba(0,0,0,.55),0 1px 4px rgba(0,0,0,.32); --shadow-lg: 0 12px 40px rgba(0,0,0,.65),0 4px 12px rgba(0,0,0,.36);
}
html.theme-arctic, .theme-arctic {
  --bg: #ffffff; --bg-alt: #f9fafb;
  --surface: #ffffff; --surface-2: #f4f7fb; --surface-3: #edf1f8;
  --border: #dce2ed; --border-strong: #c6cedc; --border-grey: #dce2ed;
  --header-bg: #ffffff; --header-border: #eaecf5;
}

/* ─────────────────────────────────────────────────────────────
   KEYFRAMES
───────────────────────────────────────────────────────────── */
@keyframes spin         { to { transform:rotate(360deg); } }
@keyframes pulse        { 0%,100%{opacity:1}50%{opacity:.45} }
@keyframes shimmer      { 0%{background-position:-400px 0}100%{background-position:400px 0} }
@keyframes fadeIn       { from{opacity:0}to{opacity:1} }
@keyframes fadeInUp     { from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:translateY(0)} }
@keyframes fadeInDown   { from{opacity:0;transform:translateY(-12px)}to{opacity:1;transform:translateY(0)} }
@keyframes slideInRight { from{opacity:0;transform:translateX(22px)}to{opacity:1;transform:translateX(0)} }
@keyframes slideInLeft  { from{opacity:0;transform:translateX(-22px)}to{opacity:1;transform:translateX(0)} }
@keyframes scaleIn      { from{opacity:0;transform:scale(.94)}to{opacity:1;transform:scale(1)} }
@keyframes scaleInSpring{ from{opacity:0;transform:scale(.86)}to{opacity:1;transform:scale(1)} }
@keyframes themeWipe    { 0%{clip-path:circle(0% at var(--wx,50%) var(--wy,8%))}100%{clip-path:circle(150% at var(--wx,50%) var(--wy,8%))} }
@keyframes confettiFall { 0%{transform:translateY(-10px) rotate(0deg);opacity:1}100%{transform:translateY(130px) rotate(720deg);opacity:0} }
@keyframes celebRing    { 0%{transform:scale(.5);opacity:.9}100%{transform:scale(2.5);opacity:0} }
@keyframes checkDraw    { 0%{stroke-dashoffset:60}100%{stroke-dashoffset:0} }
@keyframes checkCircle  { 0%{stroke-dashoffset:170;opacity:0}25%{opacity:1}100%{stroke-dashoffset:0} }
@keyframes cardEntry    { from{opacity:0;transform:translateY(20px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)} }
@keyframes indicatorIn  { from{transform:scaleY(0)}to{transform:scaleY(1)} }
@keyframes ripplePop    { 0%{transform:scale(0);opacity:.55}100%{transform:scale(4);opacity:0} }
@keyframes glowPulse    { 0%,100%{box-shadow:0 0 0 0 var(--accent-glow)}50%{box-shadow:0 0 0 6px transparent} }
@keyframes floatUp      { 0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)} }

/* ─────────────────────────────────────────────────────────────
   BASE
───────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { font-size:var(--html-font,16px); scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-feature-settings: 'cv02','cv03','cv04','cv11','ss01';
  transition: background var(--t-slow), color var(--t-slow);
}
img { max-width:100%; height:auto; display:block; }
a   { color:var(--accent); text-decoration:none; transition:color var(--t); }
a:hover { color:var(--accent-dark); }

/* Scrollbar */
::-webkit-scrollbar            { width:5px; height:5px; }
::-webkit-scrollbar-track      { background:transparent; }
::-webkit-scrollbar-thumb      { background:var(--border-strong); border-radius:99px; }
::-webkit-scrollbar-thumb:hover{ background:var(--text-faint); }
::-webkit-scrollbar-corner     { background:transparent; }

/* Selection */
::selection { background:var(--accent-glow); color:var(--accent-darker,var(--accent-dark)); }

/* Focus */
:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:var(--radius-sm); }

/* ─────────────────────────────────────────────────────────────
   LAYOUT
───────────────────────────────────────────────────────────── */
.container  { width:100%; max-width:1180px; margin:0 auto; padding:0 24px; }
.hidden     { display:none !important; }
.text-muted { color:var(--text-muted); font-size:.875rem; }
.py-8       { padding-top:32px; padding-bottom:32px; }
.mb-6       { margin-bottom:24px; }

/* ═══════════════════════════════════════════════════════════════════════════
   ADMIN LAYOUT
═══════════════════════════════════════════════════════════════════════════ */
.admin-layout { display:flex; min-height:100vh; }

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top:0; left:0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 200;
  border-right: 1px solid var(--sidebar-border);
  transition: width var(--t-expo), min-width var(--t-expo), transform var(--t-expo);
}
.sidebar::-webkit-scrollbar { width:3px; }
.sidebar::-webkit-scrollbar-thumb { background:rgba(255,255,255,.07); border-radius:3px; }

/* Radial accent glow top */
.sidebar::before {
  content: '';
  position: absolute;
  top:0; left:0; right:0;
  height: 280px;
  background: radial-gradient(ellipse at 50% 0%, rgba(var(--accent-rgb),.14) 0%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}
.sidebar > * { position:relative; z-index:1; }

/* Compact sidebar */
.sidebar.compact { width:60px; min-width:60px; }
.sidebar.compact .sidebar-brand-text,
.sidebar.compact .sidebar-nav-label,
.sidebar.compact .sidebar-section-label,
.sidebar.compact .sidebar-clock,
.sidebar.compact .sidebar-user-info,
.sidebar.compact .sidebar-badge { display:none; }
.sidebar.compact .sidebar-brand { justify-content:center; padding:0 14px; }
.sidebar.compact .sidebar-nav-item { justify-content:center; padding:0 18px; gap:0; }

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
  min-height: 62px;
}
.sidebar-brand:hover { opacity:.9; }
.sidebar-brand-logo { width:32px; height:32px; border-radius:8px; object-fit:contain; flex-shrink:0; }
.sidebar-brand-mark {
  width:32px; height:32px;
  border-radius:8px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:800; color:#fff; flex-shrink:0;
  box-shadow: 0 2px 10px rgba(var(--accent-rgb),.45);
  letter-spacing:-0.5px;
}
.sidebar-brand-text   { display:flex; flex-direction:column; gap:1px; overflow:hidden; }
.sidebar-brand-name   { font-size:13px; font-weight:700; color:#fff; white-space:nowrap; letter-spacing:-.3px; line-height:1.2; }
.sidebar-brand-sub    { font-size:10px; font-weight:600; color:var(--accent); text-transform:uppercase; letter-spacing:.8px; line-height:1; }

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

.sidebar-section-label {
  font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.9px;
  color:var(--sidebar-section); padding:10px 8px 3px; margin-top:6px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  height: 35px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t), color var(--t);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
}
.sidebar-nav-item:hover { background:var(--sidebar-hover-bg); color:var(--sidebar-text-hover); }
.sidebar-nav-item.active { background:var(--sidebar-active-bg); color:var(--sidebar-text-active); }
.sidebar-nav-item.active::before {
  content:'';
  position:absolute; left:0; top:22%; bottom:22%;
  width:3px;
  background:var(--accent);
  border-radius:0 2px 2px 0;
  animation:indicatorIn var(--t-spring) both;
}

.sidebar-nav-icon {
  width:16px; height:16px; flex-shrink:0;
  color:var(--sidebar-icon); transition:color var(--t);
}
.sidebar-nav-item:hover .sidebar-nav-icon,
.sidebar-nav-item.active .sidebar-nav-icon { color:var(--accent); }

.sidebar-nav-label { flex:1; }

.sidebar-badge {
  font-size:10px; font-weight:700; padding:2px 6px;
  border-radius:var(--radius-pill);
  background:rgba(var(--accent-rgb),.16); color:var(--accent); line-height:1.4;
}
.sidebar-badge.danger { background:rgba(239,68,68,.16); color:#f87171; }

/* Footer */
.sidebar-footer { padding:8px; border-top:1px solid var(--sidebar-border); display:flex; flex-direction:column; gap:2px; }

.sidebar-user {
  display:flex; align-items:center; gap:9px;
  padding:7px 9px; border-radius:var(--radius-sm);
  cursor:pointer; transition:background var(--t); text-decoration:none;
}
.sidebar-user:hover { background:var(--sidebar-hover-bg); }
.sidebar-user-avatar {
  width:26px; height:26px; border-radius:var(--radius-pill);
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-dark) 100%);
  display:flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:800; color:#fff; flex-shrink:0;
  box-shadow:0 1px 4px rgba(var(--accent-rgb),.4);
}
.sidebar-user-info  { flex:1; overflow:hidden; }
.sidebar-user-name  { font-size:12px; font-weight:600; color:var(--sidebar-text-hover); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.3; }
.sidebar-user-role  { font-size:10px; color:var(--sidebar-text); line-height:1.3; }
.sidebar-clock      { font-size:11px; color:var(--sidebar-text); padding:2px 9px; letter-spacing:.3px; font-variant-numeric:tabular-nums; }

/* ── Main content ── */
.main-content { flex:1; min-width:0; margin-left:240px; display:flex; flex-direction:column; min-height:100vh; transition:margin-left var(--t-expo); }
.main-content.compact-sidebar { margin-left:60px; }

/* ─────────────────────────────────────────────────────────────
   TOPBAR
───────────────────────────────────────────────────────────── */
.topbar {
  background:var(--header-bg); border-bottom:1px solid var(--header-border);
  padding:0 24px; height:58px;
  display:flex; align-items:center; gap:16px;
  position:sticky; top:0; z-index:100;
  transition:background var(--t-slow),border-color var(--t-slow);
}
.topbar-breadcrumb { display:flex; align-items:center; gap:6px; font-size:0.8125rem; color:var(--text-muted); flex:1; }
.topbar-breadcrumb a { color:var(--text-muted); transition:color var(--t); }
.topbar-breadcrumb a:hover { color:var(--text); }
.topbar-breadcrumb-sep { color:var(--border-strong); font-size:0.6875rem; }
.topbar-breadcrumb-current { color:var(--text); font-weight:500; }
.topbar-actions { display:flex; align-items:center; gap:8px; }

/* Page header */
.page-header {
  padding:24px 24px 18px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  display:flex; align-items:flex-start; justify-content:space-between; gap:16px;
}
.page-title  { font-size:1.25rem; font-weight:800; color:var(--text); letter-spacing:-.5px; line-height:1.25; }
.page-subtitle { font-size:0.8125rem; color:var(--text-muted); margin-top:3px; font-weight:400; }
.page-body   { padding:24px; flex:1; }

/* ─────────────────────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────────────────────── */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding:0 1rem; height:2.25rem;
  border-radius:var(--radius-sm);
  font-size:0.8125rem; font-weight:600; font-family:var(--font-sans);
  line-height:1;
  cursor:pointer; border:1.5px solid transparent;
  transition:all var(--t);
  white-space:nowrap; text-decoration:none;
  position:relative; overflow:hidden;
  flex-shrink:0;
  user-select:none; outline:none; letter-spacing:.01em;
}
.btn:active { transform:translateY(1px); }
.btn svg { width:15px; height:15px; flex-shrink:0; }

.btn-ripple {
  position:absolute; border-radius:50%; background:rgba(255,255,255,.28);
  transform:scale(0); pointer-events:none;
  width:100px; height:100px; margin:-50px;
  animation:ripplePop .55s ease-out forwards;
}

.btn-primary {
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-dark) 100%);
  color:#fff; border-color:var(--accent-dark);
  box-shadow:0 1px 3px rgba(var(--accent-rgb),.28);
}
.btn-primary:hover {
  background:linear-gradient(135deg,var(--accent-dark) 0%,var(--accent-deeper) 100%);
  box-shadow:var(--shadow-accent); transform:translateY(-1px); color:#fff;
}
.btn-primary:active { transform:translateY(0); box-shadow:none; }

.btn-secondary {
  background:var(--surface); color:var(--text-soft);
  border-color:var(--border); box-shadow:var(--shadow-xs);
}
.btn-secondary:hover { background:var(--surface-2); border-color:var(--border-strong); color:var(--text); box-shadow:var(--shadow-sm); transform:translateY(-1px); }

.btn-ghost { background:transparent; color:var(--text-muted); border-color:transparent; }
.btn-ghost:hover { background:var(--surface-3); color:var(--text); }

.btn-danger {
  background:linear-gradient(135deg,#ef4444 0%,#dc2626 100%); color:#fff;
  border-color:#dc2626; box-shadow:0 1px 3px rgba(239,68,68,.28);
}
.btn-danger:hover { background:linear-gradient(135deg,#dc2626 0%,#b91c1c 100%); box-shadow:0 4px 14px rgba(239,68,68,.35); transform:translateY(-1px); color:#fff; }

.btn-outline { background:transparent; color:var(--accent); border-color:var(--accent); }
.btn-outline:hover { background:var(--accent-glow); color:var(--accent-dark); }

.btn-warning {
  background:linear-gradient(135deg,#f59e0b 0%,#d97706 100%); color:#fff;
  border-color:#d97706;
}
.btn-warning:hover { background:linear-gradient(135deg,#d97706 0%,#b45309 100%); color:#fff; transform:translateY(-1px); }

.btn-sm  { height:1.875rem; padding:0 .75rem; font-size:0.75rem; border-radius:5px; gap:5px; }
.btn-sm svg { width:13px; height:13px; }
.btn-lg  { height:2.75rem; padding:0 1.25rem; font-size:0.875rem; border-radius:var(--radius); }
.btn-xl  { height:3.25rem; padding:0 1.75rem; font-size:0.9375rem; border-radius:var(--radius-lg); }
.btn-block { width:100%; justify-content:center; }
.btn-icon  { width:2.25rem; padding:0; justify-content:center; }
.btn-icon.btn-sm { width:1.875rem; }
.btn-icon.btn-lg { width:2.75rem; }

.btn:disabled,.btn[disabled] { opacity:.42; cursor:not-allowed; transform:none !important; box-shadow:none !important; }

/* ─────────────────────────────────────────────────────────────
   CARDS
───────────────────────────────────────────────────────────── */
.card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm);
  transition:box-shadow var(--t),border-color var(--t),transform var(--t);
  overflow:hidden;
}
.card:hover { box-shadow:var(--shadow); }

.card-header {
  padding:14px 18px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:var(--surface);
}
.card-title  { font-size:0.875rem; font-weight:700; color:var(--text); letter-spacing:-.2px; display:flex; align-items:center; gap:8px; }
.card-body   { padding:18px; }
.card-footer {
  padding:12px 18px; border-top:1px solid var(--border);
  background:var(--surface-2);
  display:flex; align-items:center; justify-content:space-between; gap:12px;
}
.card-glass { background:var(--surface-overlay); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); }
.card-accent { border-top:3px solid var(--accent); }

/* ─────────────────────────────────────────────────────────────
   STATS / KPI
───────────────────────────────────────────────────────────── */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:16px; margin-bottom:24px; }

.stat-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:18px;
  position:relative; overflow:hidden;
  box-shadow:var(--shadow-sm);
  transition:transform var(--t-spring),box-shadow var(--t);
  animation:cardEntry .5s var(--t-expo) both;
}
.stat-card:nth-child(1){animation-delay:.05s}
.stat-card:nth-child(2){animation-delay:.10s}
.stat-card:nth-child(3){animation-delay:.15s}
.stat-card:nth-child(4){animation-delay:.20s}
.stat-card:nth-child(5){animation-delay:.25s}
.stat-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-lg); }

.stat-card::after {
  content:''; position:absolute; top:0; right:0;
  width:110px; height:110px;
  background:radial-gradient(circle,rgba(var(--accent-rgb),.055) 0%,transparent 70%);
  pointer-events:none;
}

.stat-icon {
  width:38px; height:38px; border-radius:var(--radius);
  background:var(--accent-light); color:var(--accent);
  display:flex; align-items:center; justify-content:center; margin-bottom:12px;
}
.stat-icon svg { width:19px; height:19px; }

.stat-value   { font-size:1.75rem; font-weight:800; color:var(--text); letter-spacing:-1px; line-height:1.1; font-variant-numeric:tabular-nums; }
.stat-label   { font-size:0.75rem; color:var(--text-muted); font-weight:500; margin-top:4px; letter-spacing:.1px; }
.stat-trend   { display:inline-flex; align-items:center; gap:3px; font-size:0.6875rem; font-weight:700; margin-top:8px; padding:2px 7px; border-radius:var(--radius-pill); }
.stat-trend.up   { background:rgba(34,197,94,.11);  color:#16a34a; }
.stat-trend.down { background:rgba(239,68,68,.11);   color:#dc2626; }
.stat-trend.flat { background:var(--surface-3);       color:var(--text-muted); }

/* ─────────────────────────────────────────────────────────────
   FORMS
───────────────────────────────────────────────────────────── */
.form-group { margin-bottom:18px; }

.form-label {
  display:block; font-size:0.7812rem; font-weight:600;
  color:var(--text-soft); margin-bottom:6px; letter-spacing:.1px;
}
.form-label .required { color:#ef4444; margin-left:3px; }

.form-control,.form-select,
input[type="text"],input[type="email"],input[type="password"],
input[type="number"],input[type="url"],input[type="search"],
textarea,select {
  width:100%; padding:0 .75rem; height:2.375rem;
  font-size:0.8438rem; font-family:var(--font-sans);
  background-color:var(--surface); color:var(--text);
  border:1.5px solid var(--border); border-radius:var(--radius-sm);
  transition:border-color var(--t),box-shadow var(--t),background var(--t);
  outline:none; -webkit-appearance:none;
}
textarea.form-control,textarea { height:auto; min-height:88px; padding:10px 12px; resize:vertical; line-height:1.6; }

.form-control:hover,.form-select:hover { border-color:var(--border-strong); }
.form-control:focus,.form-select:focus,input:focus,textarea:focus,select:focus {
  border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-glow); background-color:var(--surface);
}
.form-control::placeholder { color:var(--text-faint); }

.form-select,select {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a7898' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 11px center; padding-right:36px; cursor:pointer;
}

.form-hint  { font-size:0.7188rem; color:var(--text-muted); margin-top:5px; line-height:1.5; }
.form-error { font-size:0.7188rem; color:#ef4444; margin-top:5px; display:flex; align-items:center; gap:4px; }

/* Input group */
.input-group { display:flex; align-items:stretch; }
.input-group .form-control { border-radius:0; }
.input-group .form-control:first-child { border-radius:var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .form-control:last-child  { border-radius:0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-text {
  padding:0 12px; background:var(--surface-2); border:1.5px solid var(--border);
  color:var(--text-muted); font-size:0.8125rem; display:flex; align-items:center; white-space:nowrap;
}
.input-group-text:first-child { border-right:none; border-radius:var(--radius-sm) 0 0 var(--radius-sm); }
.input-group-text:last-child  { border-left:none;  border-radius:0 var(--radius-sm) var(--radius-sm) 0; }

input[type="checkbox"],input[type="radio"] { width:16px; height:16px; accent-color:var(--accent); cursor:pointer; border-radius:3px; }

/* Toggle */
.toggle-wrap  { display:flex; align-items:center; gap:10px; cursor:pointer; user-select:none; }
.toggle       { position:relative; width:40px; height:22px; flex-shrink:0; }
.toggle input { opacity:0; width:0; height:0; position:absolute; }
.toggle-slider {
  position:absolute; inset:0;
  background:var(--border-strong); border-radius:var(--radius-pill);
  transition:background var(--t),box-shadow var(--t); cursor:pointer;
}
.toggle-slider::before {
  content:''; position:absolute; left:3px; top:50%; transform:translateY(-50%);
  width:16px; height:16px; background:#fff; border-radius:50%;
  transition:transform var(--t-spring),box-shadow var(--t);
  box-shadow:0 1px 3px rgba(0,0,0,.2);
}
.toggle input:checked + .toggle-slider { background:var(--accent); box-shadow:0 0 0 3px var(--accent-glow); }
.toggle input:checked + .toggle-slider::before { transform:translateY(-50%) translateX(18px); }
.toggle-label { font-size:0.8125rem; color:var(--text-soft); font-weight:500; }

/* ─────────────────────────────────────────────────────────────
   TABLES
───────────────────────────────────────────────────────────── */
.table-wrap {
  width:100%; overflow-x:auto;
  border-radius:var(--radius-lg); border:1px solid var(--border);
  background:var(--surface); box-shadow:var(--shadow-sm);
}
table { width:100%; border-collapse:collapse; font-size:0.8125rem; }

thead {
  background:var(--surface-2); border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:2;
}
thead th {
  padding:9px 15px; text-align:left;
  font-size:0.6875rem; font-weight:700; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:.7px; white-space:nowrap;
}

tbody tr { border-bottom:1px solid var(--border); transition:background var(--t); animation:fadeIn .3s ease both; }
tbody tr:last-child { border-bottom:none; }
tbody tr:hover { background:var(--surface-2); }

tbody td { padding:11px 15px; color:var(--text-soft); vertical-align:middle; line-height:1.5; }
tbody td:first-child { color:var(--text); font-weight:500; }

th[data-sort] { cursor:pointer; user-select:none; }
th[data-sort]:hover { color:var(--text); }

/* ─────────────────────────────────────────────────────────────
   BADGES
───────────────────────────────────────────────────────────── */
.badge {
  display:inline-flex; align-items:center; gap:4px;
  padding:3px 9px; border-radius:var(--radius-pill);
  font-size:0.6875rem; font-weight:700; letter-spacing:.15px; white-space:nowrap; line-height:1.5;
}
.badge svg { width:10px; height:10px; }
.badge-dot::before { content:''; width:5px; height:5px; border-radius:50%; background:currentColor; flex-shrink:0; }

.badge-success { background:rgba(34,197,94,.11);  color:#16a34a; }
.badge-warning { background:rgba(245,158,11,.11);  color:#b45309; }
.badge-danger  { background:rgba(239,68,68,.11);   color:#dc2626; }
.badge-info    { background:rgba(14,165,233,.11);   color:#0369a1; }
.badge-purple  { background:rgba(139,92,246,.11);   color:#7c3aed; }
.badge-neutral { background:var(--surface-3);        color:var(--text-muted); }
.badge-accent  { background:var(--accent-glow);      color:var(--accent-dark); }
.badge-primary { background:var(--accent);           color:#fff; }

.status-badge { display:inline-flex; align-items:center; gap:6px; padding:4px 12px; border-radius:var(--radius-pill); font-size:0.75rem; font-weight:600; }
.status-badge.published { background:rgba(34,197,94,.11);  color:#15803d; }
.status-badge.draft     { background:var(--surface-3);      color:var(--text-muted); }
.status-badge.pending   { background:rgba(245,158,11,.11);  color:#92400e; }
.status-badge.error     { background:rgba(239,68,68,.11);   color:#dc2626; }

/* ─────────────────────────────────────────────────────────────
   MODAL
───────────────────────────────────────────────────────────── */
.modal-backdrop {
  position:fixed; inset:0;
  background:rgba(8,14,26,.65);
  backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  z-index:900; display:flex; align-items:center; justify-content:center;
  padding:16px; animation:fadeIn .22s ease both;
}
.modal {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-xl); box-shadow:var(--shadow-xl);
  width:100%; max-width:520px; max-height:90vh; overflow-y:auto;
  animation:scaleInSpring .38s cubic-bezier(.34,1.56,.64,1) both; position:relative;
}
.modal-lg { max-width:720px; }
.modal-xl { max-width:960px; }
.modal-sm { max-width:400px; }

.modal-header {
  padding:20px 24px 16px; border-bottom:1px solid var(--border);
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
}
.modal-title    { font-size:1rem; font-weight:800; color:var(--text); letter-spacing:-.35px; }
.modal-subtitle { font-size:0.7812rem; color:var(--text-muted); margin-top:3px; }
.modal-close {
  width:28px; height:28px; border-radius:var(--radius-sm);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; background:transparent; border:none;
  color:var(--text-muted); transition:background var(--t),color var(--t); flex-shrink:0; margin-top:-2px;
}
.modal-close:hover { background:var(--surface-3); color:var(--text); }
.modal-body   { padding:18px 24px; }
.modal-footer {
  padding:14px 24px; border-top:1px solid var(--border);
  background:var(--surface-2); display:flex; align-items:center; justify-content:flex-end; gap:8px;
  border-radius:0 0 var(--radius-xl) var(--radius-xl);
}

/* ─────────────────────────────────────────────────────────────
   TOAST
───────────────────────────────────────────────────────────── */
#toast-container {
  position:fixed; bottom:22px; right:22px; z-index:9999;
  display:flex; flex-direction:column-reverse; gap:9px; pointer-events:none;
}
.toast {
  display:flex; align-items:flex-start; gap:10px;
  padding:11px 14px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-lg);
  min-width:270px; max-width:370px; pointer-events:all;
  animation:slideInRight .38s cubic-bezier(.34,1.56,.64,1) both;
  position:relative; overflow:hidden;
}
.toast::before { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; border-radius:3px 0 0 3px; }
.toast-success::before { background:#22c55e; }
.toast-error::before   { background:#ef4444; }
.toast-warning::before { background:#f59e0b; }
.toast-info::before    { background:var(--accent); }

.toast-icon { width:17px; height:17px; flex-shrink:0; margin-top:1px; }
.toast-success .toast-icon { color:#22c55e; }
.toast-error .toast-icon   { color:#ef4444; }
.toast-warning .toast-icon { color:#f59e0b; }
.toast-info .toast-icon    { color:var(--accent); }

.toast-content { flex:1; }
.toast-title   { font-size:0.8125rem; font-weight:700; color:var(--text); line-height:1.4; }
.toast-message { font-size:0.75rem; color:var(--text-muted); margin-top:2px; line-height:1.5; }
.toast-close { width:20px; height:20px; background:none; border:none; color:var(--text-faint); cursor:pointer; display:flex; align-items:center; justify-content:center; border-radius:4px; transition:background var(--t),color var(--t); flex-shrink:0; }
.toast-close:hover { background:var(--surface-3); color:var(--text); }
.toast.hiding { animation:slideInRight .22s cubic-bezier(.4,0,.2,1) reverse both; }

/* ─────────────────────────────────────────────────────────────
   DROPDOWN
───────────────────────────────────────────────────────────── */
.dropdown { position:relative; display:inline-block; }
.dropdown-menu {
  position:absolute; top:calc(100% + 6px); right:0;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-lg);
  min-width:175px; padding:4px; z-index:500;
  animation:scaleIn .16s cubic-bezier(.34,1.56,.64,1) both;
  transform-origin:top right;
}
.dropdown-item {
  display:flex; align-items:center; gap:8px;
  padding:7px 9px; border-radius:var(--radius-sm);
  font-size:0.8125rem; color:var(--text-soft); cursor:pointer;
  transition:background var(--t),color var(--t); text-decoration:none;
  border:none; background:none; width:100%; font-family:var(--font-sans);
}
.dropdown-item:hover { background:var(--surface-2); color:var(--text); }
.dropdown-item.danger { color:#ef4444; }
.dropdown-item.danger:hover { background:rgba(239,68,68,.08); }
.dropdown-item svg { width:14px; height:14px; }
.dropdown-divider { height:1px; background:var(--border); margin:4px 0; }
.dropdown-label   { padding:4px 9px 2px; font-size:0.625rem; font-weight:700; text-transform:uppercase; letter-spacing:.7px; color:var(--text-faint); }

/* ─────────────────────────────────────────────────────────────
   TABS
───────────────────────────────────────────────────────────── */
.tabs { display:flex; align-items:center; gap:1px; border-bottom:1px solid var(--border); margin-bottom:20px; }
.tab {
  display:flex; align-items:center; gap:6px;
  padding:8px 13px; font-size:0.8125rem; font-weight:500; color:var(--text-muted);
  cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px;
  transition:color var(--t),border-color var(--t),background var(--t);
  text-decoration:none; border-radius:var(--radius-sm) var(--radius-sm) 0 0; white-space:nowrap;
}
.tab:hover { color:var(--text); background:var(--surface-2); }
.tab.active { color:var(--accent); border-bottom-color:var(--accent); font-weight:700; }
.tab-count { background:var(--surface-3); color:var(--text-muted); font-size:0.625rem; padding:1px 6px; border-radius:var(--radius-pill); font-weight:700; }
.tab.active .tab-count { background:var(--accent-glow); color:var(--accent-dark); }

.tabs-segmented { display:inline-flex; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); padding:3px; gap:2px; }
.tabs-segmented .tab { border:none; border-radius:5px; padding:5px 13px; margin:0; font-size:0.7812rem; }
.tabs-segmented .tab.active { background:var(--surface); color:var(--text); box-shadow:var(--shadow-xs); border-bottom-color:transparent; }

/* ─────────────────────────────────────────────────────────────
   ALERTS
───────────────────────────────────────────────────────────── */
.alert { display:flex; gap:11px; padding:13px 15px; border-radius:var(--radius-lg); border:1px solid transparent; font-size:0.8125rem; line-height:1.6; animation:fadeInDown .3s ease both; }
.alert svg { width:17px; height:17px; flex-shrink:0; margin-top:1px; }
.alert-title { font-weight:700; margin-bottom:2px; }
.alert-success { background:rgba(34,197,94,.07);  border-color:rgba(34,197,94,.18);  color:#15803d; }
.alert-warning { background:rgba(245,158,11,.07);  border-color:rgba(245,158,11,.18); color:#92400e; }
.alert-danger, .alert-error  { background:rgba(239,68,68,.07);   border-color:rgba(239,68,68,.18);  color:#b91c1c; }
.alert-info    { background:var(--accent-glow);      border-color:var(--accent-ring);   color:var(--accent-dark); }
.alert-neutral { background:var(--surface-2);        border-color:var(--border);        color:var(--text-soft); }

/* ─────────────────────────────────────────────────────────────
   PROGRESS
───────────────────────────────────────────────────────────── */
.progress { height:6px; background:var(--surface-3); border-radius:var(--radius-pill); overflow:hidden; }
.progress-bar { height:100%; background:linear-gradient(90deg,var(--accent) 0%,var(--accent-dark) 100%); border-radius:var(--radius-pill); transition:width .6s var(--t-expo); }
.progress-thin  { height:3px; }
.progress-thick { height:10px; }

/* ─────────────────────────────────────────────────────────────
   LOADING
───────────────────────────────────────────────────────────── */
.skeleton {
  background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-3) 50%,var(--surface-2) 75%);
  background-size:400px 100%;
  animation:shimmer 1.5s infinite ease-in-out;
  border-radius:var(--radius-sm);
}
.spinner { width:20px; height:20px; border:2px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:spin .65s linear infinite; display:inline-block; }
.spinner-sm { width:14px; height:14px; border-width:1.5px; }
.spinner-lg { width:32px; height:32px; border-width:3px; }

/* ─────────────────────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────────────────────── */
.empty-state { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:60px 24px; text-align:center; gap:14px; }
.empty-icon { width:60px; height:60px; border-radius:var(--radius-xl); background:var(--surface-2); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--text-faint); }
.empty-icon svg { width:26px; height:26px; }
.empty-title       { font-size:1rem; font-weight:800; color:var(--text); letter-spacing:-.35px; }
.empty-description { font-size:0.8125rem; color:var(--text-muted); max-width:300px; line-height:1.6; }

/* ─────────────────────────────────────────────────────────────
   SEARCH
───────────────────────────────────────────────────────────── */
.search-wrap { position:relative; display:inline-flex; align-items:center; }
.search-wrap svg { position:absolute; left:10px; color:var(--text-faint); width:14px; height:14px; pointer-events:none; }
.search-wrap input { padding-left:32px; width:230px; transition:width var(--t-expo),border-color var(--t),box-shadow var(--t); }
.search-wrap input:focus { width:290px; }

/* ─────────────────────────────────────────────────────────────
   PAGINATION
───────────────────────────────────────────────────────────── */
.pagination { display:flex; align-items:center; gap:3px; }
.page-item { display:flex; align-items:center; justify-content:center; width:31px; height:31px; border-radius:var(--radius-sm); font-size:0.8125rem; font-weight:500; color:var(--text-muted); cursor:pointer; text-decoration:none; transition:background var(--t),color var(--t); border:1px solid transparent; }
.page-item:hover { background:var(--surface-2); color:var(--text); }
.page-item.active { background:var(--accent); color:#fff; border-color:var(--accent-dark); font-weight:700; }
.page-item.disabled { opacity:.38; cursor:not-allowed; }

/* ─────────────────────────────────────────────────────────────
   AVATAR
───────────────────────────────────────────────────────────── */
.avatar { border-radius:var(--radius-pill); display:inline-flex; align-items:center; justify-content:center; font-weight:800; background:var(--accent-glow); color:var(--accent-dark); flex-shrink:0; overflow:hidden; }
.avatar-sm { width:26px; height:26px; font-size:0.625rem; }
.avatar-md { width:36px; height:36px; font-size:0.8125rem; }
.avatar-lg { width:48px; height:48px; font-size:1rem; }
.avatar-xl { width:64px; height:64px; font-size:1.25rem; }
.avatar img { width:100%; height:100%; object-fit:cover; }

.avatar-stack { display:flex; }
.avatar-stack .avatar { border:2px solid var(--surface); margin-left:-8px; transition:transform var(--t); }
.avatar-stack .avatar:first-child { margin-left:0; }
.avatar-stack .avatar:hover { transform:translateY(-3px); z-index:10; }

/* ─────────────────────────────────────────────────────────────
   DIVIDER
───────────────────────────────────────────────────────────── */
.divider { display:flex; align-items:center; gap:12px; color:var(--text-faint); font-size:0.75rem; margin:14px 0; }
.divider::before,.divider::after { content:''; flex:1; height:1px; background:var(--border); }

/* ─────────────────────────────────────────────────────────────
   CODE
───────────────────────────────────────────────────────────── */
code,.code { font-family:var(--font-mono); font-size:0.75rem; background:var(--surface-2); color:var(--accent); border:1px solid var(--border); border-radius:4px; padding:1px 6px; }
.code-block { background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-lg); padding:16px; overflow-x:auto; font-family:var(--font-mono); font-size:0.7812rem; line-height:1.7; color:var(--text-soft); }

/* ─────────────────────────────────────────────────────────────
   STEPS / WIZARD
───────────────────────────────────────────────────────────── */
.steps { display:flex; align-items:center; margin-bottom:28px; overflow-x:auto; }
.step { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.step-number { width:27px; height:27px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:0.75rem; font-weight:700; background:var(--surface-3); border:1.5px solid var(--border); color:var(--text-muted); transition:all var(--t); }
.step-label  { font-size:0.7812rem; font-weight:500; color:var(--text-muted); white-space:nowrap; transition:color var(--t); }
.step-connector { height:1px; background:var(--border); flex:1; min-width:20px; margin:0 6px; }
.step.active .step-number { background:var(--accent); border-color:var(--accent); color:#fff; box-shadow:0 0 0 4px var(--accent-glow); }
.step.active .step-label  { color:var(--accent); font-weight:700; }
.step.done .step-number   { background:var(--accent-light); border-color:var(--accent); color:var(--accent-dark); }
.step.done .step-label    { color:var(--text-soft); }

/* ─────────────────────────────────────────────────────────────
   SETTINGS / PERSONALIZATION
───────────────────────────────────────────────────────────── */
.settings-section { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; margin-bottom:18px; }
.settings-section-header { padding:14px 18px; border-bottom:1px solid var(--border); background:var(--surface-2); display:flex; align-items:center; gap:12px; }
.settings-section-icon  { width:32px; height:32px; border-radius:var(--radius-sm); background:var(--accent-glow); color:var(--accent); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.settings-section-icon svg { width:15px; height:15px; }
.settings-section-title { font-size:0.8438rem; font-weight:700; color:var(--text); }
.settings-section-sub   { font-size:0.75rem; color:var(--text-muted); margin-top:1px; }
.settings-row { padding:14px 18px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:16px; }
.settings-row:last-child { border-bottom:none; }
.settings-row-label { font-size:0.8125rem; font-weight:500; color:var(--text-soft); }
.settings-row-desc  { font-size:0.75rem; color:var(--text-muted); margin-top:2px; }

/* Theme swatches */
.theme-swatches { display:flex; gap:10px; flex-wrap:wrap; }
.theme-swatch {
  display:flex; flex-direction:column; align-items:center; gap:6px;
  cursor:pointer; border-radius:var(--radius-lg); padding:8px 10px;
  border:2px solid transparent; transition:border-color var(--t),transform var(--t-spring);
}
.theme-swatch:hover { transform:translateY(-2px); }
.theme-swatch.active { border-color:var(--accent); background:var(--accent-glow); }
.theme-swatch-preview {
  width:60px; height:42px; border-radius:var(--radius); overflow:hidden;
  display:grid; grid-template-columns:13px 1fr;
  border:1px solid var(--border); box-shadow:var(--shadow-sm);
}
.ts-sidebar { background:#0b1120; }
.ts-pearl   { background:#f2f4f9; }
.ts-dark    { background:#070c18; }
.ts-dusk    { background:#0e0907; }
.ts-arctic  { background:#ffffff; }
.theme-swatch-label { font-size:0.6875rem; font-weight:600; color:var(--text-muted); }
.theme-swatch.active .theme-swatch-label { color:var(--accent); }

/* Accent colour picker */
.accent-grid { display:flex; gap:8px; flex-wrap:wrap; }
.accent-dot {
  width:28px; height:28px; border-radius:50%;
  cursor:pointer; border:2.5px solid transparent;
  transition:transform var(--t-spring),border-color var(--t);
  position:relative; display:flex; align-items:center; justify-content:center;
}
.accent-dot:hover { transform:scale(1.18); }
.accent-dot.active { border-color:rgba(255,255,255,.7); box-shadow:0 0 0 2px var(--text); }
.accent-dot::after { content:'✓'; font-size:0.75rem; color:#fff; font-weight:700; opacity:0; transition:opacity var(--t); }
.accent-dot.active::after { opacity:1; }

/* Density */
.density-options { display:flex; gap:8px; }
.density-option { flex:1; border:1.5px solid var(--border); border-radius:var(--radius); padding:10px 8px; cursor:pointer; text-align:center; transition:all var(--t); background:var(--surface); }
.density-option:hover  { border-color:var(--accent); }
.density-option.active { border-color:var(--accent); background:var(--accent-glow); }
.density-icon  { height:22px; display:flex; flex-direction:column; justify-content:center; gap:3px; margin:0 auto 6px; width:32px; }
.density-icon span { height:2px; background:var(--text-muted); border-radius:1px; display:block; }
.density-option.active .density-icon span { background:var(--accent); }
.density-label { font-size:0.6875rem; font-weight:700; color:var(--text-muted); }
.density-option.active .density-label { color:var(--accent); }

/* Font slider */
.font-slider-wrap { display:flex; align-items:center; gap:12px; width:240px; }
.font-slider-wrap input[type="range"] {
  flex:1; height:4px; -webkit-appearance:none;
  background:linear-gradient(to right,var(--accent) var(--val,50%),var(--surface-3) var(--val,50%));
  border-radius:var(--radius-pill); outline:none; border:none; cursor:pointer; padding:0; width:auto;
}
.font-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance:none; width:18px; height:18px; border-radius:50%;
  background:var(--surface); border:2px solid var(--accent);
  box-shadow:0 1px 4px rgba(var(--accent-rgb),.3); cursor:pointer; transition:transform var(--t-spring);
}
.font-slider-wrap input[type="range"]:hover::-webkit-slider-thumb { transform:scale(1.22); }
.font-size-label { font-size:0.75rem; font-weight:700; color:var(--text-muted); min-width:28px; text-align:center; }

/* Sidebar toggle */
.sidebar-toggle-btn { display:flex; align-items:center; gap:9px; padding:7px 9px; border-radius:var(--radius-sm); color:var(--sidebar-text); cursor:pointer; transition:background var(--t),color var(--t); background:none; border:none; width:100%; font-family:var(--font-sans); font-size:13px; font-weight:500; text-align:left; }
.sidebar-toggle-btn:hover { background:var(--sidebar-hover-bg); color:var(--sidebar-text-hover); }
.sidebar-toggle-btn svg { width:16px; height:16px; color:var(--sidebar-icon); transition:color var(--t),transform var(--t-spring); }
.sidebar-toggle-btn:hover svg { color:var(--accent); }
.sidebar.compact .sidebar-toggle-btn svg { transform:rotate(180deg); }

/* ─────────────────────────────────────────────────────────────
   CELEBRATION ANIMATIONS
───────────────────────────────────────────────────────────── */
#publish-celebrate {
  position:fixed; inset:0; pointer-events:none; z-index:9000;
  display:flex; align-items:center; justify-content:center;
}
.confetti-particle {
  position:absolute; width:8px; height:8px; border-radius:2px;
  animation:confettiFall 1.3s ease-in forwards; pointer-events:none;
}
.celebrate-ring {
  width:140px; height:140px; border-radius:50%;
  border:3px solid var(--accent); position:absolute;
  animation:celebRing .9s ease-out forwards;
}
.check-anim { display:inline-flex; align-items:center; justify-content:center; }
.check-anim svg circle { stroke-dasharray:170; stroke-dashoffset:170; animation:checkCircle .65s ease forwards; }
.check-anim svg path   { stroke-dasharray:60; stroke-dashoffset:60; animation:checkDraw .4s .5s ease forwards; }

#theme-transition-overlay { position:fixed; inset:0; pointer-events:none; z-index:8000; clip-path:circle(0% at 50% 0%); }
#theme-transition-overlay.animating { animation:themeWipe .55s cubic-bezier(.4,0,.2,1) both; }

/* ─────────────────────────────────────────────────────────────
   DENSITY MODES
───────────────────────────────────────────────────────────── */
[data-density="compact"]     { --html-font:14px; }
[data-density="comfortable"] { --html-font:16px; }
[data-density="compact"]     .sidebar-nav-item  { height:30px; }
[data-density="compact"]     table tbody td     { padding:8px 13px; }
[data-density="compact"]     .card-body         { padding:12px; }
[data-density="comfortable"] .sidebar-nav-item  { height:40px; }
[data-density="comfortable"] table tbody td     { padding:14px 17px; }

/* ═══════════════════════════════════════════════════════════════════════════
   PUBLIC PASSPORT
═══════════════════════════════════════════════════════════════════════════ */
.pub-body { background:var(--bg); min-height:100vh; font-family:var(--font-sans); }

/* Hero */
.pub-hero {
  background:linear-gradient(155deg,#08111e 0%,#0d1f3e 55%,#091525 100%);
  position:relative; overflow:hidden;
  padding:36px 24px 52px;
}
.pub-hero::before {
  content:''; position:absolute; top:-80px; right:-80px; width:380px; height:380px;
  background:radial-gradient(circle,rgba(var(--accent-rgb),.2) 0%,transparent 65%); pointer-events:none;
}
.pub-hero::after {
  content:''; position:absolute; bottom:-50px; left:-30px; width:260px; height:260px;
  background:radial-gradient(circle,rgba(var(--accent-rgb),.08) 0%,transparent 65%); pointer-events:none;
}

.pub-header-bar { display:flex; align-items:center; justify-content:space-between; max-width:920px; margin:0 auto; position:relative; z-index:1; }
.pub-brand { display:flex; align-items:center; gap:10px; }
.pub-brand-logo { height:30px; width:auto; max-width:140px; object-fit:contain; }
.pub-brand-name { font-size:0.9375rem; font-weight:800; color:#fff; letter-spacing:-.35px; }
.pub-badges { display:flex; align-items:center; gap:7px; }
.pub-badge-eu {
  display:inline-flex; align-items:center; gap:5px;
  padding:4px 10px; border-radius:var(--radius-pill);
  background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.18);
  color:rgba(255,255,255,.82); font-size:0.6875rem; font-weight:700; letter-spacing:.3px;
  backdrop-filter:blur(8px);
}

/* Identity block */
.pub-identity {
  max-width:920px; margin:34px auto 0;
  display:flex; align-items:flex-end; justify-content:space-between; gap:20px;
  position:relative; z-index:1;
}
.pub-product-info { flex:1; }
.pub-category { font-size:0.6875rem; font-weight:700; text-transform:uppercase; letter-spacing:1.1px; color:var(--accent); margin-bottom:8px; }
.pub-product-name { font-size:clamp(22px,4vw,32px); font-weight:900; color:#fff; letter-spacing:-1px; line-height:1.18; }
.pub-product-sub  { font-size:0.875rem; color:rgba(255,255,255,.55); margin-top:6px; }
.pub-po {
  display:inline-flex; align-items:center; gap:5px; margin-top:12px;
  padding:4px 12px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12);
  border-radius:var(--radius-pill); font-size:0.75rem; color:rgba(255,255,255,.6); font-family:var(--font-mono);
}

.pub-score-ring { flex-shrink:0; text-align:center; }
.pub-score-ring svg { display:block; }
.pub-score-value { font-size:1.75rem; font-weight:900; color:#fff; letter-spacing:-1px; line-height:1; }
.pub-score-label { font-size:0.625rem; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:rgba(255,255,255,.45); margin-top:4px; }

/* Nav strip */
.pub-nav-strip { background:rgba(255,255,255,.05); backdrop-filter:blur(12px); border-bottom:1px solid rgba(255,255,255,.1); position:sticky; top:0; z-index:50; }
.pub-nav-inner { max-width:920px; margin:0 auto; display:flex; align-items:center; overflow-x:auto; scrollbar-width:none; }
.pub-nav-inner::-webkit-scrollbar { display:none; }
.pub-nav-tab {
  display:flex; align-items:center; gap:7px; padding:14px 17px;
  font-size:0.8125rem; font-weight:500; color:rgba(255,255,255,.48);
  cursor:pointer; border-bottom:2px solid transparent;
  transition:color var(--t),border-color var(--t); text-decoration:none; flex-shrink:0;
}
.pub-nav-tab:hover { color:rgba(255,255,255,.82); }
.pub-nav-tab.active { color:var(--accent); border-bottom-color:var(--accent); font-weight:700; }
.pub-nav-tab svg { width:14px; height:14px; }

/* Content */
.pub-content { max-width:920px; margin:0 auto; padding:24px 16px; }
.pub-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-xl); overflow:hidden; margin-bottom:18px; box-shadow:var(--shadow-sm); transition:box-shadow var(--t); }
.pub-card:hover { box-shadow:var(--shadow); }
.pub-card-header { padding:14px 18px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:11px; background:var(--surface-2); }
.pub-card-icon  { width:34px; height:34px; border-radius:var(--radius); background:var(--accent-glow); color:var(--accent); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.pub-card-icon svg { width:17px; height:17px; }
.pub-card-title { font-size:0.875rem; font-weight:800; color:var(--text); letter-spacing:-.25px; }
.pub-card-body  { padding:18px; }

.pub-data-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(175px,1fr)); gap:16px; }
.pub-data-label { font-size:0.6562rem; font-weight:700; text-transform:uppercase; letter-spacing:.65px; color:var(--text-faint); margin-bottom:5px; }
.pub-data-value { font-size:0.875rem; font-weight:700; color:var(--text); line-height:1.4; }
.pub-data-sub   { font-size:0.7188rem; color:var(--text-muted); margin-top:2px; }

/* Language btn */
.pub-lang-btn {
  display:flex; align-items:center; gap:6px; padding:5px 12px;
  background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.16);
  border-radius:var(--radius-pill); font-size:0.75rem; font-weight:700;
  color:rgba(255,255,255,.82); cursor:pointer; transition:all var(--t); backdrop-filter:blur(8px);
}
.pub-lang-btn:hover { background:rgba(255,255,255,.2); }

/* ─────────────────────────────────────────────────────────────
   LEGACY / PAGE-SPECIFIC
───────────────────────────────────────────────────────────── */
/* Login */
.login-page { min-height:100vh; background:var(--bg); display:flex; align-items:center; justify-content:center; padding:16px; }
.login-card { width:100%; max-width:420px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-2xl); box-shadow:var(--shadow-xl); overflow:hidden; animation:scaleInSpring .48s cubic-bezier(.34,1.56,.64,1) both; }
.login-header { padding:36px 32px 24px; text-align:center; background:linear-gradient(155deg,#08111e 0%,#102040 100%); position:relative; overflow:hidden; }
.login-header::before { content:''; position:absolute; top:-50px; left:50%; transform:translateX(-50%); width:220px; height:220px; background:radial-gradient(circle,rgba(var(--accent-rgb),.22) 0%,transparent 65%); pointer-events:none; }
.login-logo { width:50px; height:50px; margin:0 auto 16px; border-radius:var(--radius-lg); background:linear-gradient(135deg,var(--accent) 0%,var(--accent-dark) 100%); display:flex; align-items:center; justify-content:center; box-shadow:0 4px 22px rgba(var(--accent-rgb),.55); position:relative; z-index:1; }
.login-logo svg { width:24px; height:24px; color:#fff; }
.login-title { font-size:1.375rem; font-weight:900; color:#fff; letter-spacing:-.55px; position:relative; z-index:1; }
.login-sub   { font-size:0.8125rem; color:rgba(255,255,255,.48); margin-top:4px; position:relative; z-index:1; }
.login-body  { padding:24px 32px; }
.login-footer{ padding:14px 32px; background:var(--surface-2); border-top:1px solid var(--border); text-align:center; font-size:0.7188rem; color:var(--text-muted); }

/* Panels */
.panel { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; }
.panel-header { padding:13px 18px; border-bottom:1px solid var(--border); font-size:0.8438rem; font-weight:700; color:var(--text); display:flex; align-items:center; justify-content:space-between; gap:12px; }
.panel-body   { padding:18px; }

/* Action grid */
.action-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(155px,1fr)); gap:12px; }
.action-tile {
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:16px; cursor:pointer; text-decoration:none;
  transition:all var(--t-spring); display:flex; flex-direction:column; gap:12px; box-shadow:var(--shadow-xs);
}
.action-tile:hover { border-color:var(--accent); background:var(--accent-glow); transform:translateY(-3px); box-shadow:var(--shadow); }
.action-tile-icon { width:34px; height:34px; border-radius:var(--radius); background:var(--surface-2); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--text-muted); transition:all var(--t); }
.action-tile:hover .action-tile-icon { background:var(--accent); border-color:var(--accent); color:#fff; }
.action-tile-label { font-size:0.7812rem; font-weight:700; color:var(--text); }
.action-tile-sub   { font-size:0.6875rem; color:var(--text-muted); }

/* Filter bar */
.filter-bar { display:flex; align-items:center; gap:8px; padding:12px 16px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); margin-bottom:16px; flex-wrap:wrap; }
.filter-sep   { height:18px; width:1px; background:var(--border); margin:0 4px; }
.filter-label { font-size:0.75rem; font-weight:500; color:var(--text-muted); }

/* QR */
.qr-container { background:#fff; padding:12px; border-radius:var(--radius-lg); border:1px solid var(--border); display:inline-flex; align-items:center; justify-content:center; box-shadow:var(--shadow-sm); }

/* Tag */
.tag { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-pill); font-size:0.7188rem; color:var(--text-muted); font-weight:500; }
.tag-accent { background:var(--accent-glow); border-color:var(--accent-ring); color:var(--accent-dark); }

/* Color swatch */
.color-swatch { width:14px; height:14px; border-radius:3px; display:inline-block; border:1px solid rgba(0,0,0,.1); vertical-align:middle; }

/* ─────────────────────────────────────────────────────────────
   DARK MODE OVERRIDES
───────────────────────────────────────────────────────────── */
.theme-dark .form-control,.theme-dark .form-select,
.theme-dark input[type="text"],.theme-dark input[type="email"],
.theme-dark input[type="password"],.theme-dark input[type="number"],
.theme-dark input[type="url"],.theme-dark textarea,.theme-dark select {
  background-color:var(--surface-2); color:var(--text); border-color:var(--border);
}
.theme-dark .form-control:focus,.theme-dark input:focus,
.theme-dark textarea:focus,.theme-dark select:focus { background-color:var(--surface); border-color:var(--accent); }
.theme-dark .input-group-text { background:var(--surface-3); border-color:var(--border); color:var(--text-muted); }
.theme-dark table thead  { background:var(--surface-2); }
.theme-dark table tbody tr:hover { background:var(--surface-3); }

.theme-dusk .form-control,.theme-dusk .form-select,
.theme-dusk input[type="text"],.theme-dusk input[type="email"],
.theme-dusk input[type="password"],.theme-dusk textarea,.theme-dusk select {
  background-color:var(--surface-2); color:var(--text); border-color:var(--border);
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────────── */
@media (max-width:1024px) {
  .sidebar { transform:translateX(-100%); }
  .sidebar.open { transform:translateX(0); box-shadow:var(--shadow-xl); }
  .main-content { margin-left:0 !important; }
  .topbar { padding:0 16px; }
  .page-body { padding:16px; }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:640px) {
  .stats-grid   { grid-template-columns:1fr 1fr; }
  .pub-data-grid{ grid-template-columns:1fr 1fr; }
  .pub-identity { flex-direction:column; align-items:flex-start; }
  .pub-score-ring{ display:none; }
  .page-header  { flex-direction:column; gap:12px; }
  .tabs { overflow-x:auto; }
}

/* ─────────────────────────────────────────────────────────────
   PRINT
───────────────────────────────────────────────────────────── */
@media print {
  .sidebar,.topbar,.pub-nav-strip,.topbar-actions { display:none !important; }
  .main-content { margin:0 !important; }
  .pub-hero { background:none !important; color:#000 !important; padding:20px 0; }
  .card { box-shadow:none; border:1px solid #ccc; }
  *,-webkit-print-color-adjust:exact; print-color-adjust:exact;
}

/* ─────────────────────────────────────────────────────────────
   MOTION PREFERENCE
───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

/* ─────────────────────────────────────────────────────────────
   UTILITIES
───────────────────────────────────────────────────────────── */
.flex{display:flex}.flex-1{flex:1}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}
.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-5{gap:20px}.gap-6{gap:24px}
.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-5{margin-top:20px}.mt-6{margin-top:24px}
.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-5{margin-bottom:20px}.mb-6{margin-bottom:24px}.mb-8{margin-bottom:32px}
.mr-2{margin-right:8px}.ml-auto{margin-left:auto}.p-4{padding:16px}.p-5{padding:20px}.p-6{padding:24px}.w-full{width:100%}
.text-xs{font-size:0.6875rem}.text-sm{font-size:0.7812rem}.text-base{font-size:0.875rem}.text-lg{font-size:1rem}.text-xl{font-size:1.25rem}.text-2xl{font-size:1.5rem}
.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}
.text-center{text-align:center}.text-right{text-align:right}
.text-muted{color:var(--text-muted)}.text-accent{color:var(--accent)}.text-danger{color:#ef4444}.text-success{color:#22c55e}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rounded{border-radius:var(--radius)}.rounded-lg{border-radius:var(--radius-lg)}.rounded-full{border-radius:var(--radius-pill)}
.border{border:1px solid var(--border)}.shadow-sm{box-shadow:var(--shadow-sm)}.shadow{box-shadow:var(--shadow)}
.animate-in{animation:fadeInUp .4s var(--t-expo) both}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.delay-1{animation-delay:.05s}.delay-2{animation-delay:.10s}.delay-3{animation-delay:.15s}.delay-4{animation-delay:.20s}.delay-5{animation-delay:.25s}

/* ─────────────────────────────────────────────────────────────
   LEGACY ADMIN LAYOUT ALIASES (.sb-* → Gemstone equivalents)
   These bridge the old .sb-main / .with-sidebar class names
   used in admin PHP templates without a full HTML rewrite.
───────────────────────────────────────────────────────────── */

/* Body layout when sidebar is present */
body.with-sidebar { display:flex; min-height:100vh; }

/* .sb = old sidebar element — now rendered as .sidebar */
.sb {
  width:240px; min-width:240px;
  background:var(--sidebar-bg);
  display:flex; flex-direction:column;
  position:fixed; top:0; left:0;
  height:100vh; overflow-y:auto; overflow-x:hidden;
  z-index:200; border-right:1px solid var(--sidebar-border);
  transition:width var(--t-expo),min-width var(--t-expo),transform var(--t-expo);
}
.sb::before {
  content:''; position:absolute; top:0; left:0; right:0; height:260px;
  background:radial-gradient(ellipse at 50% 0%,rgba(var(--accent-rgb),.13) 0%,transparent 70%);
  pointer-events:none; z-index:0;
}
.sb > * { position:relative; z-index:1; }
body.sb-collapsed .sb { width:60px; min-width:60px; }

/* .sb-main = old main content wrapper */
.sb-main {
  flex:1; min-width:0;
  margin-left:240px;
  display:flex; flex-direction:column;
  min-height:100vh;
  background:var(--bg);
  transition:margin-left var(--t-expo),background var(--t-slow);
}
body.sb-collapsed .sb-main { margin-left:60px; }
.sb-main > main { flex:1; overflow-x:auto; }

/* Old header/footer inside sb */
.sb-header {
  display:flex; align-items:center; gap:8px;
  padding:16px; min-height:60px;
  border-bottom:1px solid var(--sidebar-border);
  flex-shrink:0;
}
.sb-logo-mark {
  width:30px; height:30px; border-radius:7px;
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-dark) 100%);
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:800; color:#fff; flex-shrink:0;
  box-shadow:0 2px 8px rgba(var(--accent-rgb),.4);
  transition:opacity var(--t-expo);
}
.sb-logo-text {
  font-size:13px; font-weight:700; color:#fff; white-space:nowrap;
  letter-spacing:-.3px; overflow:hidden; transition:opacity var(--t-expo);
}
body.sb-collapsed .sb-logo-text { opacity:0; width:0; overflow:hidden; }
body.sb-collapsed .sb-logo-mark { opacity:1; }

/* Toggle button */
.sb-toggle { background:none; border:none; cursor:pointer; padding:4px; margin-left:auto; color:rgba(255,255,255,.4); border-radius:4px; transition:color var(--t),background var(--t); display:flex; align-items:center; }
.sb-toggle:hover { color:rgba(255,255,255,.85); background:rgba(255,255,255,.07); }
.sb-toggle-icon { display:block; transition:opacity var(--t); }
.sb-toggle-collapse { }
.sb-toggle-expand   { display:none; }
body.sb-collapsed .sb-toggle-collapse { display:none; }
body.sb-collapsed .sb-toggle-expand   { display:block; }

/* Nav */
.sb-nav { padding:8px; flex:1; display:flex; flex-direction:column; gap:1px; overflow-y:auto; }
.sb-nav::-webkit-scrollbar { width:3px; }
.sb-nav::-webkit-scrollbar-thumb { background:rgba(255,255,255,.08); border-radius:3px; }

.sb-section-label {
  font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.9px;
  color:rgba(255,255,255,.22); padding:10px 8px 3px; margin-top:4px;
  transition:opacity var(--t-expo);
}
body.sb-collapsed .sb-section-label { opacity:0; }

.sb-link {
  display:flex; align-items:center; gap:9px; padding:0 9px; height:35px;
  border-radius:var(--radius-sm); font-size:13px; font-weight:500;
  color:rgba(255,255,255,.50); cursor:pointer; text-decoration:none;
  transition:background var(--t),color var(--t); position:relative;
  white-space:nowrap; overflow:hidden; user-select:none;
}
.sb-link:hover { background:rgba(255,255,255,.05); color:rgba(255,255,255,.88); }
.sb-active {
  background:var(--sidebar-active-bg) !important;
  color:#fff !important;
}
.sb-active::before {
  content:''; position:absolute; left:0; top:22%; bottom:22%;
  width:3px; background:var(--accent); border-radius:0 2px 2px 0;
  animation:indicatorIn var(--t-spring) both;
}

.sb-icon {
  width:16px; height:16px; flex-shrink:0; display:flex; align-items:center; justify-content:center;
  color:rgba(255,255,255,.35); transition:color var(--t);
}
.sb-link:hover .sb-icon,.sb-active .sb-icon { color:var(--accent); }
.sb-icon svg { width:16px; height:16px; }

.sb-label { flex:1; transition:opacity var(--t-expo),width var(--t-expo); }
body.sb-collapsed .sb-label { opacity:0; width:0; overflow:hidden; }
body.sb-collapsed .sb-link { justify-content:center; padding:0 18px; gap:0; }

/* Footer */
.sb-footer {
  padding:8px; border-top:1px solid var(--sidebar-border);
  display:flex; flex-direction:column; gap:2px;
}
.sb-user {
  display:flex; align-items:center; gap:9px; padding:7px 9px;
  border-radius:var(--radius-sm); cursor:pointer; transition:background var(--t);
  text-decoration:none;
}
.sb-user:hover { background:rgba(255,255,255,.05); }
.sb-avatar {
  width:26px; height:26px; border-radius:50%;
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-dark) 100%);
  display:flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:800; color:#fff; flex-shrink:0;
  box-shadow:0 1px 4px rgba(var(--accent-rgb),.4);
}
.sb-user-info { flex:1; overflow:hidden; transition:opacity var(--t-expo); }
body.sb-collapsed .sb-user-info { opacity:0; width:0; }
.sb-user-name { font-size:12px; font-weight:600; color:rgba(255,255,255,.88); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.3; }
.sb-user-role { font-size:10px; color:rgba(255,255,255,.42); line-height:1.3; }

.sb-signout {
  display:flex; align-items:center; gap:9px; padding:7px 9px;
  border-radius:var(--radius-sm); font-size:13px; font-weight:500;
  color:rgba(255,255,255,.42); cursor:pointer; text-decoration:none;
  transition:background var(--t),color var(--t);
}
.sb-signout:hover { background:rgba(239,68,68,.12); color:#f87171; }
.sb-signout .sb-icon { color:rgba(255,255,255,.3); }
.sb-signout:hover .sb-icon { color:#f87171; }

/* Clock widget */
.sb-clock {
  padding:6px 9px; font-size:11px; color:rgba(255,255,255,.42);
  display:flex; flex-direction:column; gap:3px; transition:opacity var(--t-expo);
}
body.sb-collapsed .sb-clock { opacity:0; pointer-events:none; }
.sb-clock-row   { display:flex; align-items:center; gap:5px; }
.sb-clock-dot   { width:5px; height:5px; border-radius:50%; flex-shrink:0; }
.sb-clock-tz    { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.sb-clock-time  { font-weight:700; color:rgba(255,255,255,.78); font-variant-numeric:tabular-nums; font-size:11.5px; }

/* Top-right admin lang picker (kept from old system) */
.admin-lang-picker { position:fixed; top:12px; right:16px; z-index:900; }
.admin-lang-btn {
  display:flex; align-items:center; gap:5px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-pill); padding:5px 11px;
  font-size:12px; font-weight:600; color:var(--text-muted);
  cursor:pointer; box-shadow:var(--shadow-sm); transition:all var(--t);
  font-family:var(--font-sans);
}
.admin-lang-btn:hover { border-color:var(--accent); color:var(--text); box-shadow:var(--shadow); }
.admin-lang-dropdown {
  display:none; position:absolute; top:calc(100% + 6px); right:0;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-lg);
  min-width:200px; max-height:360px; overflow-y:auto;
  padding:4px; z-index:500;
  animation:scaleIn .18s cubic-bezier(.34,1.56,.64,1) both;
  transform-origin:top right;
}
.admin-lang-dropdown.open { display:block; }
.admin-lang-title { padding:6px 10px 4px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.7px; color:var(--text-faint); }
.admin-lang-item { display:flex; align-items:center; justify-content:space-between; padding:7px 10px; border-radius:var(--radius-sm); font-size:13px; color:var(--text-soft); cursor:pointer; text-decoration:none; transition:background var(--t); }
.admin-lang-item:hover { background:var(--surface-2); color:var(--text); }
.admin-lang-active { color:var(--accent); font-weight:600; }
.admin-lang-en { font-size:11px; color:var(--text-faint); }

/* Dark mode overrides for legacy wrapper */
.theme-dark .sb-main { background:var(--bg); }
.theme-dusk .sb-main { background:var(--bg); }

/* Responsive legacy compat */
@media (max-width:1024px) {
  .sb        { transform:translateX(-100%); }
  .sb.open   { transform:translateX(0); box-shadow:var(--shadow-xl); }
  body.with-sidebar .sb-main { margin-left:0 !important; }
}

/* ─────────────────────────────────────────────────────────────
   SITE FOOTER
───────────────────────────────────────────────────────────── */
.site-footer {
  background:var(--surface); border-top:1px solid var(--border);
  padding:16px 0;
}
.footer-inner { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.site-footer p { font-size:0.75rem; color:var(--text-muted); }

/* ─────────────────────────────────────────────────────────────
   ADMIN PAGE HERO  (page header banners)
───────────────────────────────────────────────────────────── */
.admin-page-hero {
  background:var(--sidebar-bg);
  padding:28px 0 32px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.admin-page-hero-inner { position:relative; display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.admin-page-title { font-size:1.45rem; font-weight:800; color:#fff; letter-spacing:-.04em; line-height:1.2; }
.admin-page-sub   { font-size:.875rem; color:rgba(255,255,255,.45); margin-top:4px; }

/* Dashboard hero */
.dash-hero { background:var(--sidebar-bg); padding:32px 0 40px; border-bottom:1px solid rgba(255,255,255,.06); }
.dash-hero-inner { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.dash-hero-title { font-size:1.6rem; font-weight:800; color:#fff; letter-spacing:-.04em; line-height:1.2; }
.dash-hero-sub   { font-size:.875rem; color:rgba(255,255,255,.45); margin-top:4px; }

/* ─────────────────────────────────────────────────────────────
   DPP TABLE  (dashboard + passports list)
───────────────────────────────────────────────────────────── */
.dpp-table-wrap {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); overflow-x:auto; box-shadow:var(--shadow-sm);
}
table.dpp-table { width:100%; border-collapse:collapse; }
.dpp-table th {
  background:var(--surface-2); color:var(--text-muted);
  font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em;
  padding:10px 12px; text-align:left; border-bottom:1px solid var(--border); white-space:nowrap;
}
.dpp-table td {
  padding:12px; font-size:.84rem; color:var(--text-soft);
  border-bottom:1px solid var(--border); vertical-align:middle;
}
.dpp-table tr:last-child td { border-bottom:none; }
.dpp-table tbody tr { transition:background var(--t); }
.dpp-table tbody tr:hover { background:var(--surface-2); }
.dpp-table tbody tr:hover td:first-child { box-shadow:inset 3px 0 0 var(--accent); }

/* ─────────────────────────────────────────────────────────────
   DATA TABLE  (reports, users, etc.)
───────────────────────────────────────────────────────────── */
.data-table { width:100%; border-collapse:collapse; font-size:.84rem; }
.data-table th {
  padding:10px 16px; text-align:left; font-size:.72rem; font-weight:700;
  color:var(--text-muted); text-transform:uppercase; letter-spacing:.07em;
  background:var(--surface-2); border-bottom:1px solid var(--border); white-space:nowrap;
}
.data-table td {
  padding:12px 16px; color:var(--text-soft);
  border-bottom:1px solid var(--border); vertical-align:middle;
}
.data-table tr:last-child td { border-bottom:none; }
.data-table tbody tr { transition:background var(--t); }
.data-table tbody tr:hover { background:var(--surface-2); }

/* ─────────────────────────────────────────────────────────────
   FORM LAYOUTS  (create / edit wizard)
───────────────────────────────────────────────────────────── */
.form-row, .form-row-2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.form-row-3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.field-hint { font-size:.76rem; color:var(--text-muted); margin-top:4px; }

.form-section {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:24px; margin-bottom:20px;
}
.form-section-title {
  font-size:.72rem; font-weight:700; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:.1em; margin:24px 0 14px;
  display:flex; align-items:center; gap:8px;
}
.form-section-title::after { content:''; flex:1; height:1px; background:var(--border); }

.section-heading {
  font-size:.78rem; font-weight:700; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:.09em;
  margin-bottom:18px; padding-bottom:10px; border-bottom:1px solid var(--border);
}
.section-card {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); overflow:hidden; margin-bottom:20px; box-shadow:var(--shadow-sm);
}
.section-card-header {
  padding:14px 20px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; background:var(--surface-2);
}
.section-card-title { font-size:.875rem; font-weight:700; color:var(--text); }

/* ─────────────────────────────────────────────────────────────
   WIZARD STEPS  (create / edit multi-step form)
───────────────────────────────────────────────────────────── */
.wizard-steps {
  display:flex; align-items:center;
  background:rgba(255,255,255,.07); border-radius:var(--radius-pill);
  padding:4px; width:fit-content; margin:20px auto; gap:0;
}
.wizard-step {
  display:flex; align-items:center; gap:7px;
  padding:7px 18px; border-radius:var(--radius-pill);
  font-size:.8rem; font-weight:500; color:rgba(255,255,255,.45);
  cursor:pointer; transition:all var(--t); white-space:nowrap; text-decoration:none;
}
.wizard-step:hover:not(.active) { color:rgba(255,255,255,.75); }
.wizard-step-num {
  width:20px; height:20px; border-radius:50%;
  border:1.5px solid rgba(255,255,255,.25);
  display:flex; align-items:center; justify-content:center;
  font-size:.7rem; font-weight:700; flex-shrink:0; transition:all var(--t);
}
.wizard-step.active { background:var(--accent); color:#fff; }
.wizard-step.active .wizard-step-num { background:rgba(255,255,255,.2); border-color:transparent; color:#fff; }
.wizard-step.done { color:var(--accent-mid); }
.wizard-step.done .wizard-step-num { background:var(--accent-glow); border-color:var(--accent); color:var(--accent); }
.wizard-step-sep { width:1px; height:18px; background:rgba(255,255,255,.12); flex-shrink:0; }

/* Wizard panels & nav */
.wizard-panel { display:none; }
.wizard-panel.active { display:block; }
.wizard-nav {
  display:flex; align-items:center; justify-content:space-between;
  margin-top:24px; padding-top:18px; border-top:1px solid var(--border); gap:12px;
}
.wizard-nav > span { flex:1; }

/* ─────────────────────────────────────────────────────────────
   HANDOFF / STEP COMPLETE PANEL
───────────────────────────────────────────────────────────── */
.handoff-panel {
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); padding:32px; text-align:center; box-shadow:var(--shadow-sm);
}
.handoff-title { font-size:1.1rem; font-weight:800; color:var(--text); margin-bottom:6px; letter-spacing:-.02em; }
.handoff-sub   { font-size:.875rem; color:var(--text-muted); margin-bottom:20px; }
.handoff-next-label { font-size:.78rem; color:var(--text-muted); margin-bottom:16px; }
.handoff-link-wrap { display:flex; align-items:center; gap:8px; max-width:520px; margin:0 auto 16px; }
.handoff-link-input { flex:1; font-family:var(--font-mono); font-size:.78rem; padding:8px 12px; }
.handoff-qr-wrap   { margin:16px auto; display:flex; justify-content:center; }
.handoff-qr-img    { width:160px; height:160px; padding:12px; background:#fff; border-radius:var(--radius); border:1px solid var(--border); }
.handoff-qr-caption{ font-size:.72rem; color:var(--text-muted); margin-top:8px; }
.handoff-po        { font-family:var(--font-mono); font-size:.78rem; color:var(--text-muted); margin-bottom:12px; }
.handoff-check     { display:flex; align-items:center; justify-content:center; gap:8px; font-size:.9rem; color:var(--accent); font-weight:700; margin-bottom:20px; }

/* ─────────────────────────────────────────────────────────────
   STEP BADGE  (role-based queue view)
───────────────────────────────────────────────────────────── */
.step-badge { display:inline-flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-pill); padding:8px 16px; font-size:.82rem; margin-bottom:16px; }
.step-num   { width:24px; height:24px; border-radius:50%; background:var(--accent); color:#fff; display:flex; align-items:center; justify-content:center; font-size:.72rem; font-weight:800; flex-shrink:0; }
.step-context { font-size:.75rem; color:var(--text-muted); margin-top:4px; }

/* ─────────────────────────────────────────────────────────────
   DATE INPUT  (native date picker normalised)
───────────────────────────────────────────────────────────── */
input[type="date"] {
  color-scheme: light;
  background-color:var(--surface); color:var(--text);
  border:1.5px solid var(--border); border-radius:var(--radius-sm);
  padding:0 12px; height:38px; font-family:var(--font-sans); font-size:0.8438rem; width:100%;
}
input[type="date"]:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-glow); outline:none; }
.theme-dark input[type="date"] { color-scheme: dark; }
.theme-dusk  input[type="date"] { color-scheme: dark; }

/* ─────────────────────────────────────────────────────────────
   CERT GRID  (certifications section)
───────────────────────────────────────────────────────────── */
.cert-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
@media(max-width:768px) { .cert-grid { grid-template-columns:1fr 1fr; } }

/* ─────────────────────────────────────────────────────────────
   DARK MODE — admin-specific overrides
───────────────────────────────────────────────────────────── */
.theme-dark .dpp-table td,
.theme-dark .data-table td { border-bottom-color:var(--border); }
.theme-dark .dpp-table tbody tr:hover,
.theme-dark .data-table tbody tr:hover { background:var(--surface-3); }
.theme-dark .form-section,
.theme-dark .section-card,
.theme-dark .handoff-panel { background:var(--surface); border-color:var(--border); }
.theme-dusk .dpp-table tbody tr:hover,
.theme-dusk .data-table tbody tr:hover { background:var(--surface-3); }

@media(max-width:1024px) {
  .form-row, .form-row-2 { grid-template-columns:1fr; }
  .form-row-3 { grid-template-columns:1fr; }
  .cert-grid  { grid-template-columns:1fr 1fr; }
}

.delay-1{animation-delay:.05s}.delay-2{animation-delay:.10s}.delay-3{animation-delay:.15s}.delay-4{animation-delay:.20s}.delay-5{animation-delay:.25s}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE NATIVE  — < 1024 px
   Strategy: fixed top-bar + slide-in sidebar + overlay backdrop
═══════════════════════════════════════════════════════════════════════════ */

/* ── Mobile top bar ── */
.mob-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  z-index: 151;
  background: var(--sidebar-bg);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  -webkit-tap-highlight-color: transparent;
}

.mob-ham {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06);
  border: none; border-radius: 10px;
  color: rgba(255,255,255,.9);
  cursor: pointer; flex-shrink: 0;
  transition: background var(--t);
  -webkit-tap-highlight-color: transparent;
}
.mob-ham:hover, .mob-ham:active { background: rgba(255,255,255,.14); }

.mob-brand {
  flex: 1;
  font-size: 14px; font-weight: 700;
  color: #fff; letter-spacing: -.3px;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.mob-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  text-decoration: none; flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(var(--accent-rgb),.45);
}

.sb-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 195;
  animation: fadeIn .2s ease;
}
.sb-overlay.visible { display: block; }

@media (max-width: 1024px) {
  .mob-topbar { display: flex; }
  .sb-main    { padding-top: 52px; }
  .sidebar    { height: 100%; z-index: 200; }

  .wizard-steps {
    overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
    width: 100%; justify-content: flex-start; border-radius: var(--radius-lg);
  }
  .wizard-steps::-webkit-scrollbar { display: none; }

  .filter-tabs { gap: 6px; }
  .filter-tab  { padding: 7px 12px; font-size: .76rem; }

  .admin-page-hero { padding: 20px 0 24px; }
  .dash-hero       { padding: 20px 0 28px; }
  .page-body       { padding: 14px; }

  .stats-grid  { grid-template-columns: repeat(2,1fr); gap: 12px; }
  .topbar-breadcrumb { display: none; }

  .dpp-table-wrap, .sup-table-wrap, .table-wrap {
    -webkit-overflow-scrolling: touch; overflow-x: auto;
  }

  .int-kpis  { grid-template-columns: repeat(2,1fr); }
  .int-links { grid-template-columns: 1fr; }

  .setting-row { grid-template-columns: 1fr; gap: 16px; }

  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
  .section-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .section-toolbar .search-input { width: 100%; }

  .modal { max-width:100%; border-radius:var(--radius-xl) var(--radius-xl) 0 0; position:fixed; bottom:0; left:0; right:0; margin:0; max-height:92vh; }
  .modal-backdrop { align-items:flex-end; padding:0; }
}

@media (max-width: 640px) {
  .mob-topbar { height: 48px; }
  .sb-main    { padding-top: 48px; }

  .stats-grid, .int-kpis { grid-template-columns: 1fr 1fr; }
  .theme-swatches { gap: 8px; }
  .theme-swatch   { padding: 6px 8px; }
  .theme-swatch-preview { width: 50px; height: 36px; }
  .save-bar-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .row-actions    { gap: 3px; }
}

/* Touch targets */
@media (max-width: 1024px) {
  .btn-sm { height: 36px !important; min-width: 36px; }
  .sidebar-nav-item { height: 44px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  .toggle { width: 44px; height: 25px; }
  .toggle-slider::before { width: 18px; height: 18px; }
  .toggle input:checked + .toggle-slider::before { transform: translateY(-50%) translateX(19px); }
}

/* iPhone safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  @media (max-width: 1024px) {
    .sidebar    { padding-bottom: env(safe-area-inset-bottom); }
    .save-bar   { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
    .site-footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  }
}

/* Public passport mobile */
@media (max-width: 640px) {
  .hero-inner { padding: 16px !important; }
  .hero-top   { margin-bottom: 20px !important; }
  .sticky-nav-inner { gap: 0; }
  .nav-item   { padding: 13px 14px; font-size: .78rem; min-height: 44px; }
  .pp-card-body { padding: 14px; }
  .section-header { padding: 28px 16px 18px; }
  .pp-section     { padding: 28px 0; }
  .metrics-row    { grid-template-columns: repeat(2,1fr) !important; gap: 10px; }
  .metric-card    { padding: 16px 12px; }
  .metric-val     { font-size: 1.5rem; }
  .env-grid       { grid-template-columns: repeat(2,1fr) !important; gap: 10px; }
  .env-val        { font-size: 1.4rem; }
  .hero-actions   { flex-direction: column; gap: 8px; }
  .hero-actions .btn-hero { width: 100%; justify-content: center; }
}

/* ── Large font-size resilience (max --html-font capped at 20px in UI) ── */
/* Ensure critical fixed-height elements don't overflow their containers */
.btn                { min-height: var(--btn-h, 2.25rem); height: auto !important; white-space: nowrap; }
.btn-sm             { min-height: 1.875rem !important; }
.btn-lg             { min-height: 2.75rem !important; }
.form-control, .form-select, input[type="text"],
input[type="email"], input[type="password"],
input[type="number"], input[type="url"], select { min-height: 2.375rem; height: auto !important; }
.sidebar-nav-item   { min-height: 35px; height: auto !important; }
.topbar             { min-height: 58px; height: auto !important; }
.badge, .status-badge { white-space: nowrap; }
/* Setting rows: collapse to single column at any font size that would overflow */
@media (max-width:900px), (min-width:0px) and (min-resolution:0dpi) {
  .setting-row { grid-template-columns: minmax(200px, 280px) 1fr; }
}

/* ── DPP tables: keep IDs on one line, compact step indicator ── */
.dpp-table td.cell-id { font-family:var(--font-mono, ui-monospace, monospace); font-size:.75rem; color:var(--text-muted); white-space:nowrap; }
.dpp-table td.cell-po { white-space:nowrap; }
.step-dots { display:inline-flex; gap:3px; white-space:nowrap; }
.step-dots i {
  font-style:normal; width:1.25rem; height:1.25rem; border-radius:5px;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:.66rem; font-weight:700; line-height:1;
  background:var(--surface-3); color:var(--text-faint); border:1px solid var(--border);
}
.step-dots i.on { background:var(--accent-glow); color:var(--accent-dark); border-color:rgba(var(--accent-rgb),.35); }
.theme-dark .step-dots i.on, .theme-dusk .step-dots i.on { color:var(--accent-mid); }

/* ── Mobile top bar: dock the language picker inside the bar, left of the avatar ── */
@media (max-width: 1024px) {
  .admin-lang-picker { top: 11px; right: 58px; z-index: 160; }
  .mob-brand { text-align: left; padding-right: 108px; }
}
@media (max-width: 640px) {
  .admin-lang-picker { top: 9px; }
}
@media (max-width: 640px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .page-wrap { padding-top: 20px !important; padding-bottom: 40px !important; }
}

/* ── Auth pages (forgot / reset password) — same look as the login card ── */
.login-page { width:100%; }
body.auth-page { min-height:100vh; margin:0; display:flex; align-items:center; justify-content:center; padding:16px; background:#080d18; }
.auth-card {
  width:100%; max-width:420px; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-2xl); box-shadow:var(--shadow-xl); padding:32px;
  animation:scaleInSpring .48s cubic-bezier(.34,1.56,.64,1) both;
}
.auth-logo { display:flex; flex-direction:column; align-items:center; gap:10px; margin-bottom:24px; text-align:center; }
.auth-logo-mark {
  width:46px; height:46px; border-radius:var(--radius-lg);
  background:linear-gradient(135deg,var(--accent) 0%,var(--accent-dark) 100%);
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:1.375rem; box-shadow:0 4px 22px rgba(var(--accent-rgb),.45);
}
.auth-logo-name { font-size:1.0625rem; font-weight:800; color:var(--text); letter-spacing:-.3px; }
.auth-title { font-size:1.25rem; font-weight:800; color:var(--text); letter-spacing:-.3px; text-align:center; }
.auth-sub   { font-size:.875rem; color:var(--text-muted); margin-top:4px; text-align:center; line-height:1.5; }
@media (max-width:480px) { .auth-card { padding:24px 20px; } }

/* ═══════════════════════════════════════════════════════════════════════════
   PUBLIC SECTION VIEWS  (section_order / section_fabric / section_env)
   Restored from the pre-Gemstone sheet, rebuilt on current tokens.
═══════════════════════════════════════════════════════════════════════════ */
.public-header { background:var(--surface); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:200; }
.public-header-inner { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:60px; }
.public-header-actions { display:flex; gap:8px; align-items:center; }
.public-header .logo { display:flex; align-items:center; gap:10px; font-weight:700; font-size:1rem; color:var(--text); text-decoration:none; letter-spacing:-.02em; min-width:0; }
.public-header .logo:hover { opacity:.8; }
.public-header .logo-mark { width:34px; height:34px; background:linear-gradient(135deg,var(--accent),var(--accent-dark)); border-radius:8px; display:flex; align-items:center; justify-content:center; color:#fff; font-size:.95rem; flex-shrink:0; }
.public-header .logo-text { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.section-view-hero { background:var(--sidebar-bg); padding:32px 0 40px; border-bottom:1px solid rgba(255,255,255,.06); }
.section-back { display:inline-flex; align-items:center; gap:5px; font-size:.82rem; color:rgba(255,255,255,.55); font-weight:500; margin-bottom:14px; text-decoration:none; transition:color var(--t); }
.section-back:hover { color:#fff; }
.section-view-label { font-size:.7rem; font-weight:700; color:var(--accent-mid); text-transform:uppercase; letter-spacing:.12em; margin-bottom:8px; }
.section-view-title { font-size:1.9rem; font-weight:800; color:#fff; letter-spacing:-.04em; line-height:1.15; overflow-wrap:anywhere; }
.section-view-po    { font-size:.875rem; color:rgba(255,255,255,.55); margin-top:6px; }
.section-view-body  { padding:36px 0 56px; }

.section-view-body .pp-card { background:var(--surface); border-radius:var(--radius-lg); border:1px solid var(--border); border-left:3px solid var(--accent); box-shadow:var(--shadow-xs); padding:22px 26px; margin-bottom:20px; }
.section-view-body .pp-card-label { font-size:.72rem; font-weight:700; color:var(--accent-dark); text-transform:uppercase; letter-spacing:.1em; margin-bottom:14px; }
.section-view-body .pp-empty { text-align:center; padding:40px 20px; color:var(--text-muted); font-size:.875rem; background:var(--surface); border-radius:var(--radius); border:1px dashed var(--border); }
.section-view-body .pp-fields { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:18px 24px; }
.section-view-body .pp-field-wide { grid-column:1/-1; }
.section-view-body .pp-field label { display:block; font-size:.7rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.08em; margin-bottom:4px; }
.section-view-body .pp-field span { display:block; font-size:.9375rem; font-weight:500; color:var(--text); overflow-wrap:anywhere; }
.section-view-body .pp-certs { margin-top:20px; padding-top:16px; border-top:1px solid var(--border); }
.section-view-body .pp-certs h3 { font-size:.7rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.09em; margin-bottom:10px; }
.section-view-body .cert-tags { display:flex; flex-wrap:wrap; gap:6px; }
.section-view-body .cert-tag { background:var(--accent-glow); color:var(--accent-deeper); border:1px solid rgba(var(--accent-rgb),.3); padding:3px 12px; border-radius:var(--radius-pill); font-size:.72rem; font-weight:600; }
.section-view-body .full-qr-url { display:inline-block; max-width:100%; font-size:.75rem; color:var(--text-muted); background:var(--surface-2); border:1px solid var(--border); padding:5px 14px; border-radius:var(--radius-pill); font-family:var(--font-mono, monospace); overflow-wrap:anywhere; }
.section-view-body img[alt$="QR"] { display:block; }

.section-view-body .env-metrics-row { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:14px; margin-top:20px; }
.section-view-body .env-metric-group { background:var(--surface-2); border-radius:var(--radius); border:1px solid var(--border); padding:14px 16px; transition:border-color var(--t); }
.section-view-body .env-metric-group:hover { border-color:var(--accent); }
.section-view-body .env-metric-title { font-size:.75rem; font-weight:700; color:var(--text); text-transform:uppercase; letter-spacing:.07em; margin-bottom:10px; display:flex; align-items:center; gap:5px; }
.section-view-body .env-table { width:100%; border-collapse:collapse; }
.section-view-body .env-table td { font-size:.8125rem; padding:5px 0; border-bottom:1px solid var(--border); color:var(--text-soft); }
.section-view-body .env-table tr:last-child td { border-bottom:none; }
.section-view-body .env-table td:last-child { text-align:right; font-weight:600; color:var(--text); }
.site-footer .footer-inner { padding-top:18px; padding-bottom:18px; font-size:.8125rem; color:var(--text-muted); }

@media (max-width:640px) {
  .section-view-hero { padding:24px 0 28px; }
  .section-view-title { font-size:1.5rem; }
  .section-view-body { padding:24px 0 40px; }
  .section-view-body .pp-card { padding:18px; }
  .public-header .logo-text { max-width:48vw; }
}

/* ── DPP wizard (create / edit) ── */
.wizard-wrap { max-width:1080px; }
.form-group > label:not(.toggle-wrap):not(.cert-expiry-check) {
  display:block; font-size:.8125rem; font-weight:600; color:var(--text-soft);
  margin-bottom:6px; letter-spacing:.1px; line-height:1.4;
}
.form-group > label small, .form-group > label .hint, .form-group > label span:not(.req) { font-weight:500; }
.cert-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; align-items:start; }
@media (max-width:1024px) { .cert-list { grid-template-columns:1fr; } }
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="tel"] {
  width:100%; padding:0 .75rem; height:2.375rem; font-size:.8438rem; font-family:var(--font-sans);
  background-color:var(--surface); color:var(--text); border:1.5px solid var(--border); border-radius:var(--radius-sm); outline:none;
}
input[type="date"]:focus, input[type="tel"]:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-glow); }
.theme-dark input[type="date"], .theme-dusk input[type="date"] { color-scheme:dark; }
/* Native file inputs: style the picker button to match the design system */
input[type="file"] { font-size:.8125rem; color:var(--text-muted); max-width:100%; }
input[type="file"]::file-selector-button {
  font:inherit; font-weight:600; margin-right:10px; padding:6px 12px; cursor:pointer;
  border:1.5px solid var(--border); border-radius:var(--radius-sm);
  background:var(--surface-2); color:var(--text-soft); transition:border-color var(--t), color var(--t);
}
input[type="file"]::file-selector-button:hover { border-color:var(--accent); color:var(--accent); }
.cert-expiry-label { min-width:0; overflow-wrap:anywhere; }
@media (max-width:640px) {
  .wizard-nav { flex-direction:column-reverse; align-items:stretch; }
  .wizard-nav > span { display:none; }
  .wizard-nav .btn { width:100%; justify-content:center; white-space:normal; text-align:center; }
}
.dpp-table td.cell-po strong { display:block; }
.dpp-table td.cell-po .cell-sub { display:block; margin-top:2px; font-family:var(--font-mono, ui-monospace, monospace); font-size:.7rem; font-weight:500; color:var(--text-muted); }
@media (max-width:1024px) { .section-toolbar > div:first-child { justify-content:flex-start; } }

/* Alerts on dark surfaces: lift text colours for contrast */
.theme-dark .alert-success, .theme-dusk .alert-success { color:#86efac; background:rgba(34,197,94,.12); border-color:rgba(34,197,94,.28); }
.theme-dark .alert-warning, .theme-dusk .alert-warning { color:#fcd34d; background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.28); }
.theme-dark .alert-danger, .theme-dark .alert-error,
.theme-dusk .alert-danger, .theme-dusk .alert-error   { color:#fca5a5; background:rgba(239,68,68,.12); border-color:rgba(239,68,68,.28); }
.theme-dark .alert-info, .theme-dusk .alert-info       { color:var(--accent-mid); }

/* ── Inputs with a trailing unit (L, KG, KWh, %) — restored from the pre-Gemstone sheet ── */
.input-unit-wrap { position:relative; display:flex; align-items:center; }
.input-unit-wrap input { padding-right:3.25rem; }
.input-unit {
  position:absolute; right:1.5px; top:1.5px; bottom:1.5px;
  display:flex; align-items:center;
  padding:0 .7rem; font-size:.75rem; font-weight:600;
  color:var(--text-muted); background:var(--surface-2);
  border-left:1px solid var(--border);
  border-radius:0 calc(var(--radius-sm) - 1px) calc(var(--radius-sm) - 1px) 0;
  pointer-events:none; white-space:nowrap;
}
/* Fibre composition builder rows (create / edit / worker / supplier portal) */
[id$="fiber-rows"] > div { flex-wrap:wrap; }
input.fiber-name { flex:1 1 180px !important; min-width:0; width:auto !important; }
input.fiber-cert { flex:0 1 130px !important; min-width:90px; width:auto !important; }

/* ── Per-user permission list (admin/users/_permission_list.php) ───────────── */
.perm-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; flex-wrap:wrap; margin:1.75rem 0 1rem; padding-top:1.5rem; border-top:2px solid var(--border-grey); }
.perm-bulk { display:flex; gap:.5rem; }
.perm-list { border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.perm-group { padding:.6rem 1rem; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted); background:var(--surface-2); border-bottom:1px solid var(--border); }
.perm-row { display:flex; align-items:center; gap:1rem; padding:.7rem 1rem; border-bottom:1px solid var(--border); }
.perm-row:last-child { border-bottom:none; }
.perm-name { flex:1 1 auto; min-width:0; font-size:.9rem; font-weight:600; color:var(--text); }
.perm-row .toggle { cursor:pointer; }
.perm-row .perm-level input:disabled + .toggle-slider { opacity:.35; cursor:not-allowed; }
.perm-state { flex:0 0 6.5rem; text-align:right; font-size:.78rem; font-weight:600; color:var(--text-soft); }
.perm-row.perm-off .perm-name { color:var(--text-muted); font-weight:500; }
@media (max-width:600px) {
  .perm-row { flex-wrap:wrap; gap:.6rem .9rem; }
  .perm-name { flex-basis:100%; }
  .perm-state { flex:1 1 auto; text-align:left; }
}
