/* =============================================================================
 * RankPresSEO — "Dark Electric Startup" Design System
 * Inspired by Linear + Vercel + Raycast + Stripe 2026
 * ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Design Tokens ────────────────────────────────────────────────────────── */
:root {
  /* Backgrounds - depth layers */
  --bg-base:        #05050a;
  --bg-surface:     #0d0d18;
  --bg-elevated:    #13131f;
  --bg-hover:       #1a1a2e;

  /* Electric accents */
  --accent-primary:  #6366f1;
  --accent-glow:     #818cf8;
  --accent-secondary:#06b6d4;
  --accent-success:  #10b981;
  --accent-warning:  #f59e0b;
  --accent-danger:   #ef4444;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  --gradient-glow:    linear-gradient(135deg, #6366f140 0%, #06b6d420 100%);

  /* Text */
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  /* Borders */
  --border-subtle:  rgba(99, 102, 241, 0.15);
  --border-medium:  rgba(99, 102, 241, 0.30);
  --border-bright:  rgba(99, 102, 241, 0.60);

  /* Glows */
  --glow-primary:   0 0 40px rgba(99, 102, 241, 0.35);
  --glow-cyan:      0 0 40px rgba(6, 182, 212, 0.35);
  --glow-sm:        0 0 15px rgba(99, 102, 241, 0.25);

  /* Typography */
  --font-heading:   'Syne', sans-serif;
  --font-body:      'DM Sans', sans-serif;
  --font-mono:      'JetBrains Mono', monospace;

  /* Sizing */
  --sidebar-width:  260px;
  --border-radius:  16px;
  --radius-sm:      10px;
  --radius-xs:      8px;
}

/* ─── Base Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Typography ───────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: 1.2;
  color: var(--text-primary);
}
h1, h2, .heading-xl, .heading-lg {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.03em;
}
h3, h4, .heading-md, .heading-sm {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}
p { margin: 0; line-height: 1.65; }
a { color: var(--text-secondary); }
code, pre, .mono, .font-mono, kbd {
  font-family: var(--font-mono);
  font-weight: 500;
}

/* Fluid type scale for heading sizes */
h1 { font-size: clamp(1.625rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h3 { font-size: clamp(1rem, 2.5vw, 1.25rem); }

/* ─── Animated Background Orbs ─────────────────────────────────────────────── */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-orbs::before,
.bg-orbs::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
}
.bg-orbs::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -10%; left: -5%;
  animation: orbFloat1 20s ease-in-out infinite;
}
.bg-orbs::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  bottom: -10%; right: -5%;
  animation: orbFloat2 25s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, 40px) scale(1.1); }
  66% { transform: translate(-30px, 60px) scale(0.95); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, -60px) scale(1.08); }
  66% { transform: translate(50px, -30px) scale(0.92); }
}

/* Noise texture overlay */
.bg-noise {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ─── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(99,102,241,0.3); }
  50% { box-shadow: 0 0 35px rgba(99,102,241,0.5); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.animate-entry {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.animate-fade {
  animation: fadeIn 0.4s ease both;
}
.animate-scale {
  animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.stagger-1 { animation-delay: 80ms; }
.stagger-2 { animation-delay: 160ms; }
.stagger-3 { animation-delay: 240ms; }
.stagger-4 { animation-delay: 320ms; }
.stagger-5 { animation-delay: 400ms; }
.stagger-6 { animation-delay: 480ms; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}

/* ─── Card (Glassmorphism Premium) ─────────────────────────────────────────── */
.card {
  background: rgba(13, 13, 24, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  box-shadow:
    0 0 0 1px rgba(99,102,241,0.08),
    0 8px 32px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--glow-sm), 0 16px 48px rgba(0,0,0,0.5);
  transform: translateY(-2px);
}
.card-static {
  background: rgba(13, 13, 24, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  box-shadow:
    0 0 0 1px rgba(99,102,241,0.08),
    0 8px 32px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.05);
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 0 20px rgba(99,102,241,0.4);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}
.btn-primary:hover {
  box-shadow: 0 0 35px rgba(99,102,241,0.6);
  transform: translateY(-1px) scale(1.02);
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0) scale(0.99); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
  box-shadow: var(--glow-sm);
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.25);
  box-shadow: 0 0 20px rgba(239,68,68,0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}
.btn-xs {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
}

/* ─── Inputs ───────────────────────────────────────────────────────────────── */
.input, .textarea, .select,
input[type="text"], input[type="email"], input[type="password"],
input[type="url"], input[type="number"], input[type="search"],
input[type="tel"], textarea, select {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.625rem 0.875rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: all 0.2s ease;
  width: 100%;
  outline: none;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus,
input[type="url"]:focus, input[type="number"]:focus, input[type="search"]:focus,
input[type="tel"]:focus, textarea:focus, select:focus,
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15), var(--glow-sm);
}
input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}
select option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* Checkbox & Toggle */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid var(--border-medium);
  border-radius: 4px;
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
input[type="checkbox"]:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4.5px; top: 1.5px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

/* Color input */
input[type="color"] {
  padding: 2px;
  width: 3.5rem;
  height: 2.5rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

/* Toggle switch */
.toggle-track {
  width: 2.75rem;
  height: 1.5rem;
  background: var(--bg-hover);
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background 0.25s;
  border: 1px solid var(--border-subtle);
}
.toggle-track.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 1.125rem; height: 1.125rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
}
.toggle-track.active::after {
  transform: translateX(1.25rem);
}

/* ─── Labels ───────────────────────────────────────────────────────────────── */
label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ─── Badges / Status Pills ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-primary {
  background: rgba(99,102,241,0.15);
  color: var(--accent-glow);
  border: 1px solid rgba(99,102,241,0.3);
}
.badge-success {
  background: rgba(16,185,129,0.15);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.3);
}
.badge-warning {
  background: rgba(245,158,11,0.15);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.3);
}
.badge-danger {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
}
.badge-neutral {
  background: rgba(71,85,105,0.2);
  color: var(--text-secondary);
  border: 1px solid rgba(71,85,105,0.3);
}
.badge-cyan {
  background: rgba(6,182,212,0.15);
  color: #22d3ee;
  border: 1px solid rgba(6,182,212,0.3);
}

/* ─── Tables (Data Grid) ──────────────────────────────────────────────────── */
/* Wrapper added automatically by JS (see below) or manually in templates */
.data-grid-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.data-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.data-grid thead th {
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(13,13,24,0.5);
}
.data-grid tbody tr {
  transition: all 0.15s ease;
}
.data-grid tbody tr:hover {
  background: var(--bg-hover);
}
.data-grid tbody tr:hover td:first-child {
  border-left: 2px solid var(--accent-primary);
  padding-left: calc(1rem - 2px);
}
.data-grid tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(99,102,241,0.07);
  border-left: 2px solid transparent;
}
.data-grid tbody td:first-child {
  padding-left: 1rem;
}
.data-grid tbody tr:last-child td {
  border-bottom: none;
}

/* ─── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 30;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-collapsed { width: 0; overflow: hidden; }

.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-logo a {
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}
.sidebar-logo a:hover {
  opacity: 0.85;
}
.sidebar-logo img {
  filter: drop-shadow(0 0 8px rgba(99,102,241,0.3));
  transition: filter 0.2s;
}
.sidebar-logo a:hover img {
  filter: drop-shadow(0 0 12px rgba(99,102,241,0.5));
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}
.sidebar-section {
  padding: 1.25rem 0.75rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  margin-bottom: 2px;
}
.sidebar-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.sidebar-link i {
  width: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.7;
}
.sidebar-link:hover i { opacity: 1; }

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(6,182,212,0.08) 100%);
  color: var(--accent-glow);
  box-shadow: var(--glow-sm);
  border-left: 3px solid var(--accent-primary);
  padding-left: calc(0.75rem - 3px);
}
.sidebar-link.active i { opacity: 1; color: var(--accent-glow); }

/* Sidebar orb decoration */
.sidebar-orb {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: radial-gradient(ellipse at center bottom, rgba(99,102,241,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-footer {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ─── Top Header Bar ───────────────────────────────────────────────────────── */
.top-bar {
  padding: 0 1.5rem;
  height: 3.5rem;
  background: rgba(13, 13, 24, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 20;
}
.top-bar-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* ─── KPI / Stats Cards ───────────────────────────────────────────────────── */
.kpi-card {
  background: rgba(13, 13, 24, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  box-shadow: 0 0 0 1px rgba(99,102,241,0.08), 0 8px 32px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}
.kpi-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--glow-sm), 0 12px 40px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}
.kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}
.kpi-value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}
.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.kpi-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.kpi-icon-indigo  { background: rgba(99,102,241,0.15); color: var(--accent-glow); }
.kpi-icon-cyan    { background: rgba(6,182,212,0.15); color: #22d3ee; }
.kpi-icon-emerald { background: rgba(16,185,129,0.15); color: #34d399; }
.kpi-icon-amber   { background: rgba(245,158,11,0.15); color: #fbbf24; }
.kpi-icon-rose    { background: rgba(239,68,68,0.15); color: #f87171; }
.kpi-icon-purple  { background: rgba(168,85,247,0.15); color: #c084fc; }

/* ─── Flash Messages ───────────────────────────────────────────────────────── */
.flash {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  animation: slideInRight 0.3s ease both;
}
.flash-error {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}
.flash-success {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.3);
  color: #34d399;
}
.flash-info {
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--accent-glow);
}
.flash-warning {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  color: #fbbf24;
}

/* ─── Toast Notifications ──────────────────────────────────────────────────── */
.toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  min-width: 18rem;
  max-width: 24rem;
  backdrop-filter: blur(20px);
  animation: slideInRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.toast-success {
  background: rgba(16,185,129,0.9);
  color: #fff;
  box-shadow: 0 0 30px rgba(16,185,129,0.3);
}
.toast-error {
  background: rgba(239,68,68,0.9);
  color: #fff;
  box-shadow: 0 0 30px rgba(239,68,68,0.3);
}
.toast-info {
  background: rgba(99,102,241,0.9);
  color: #fff;
  box-shadow: 0 0 30px rgba(99,102,241,0.3);
}
.toast-warning {
  background: rgba(245,158,11,0.9);
  color: #fff;
  box-shadow: 0 0 30px rgba(245,158,11,0.3);
}

/* ─── Modals ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,5,10,0.8);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius);
  box-shadow: var(--glow-primary), 0 24px 64px rgba(0,0,0,0.6);
  max-width: 28rem;
  width: 100%;
  margin: 1rem;
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ─── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.pagination a:hover {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
.pagination .active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 0 15px rgba(99,102,241,0.3);
  border-color: transparent;
}

/* ─── Filter Pills ─────────────────────────────────────────────────────────── */
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  transition: all 0.2s ease;
}
.filter-pill:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  background: var(--bg-hover);
}
.filter-pill.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(99,102,241,0.3);
}

/* ─── Tab Navigation ───────────────────────────────────────────────────────── */
.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s ease;
}
.tab:hover {
  background: var(--bg-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}
.tab.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 20px rgba(99,102,241,0.3);
}

/* ─── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-state i {
  font-size: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: block;
}
.empty-state p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* ─── Gradient Text ────────────────────────────────────────────────────────── */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99,102,241,0.4); }

/* ─── Hero Section (Public) ────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 6rem 0 5rem;
  text-align: center;
}
.hero-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(3rem, 8vw, 7rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}
.hero-sub {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 36rem;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--accent-glow);
  margin-bottom: 1.5rem;
  animation: pulseGlow 3s ease-in-out infinite;
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: float 2s ease-in-out infinite;
}
.scroll-indicator i {
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* ─── Bento Grid ───────────────────────────────────────────────────────────── */
.bento-grid {
  display: grid;
  gap: 1.25rem;
}
.bento-3 {
  grid-template-columns: repeat(3, 1fr);
}
.bento-4 {
  grid-template-columns: repeat(4, 1fr);
}
.bento-2-1 {
  grid-template-columns: 2fr 1fr;
}
@media (max-width: 1024px) {
  .bento-3 { grid-template-columns: repeat(2, 1fr); }
  .bento-4 { grid-template-columns: repeat(2, 1fr); }
  .bento-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .bento-3, .bento-4 { grid-template-columns: 1fr; }
}

/* ─── Feature Card (Public) ────────────────────────────────────────────────── */
.feature-card {
  background: rgba(13,13,24,0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
}
.feature-card:hover {
  border-color: var(--border-medium);
  background: rgba(13,13,24,0.8);
  box-shadow: var(--glow-sm);
  transform: translateY(-4px);
}

/* ─── Article Card (Public) ────────────────────────────────────────────────── */
.article-card {
  background: rgba(13,13,24,0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.article-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--glow-sm), 0 16px 48px rgba(0,0,0,0.4);
  transform: translateY(-4px);
}
.article-card img {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.article-card:hover img {
  transform: scale(1.05);
}
.article-card-body {
  padding: 1.25rem;
}

/* ─── Public Header ────────────────────────────────────────────────────────── */
.pub-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(5,5,10,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}
.pub-nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0;
  transition: color 0.2s;
  position: relative;
}
.pub-nav-link:hover { color: var(--text-primary); }
.pub-nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.pub-nav-link:hover::after { transform: scaleX(1); }

/* ─── Public Footer ────────────────────────────────────────────────────────── */
.pub-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0;
  margin-top: 4rem;
}
.pub-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
.pub-footer a:hover { color: var(--accent-glow); }

/* ─── RGPD Banner ──────────────────────────────────────────────────────────── */
.rgpd-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(13,13,24,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  padding: 1rem 1.5rem;
}

/* ─── Login Page ───────────────────────────────────────────────────────────── */
.login-card {
  background: rgba(13,13,24,0.85);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-medium);
  border-radius: 20px;
  box-shadow: var(--glow-primary), 0 24px 64px rgba(0,0,0,0.5);
  padding: 2.5rem;
}

/* ─── KPI Counter Animation (JS helper class) ─────────────────────────────── */
.kpi-counter {
  display: inline-block;
}

/* ─── TinyMCE Block Overrides (Dark Theme) ─────────────────────────────────── */
.block-callout {
  border-left: 4px solid;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-xs);
  margin: 1.5rem 0;
}
.block-callout.info    { border-color: #6366f1; background: rgba(99,102,241,0.1); color: var(--accent-glow); }
.block-callout.warning { border-color: #f59e0b; background: rgba(245,158,11,0.1); color: #fbbf24; }
.block-callout.success { border-color: #10b981; background: rgba(16,185,129,0.1); color: #34d399; }
.block-callout.danger  { border-color: #ef4444; background: rgba(239,68,68,0.1); color: #f87171; }

.block-code {
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 1.25rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 1.5rem 0;
}

.block-faq details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  margin-bottom: 0.5rem;
  background: var(--bg-surface);
}
.block-faq details summary {
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  color: var(--text-primary);
}
.block-faq details[open] summary {
  border-bottom: 1px solid var(--border-subtle);
}
.block-faq details .faq-content {
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
}

.block-toc {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 1.25rem;
  margin: 1.5rem 0;
}
.block-toc h3 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}
.block-toc ol { list-style: decimal; padding-left: 1.25rem; }
.block-toc ol li { margin-bottom: 0.25rem; }
.block-toc ol li a { color: var(--accent-glow); text-decoration: none; }
.block-toc ol li a:hover { text-decoration: underline; }

.block-cta {
  text-align: center;
  padding: 2rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  color: #fff;
  margin: 1.5rem 0;
}
.block-cta .cta-button {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  margin-top: 1rem;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.3s;
}
.block-cta .cta-button:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(255,255,255,0.15);
}

.block-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin: 1.5rem 0;
}
.block-gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid var(--border-subtle);
}
.block-gallery img:hover {
  border-color: var(--border-medium);
  box-shadow: var(--glow-sm);
  transform: scale(1.02);
}

.block-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin: 1.5rem 0;
}
.block-video iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; border: 0;
}

.block-quote {
  border-left: 4px solid var(--accent-primary);
  padding: 1.5rem;
  background: rgba(99,102,241,0.05);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
}
.block-quote .quote-author {
  font-style: normal;
  font-weight: 600;
  margin-top: 0.75rem;
  color: var(--text-muted);
}

.block-comparison {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.block-comparison table {
  width: 100%;
  border-collapse: collapse;
}
.block-comparison th,
.block-comparison td {
  padding: 0.75rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
  color: var(--text-secondary);
}
.block-comparison th {
  background: var(--bg-surface);
  font-weight: 600;
  color: var(--text-primary);
}

.block-steps {
  counter-reset: step;
  margin: 1.5rem 0;
}
.block-steps .step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.block-steps .step::before {
  counter-increment: step;
  content: counter(step);
  flex-shrink: 0;
  width: 2rem; height: 2rem;
  background: var(--gradient-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: 0 0 15px rgba(99,102,241,0.3);
}

/* ─── Prose Styling ────────────────────────────────────────────────────────── */
.prose { color: var(--text-secondary); }
.prose h2 { margin-top: 2rem; margin-bottom: 0.75rem; color: var(--text-primary); }
.prose h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.prose p  { margin-bottom: 1rem; line-height: 1.75; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.25rem; }
.prose img { border-radius: var(--radius-xs); margin: 1rem 0; border: 1px solid var(--border-subtle); }
.prose a { color: var(--accent-glow); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--accent-secondary); }
.prose code {
  background: var(--bg-surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent-glow);
  border: 1px solid var(--border-subtle);
}
.prose pre code { background: transparent; border: none; padding: 0; }

/* ─── Article Layout (public show page) ─────────────────────────────────── */
html { scroll-padding-top: 5rem; }
.article-layout {
  max-width: 72rem; margin: 0 auto; padding: 3rem 1.5rem;
  position: relative; z-index: 10;
  display: grid; grid-template-columns: 1fr; gap: 0;
}
@media (min-width: 1024px) {
  .article-layout { grid-template-columns: 1fr 260px; gap: 3rem; }
}
.article-main { max-width: 52rem; min-width: 0; }

/* ─── TOC Sidebar ───────────────────────────────────────────────────────── */
.toc-sidebar { display: none; }
@media (min-width: 1024px) { .toc-sidebar { display: block; } }

.toc-nav {
  position: sticky; top: 5rem;
  max-height: calc(100vh - 6rem); overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--bg-hover) transparent;
  background: rgba(13, 13, 24, 0.5);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border-subtle);
  border-radius: 16px; padding: 1.25rem 1rem;
  box-shadow: 0 0 0 1px rgba(99,102,241,0.06), 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
  animation: tocFadeIn .6s ease both;
}
@keyframes tocFadeIn { from { opacity:0; transform:translateX(12px); } to { opacity:1; transform:translateX(0); } }

.toc-header {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-heading); font-weight: 700;
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-muted); margin-bottom: 1rem;
  padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-subtle);
}
.toc-header i { color: var(--accent-primary); font-size: 0.625rem; }

.toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.toc-h3 { padding-left: 0.75rem; }

.toc-link {
  display: block; padding: 0.35rem 0.625rem;
  font-size: 0.75rem; line-height: 1.4; font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: all 0.2s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toc-link:hover { color: var(--text-primary); background: rgba(99,102,241,0.06); }
.toc-link.active {
  color: var(--accent-glow); font-weight: 600;
  border-left-color: var(--accent-primary);
  background: rgba(99,102,241,0.08);
  box-shadow: -2px 0 8px rgba(99,102,241,0.15);
}

/* ─── Related Articles (public) ─────────────────────────────────────────── */
.related-section {
  position: relative; z-index: 10;
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 3rem;
}
.related-container { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }

.related-header { margin-bottom: 2rem; }
.related-header h2 {
  font-family: var(--font-heading); font-weight: 800;
  font-size: 1.5rem; letter-spacing: -0.03em;
  color: var(--text-primary); margin-bottom: 0.25rem;
  display: flex; align-items: center; gap: 0.625rem;
}
.related-header h2 i { color: var(--accent-glow); font-size: 1.125rem; }
.related-header p { font-size: 0.8125rem; color: var(--text-muted); margin: 0; }

.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 1024px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .related-grid { grid-template-columns: 1fr; } }

.related-card {
  background: rgba(13, 13, 24, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 14px; overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.related-card:hover {
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.1), 0 20px 60px rgba(0,0,0,0.45), 0 0 30px rgba(99,102,241,0.08);
  transform: translateY(-6px);
}

.related-card-image { width: 100%; height: 11rem; overflow: hidden; background: var(--bg-surface); position: relative; }
.related-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.related-card:hover .related-card-image img { transform: scale(1.06); }
.related-card-image::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(to top, rgba(5,5,10,0.5), transparent); pointer-events: none;
}

.related-card-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1.75rem;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
}

.related-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.related-card-body h3 {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 1rem; letter-spacing: -0.02em;
  color: var(--text-primary); margin-bottom: 0.5rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color 0.2s;
}
.related-card:hover .related-card-body h3 { color: var(--accent-glow); }

.related-card-excerpt {
  font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 0.875rem; flex: 1;
}

.related-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.6875rem; color: var(--text-muted); font-family: var(--font-mono);
  padding-top: 0.75rem; border-top: 1px solid var(--border-subtle);
}
.related-card-meta i { margin-right: 0.2rem; font-size: 0.5625rem; }

/* ─── Admin Shell Layout ───────────────────────────────────────────────────── */
/* Core layout rules are in admin/layouts/base.php <style> (inline = guaranteed load).
   These are supplementary rules only (scrollbar, z-index). */
.admin-main { position: relative; z-index: 10; }
.admin-content {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-hover) transparent;
}

/* Mobile overlay — blocks content when sidebar open on mobile */
.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 35;
  cursor: pointer;
}

/* ─── Responsive Breakpoints (mobile-first) ───────────────────────────────── */

/* == DESKTOP (≥ 1024px) — sidebar docked ================================== */
@media (min-width: 1024px) {
  .sidebar {
    position: relative;
    /* height auto — flex parent (admin-shell) already locks to 100vh */
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transform: none !important;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.sidebar-collapsed {
    width: 0 !important;
    overflow: hidden;
  }
  .admin-overlay,
  .admin-overlay.active { display: none !important; }
}

/* == TABLET + MOBILE (< 1024px) — sidebar as off-canvas overlay =========== */
@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-width) !important;
    z-index: 40;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.6);
  }
  .sidebar.sidebar-collapsed {
    transform: translateX(-100%);
  }
  .admin-overlay.active {
    display: block;
  }
  .top-bar {
    padding: 0 1.25rem;
  }
  .bento-4 { grid-template-columns: repeat(2, 1fr); }
  .bento-2-1 { grid-template-columns: 1fr; }
}

/* == MOBILE (< 640px) ====================================================== */
@media (max-width: 639px) {
  /* Typography scale down */
  .hero-title { font-size: clamp(1.875rem, 9vw, 2.75rem); }
  .hero-sub { font-size: 0.9375rem; line-height: 1.65; padding: 0 0.5rem; }
  .hero-badge { font-size: 0.6875rem; }
  .hero { padding: 3.5rem 1rem 3rem; }

  /* Admin chrome */
  .top-bar { padding: 0 0.875rem; height: 3.25rem; }
  .top-bar-title { font-size: 0.9375rem; }

  /* Cards */
  .card, .card-static { border-radius: var(--radius-sm); }
  .login-card { padding: 1.5rem 1.25rem; border-radius: var(--radius-sm); }
  .kpi-card { padding: 1rem; }
  .kpi-value { font-size: 1.5rem; }

  /* Grids: 1 column on small phones */
  .bento-3, .bento-4 { grid-template-columns: 1fr; }
  .bento-2-1 { grid-template-columns: 1fr; }

  /* Buttons — minimum 44px touch target (WCAG) */
  .btn { min-height: 2.75rem; padding: 0.625rem 1rem; }
  .btn-sm { min-height: 2.25rem; }
  .btn-xs { min-height: 1.875rem; }

  /* Data tables: auto-wrapped in .data-grid-wrap by JS */
  .data-grid-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }
  .data-grid { min-width: 560px; }

  /* Pagination: wrap */
  .pagination { flex-wrap: wrap; justify-content: center; }

  /* Tabs: horizontal scroll */
  .tab-group {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .tab { white-space: nowrap; }

  /* Filter pills: wrap */
  .filter-pill-group { flex-wrap: wrap; }

  /* Footer: 1 column */
  .footer-grid { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
  .pub-footer { padding: 2rem 0; margin-top: 2.5rem; }

  /* Modal: bottom sheet on mobile */
  .modal-backdrop { align-items: flex-end; }
  .modal-content {
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    border-bottom: none;
    max-height: 90dvh;
    overflow-y: auto;
  }

  /* Toast: full width */
  .toast { min-width: auto; max-width: calc(100vw - 1.5rem); }

  /* RGPD banner: stack vertically */
  .rgpd-banner { padding: 0.875rem 1rem; }
  .rgpd-banner > div { flex-direction: column !important; gap: 0.75rem !important; }

  /* Reduce orb opacity on mobile (performance + readability) */
  .bg-orbs::before,
  .bg-orbs::after { opacity: 0.07; filter: blur(60px); }

  /* Sidebar footer version text */
  .sidebar-footer { display: none; }
}

/* == TABLET (640px – 1023px) =============================================== */
@media (min-width: 640px) and (max-width: 1023px) {
  .bento-3 { grid-template-columns: repeat(2, 1fr); }
}

/* == Public navigation responsive ========================================= */
@media (max-width: 768px) {
  .desktop-nav { display: none !important; }
  .mobile-menu-btn { display: flex !important; }
}
@media (min-width: 769px) {
  #mobileMenu { display: none !important; }
  .mobile-menu-btn { display: none !important; }
  .pub-footer .footer-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

/* ─── Skip Link ────────────────────────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100%; left: 0;
  background: var(--accent-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 9999;
  transition: top 0.2s;
  border-radius: 0 0 var(--radius-xs) 0;
}
.skip-link:focus { top: 0; }

/* ─── Utility Classes ─────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
