/* ==========================================================================
   Design tokens — charte graphique inchangée (orange/vert), système étendu.
   ========================================================================== */
:root {
  --primary: #e4572e;
  --primary-dark: #b6431e;
  --primary-wash: #fdf0ec;
  --secondary: #2d9d6e;
  --secondary-wash: #eaf7f1;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --sidebar: #17171a;
  --sidebar-hover: #232326;
  --text: #1f1f1f;
  --text-muted: #6b6b6b;
  --text-faint: #9a9a9a;
  --border: #e8e8ea;
  --grid: #eef0f2;
  --danger: #d64545;
  --danger-wash: #fbeaea;
  --warning: #e8a93b;
  --warning-wash: #fbf1de;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.05);
  --shadow-pop: 0 12px 32px rgba(20, 20, 20, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }

/* ==========================================================================
   Login
   ========================================================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.12), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(0,0,0,0.15), transparent 50%),
    linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 20px;
}

/* Animated backdrop — drifting blobs + a slow-orbiting ring of delivery/food
   glyphs, evoking "food moving across the city" without being literal art. */
.login-decor { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.22), rgba(255,255,255,0) 70%);
  animation: blob-drift 22s ease-in-out infinite;
}
.blob.b1 { width: 420px; height: 420px; top: -120px; left: -100px; animation-duration: 26s; }
.blob.b2 { width: 320px; height: 320px; bottom: -80px; right: -60px; animation-duration: 30s; animation-delay: -6s; }
.blob.b3 { width: 220px; height: 220px; bottom: 10%; left: 8%; animation-duration: 20s; animation-delay: -3s; }

@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -24px) scale(1.06); }
  66% { transform: translate(-20px, 18px) scale(0.96); }
}

.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 640px;
  height: 640px;
  margin: -320px 0 0 -320px;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.18);
  animation: orbit-spin 60s linear infinite;
}
.orbit-ring.r2 { width: 460px; height: 460px; margin: -230px 0 0 -230px; animation-duration: 44s; animation-direction: reverse; border-style: dotted; }

@keyframes orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.float-icon {
  position: absolute;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 14px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  animation: icon-float 7s ease-in-out infinite;
}
.float-icon svg { width: 20px; height: 20px; }
.float-icon.i1 { top: 14%; left: 12%; animation-delay: 0s; }
.float-icon.i2 { top: 22%; right: 14%; animation-delay: -2s; width: 38px; height: 38px; }
.float-icon.i3 { bottom: 18%; left: 16%; animation-delay: -4s; width: 40px; height: 40px; }
.float-icon.i4 { bottom: 24%; right: 10%; animation-delay: -1.2s; }
.float-icon.i5 { top: 48%; left: 5%; animation-delay: -3.4s; width: 34px; height: 34px; opacity: .8; }

@keyframes icon-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(-6deg); }
}

@media (prefers-reduced-motion: reduce) {
  .blob, .orbit-ring, .float-icon { animation: none; }
}

.login-card {
  background: var(--surface);
  padding: 44px 40px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-pop);
  position: relative;
  z-index: 1;
}

.login-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 20px rgba(228, 87, 46, 0.35);
}

.login-card h1 {
  font-size: 21px;
  font-weight: 800;
  margin: 0 0 4px;
  text-align: center;
  letter-spacing: -0.01em;
}

.login-card p.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 14px;
}

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

.sidebar {
  width: 240px;
  background: var(--sidebar);
  color: #fff;
  padding: 20px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.18s ease;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar.collapsed { width: 76px; padding-left: 12px; padding-right: 12px; }

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 22px 6px;
}

.sidebar .brand .name { white-space: nowrap; }

.sidebar .collapse-toggle {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #8b8b90;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  flex-shrink: 0;
}
.sidebar .collapse-toggle:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar .collapse-toggle svg { width: 16px; height: 16px; }
.sidebar.collapsed .collapse-toggle { margin-left: 0; }
.sidebar .collapse-toggle svg { transition: transform 0.18s ease; }
.sidebar.collapsed .collapse-toggle svg { transform: rotate(180deg); }

.sidebar.collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.sidebar.collapsed .brand .name,
.sidebar.collapsed .nav-label,
.sidebar.collapsed nav a .label,
.sidebar.collapsed nav a .count {
  display: none;
}
.sidebar.collapsed nav a { justify-content: center; padding: 11px; }
.sidebar.collapsed .who-row { justify-content: center; }

.sidebar .brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.sidebar .brand .name {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.sidebar .brand .name small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: #8b8b90;
  letter-spacing: 0.02em;
}

.sidebar .nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6c6c70;
  font-weight: 700;
  padding: 14px 12px 6px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #b8b8bc;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 2px;
  position: relative;
}

.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }

.sidebar nav a .count {
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  color: #d8d8db;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar nav a:hover { background: var(--sidebar-hover); color: #fff; }

.sidebar nav a.active {
  background: rgba(228, 87, 46, 0.16);
  color: #fff;
}
.sidebar nav a.active svg { opacity: 1; color: var(--primary); }
.sidebar nav a.active .count { background: var(--primary); color: #fff; }

.sidebar .footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar .footer .who-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
}

.sidebar .footer .avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar .footer .who { min-width: 0; flex: 1; }
.sidebar .footer .who .name { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .footer .who .role { font-size: 11.5px; color: #8b8b90; }

.sidebar .footer form { width: 100%; }

.logout-btn {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #d8d8db;
  cursor: pointer;
  padding: 9px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
}
.logout-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.logout-btn:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.sidebar.collapsed .who-row .who { display: none; }
.sidebar.collapsed .logout-btn .label { display: none; }
.sidebar.collapsed .logout-btn { padding: 9px; }

.main {
  flex: 1;
  padding: 30px 40px 60px;
  min-width: 0;
}

.page-container {
  max-width: none;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 20px;
}

.topbar .titles h1 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.topbar .titles p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.topbar .actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.topbar form { margin: 0; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background 0.12s ease, transform 0.05s ease;
  font-family: inherit;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }

.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-wash); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b83636; }
.btn-success { background: var(--secondary); }
.btn-success:hover { background: #22815a; }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--surface);
  font-family: inherit;
  color: var(--text);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-wash);
}
.field .error { color: var(--danger); font-size: 12.5px; margin-top: 5px; font-weight: 600; }

.field-password { position: relative; }
.field-password input { padding-right: 42px; }
.field-password .toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
}
.field-password .toggle-password:hover { color: var(--text); background: var(--grid); }
.field-password .toggle-password svg { width: 17px; height: 17px; }
.field-password .toggle-password .icon-off { display: none; }
.field-password.is-visible .toggle-password .icon-on { display: none; }
.field-password.is-visible .toggle-password .icon-off { display: block; }

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 600;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.alert-success { background: var(--secondary-wash); color: #1f7a53; }
.alert-error { background: var(--danger-wash); color: var(--danger); }

/* ==========================================================================
   KPI / stat tiles
   ========================================================================== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-tile {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.kpi-tile .kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-tile .icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-wash);
  color: var(--primary);
  flex-shrink: 0;
}
.kpi-tile .icon svg { width: 16px; height: 16px; }
.kpi-tile .icon.green { background: var(--secondary-wash); color: var(--secondary); }
.kpi-tile .icon.amber { background: var(--warning-wash); color: var(--warning); }
.kpi-tile .icon.red { background: var(--danger-wash); color: var(--danger); }

.kpi-tile .delta {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.kpi-tile .delta.up { background: var(--secondary-wash); color: #1f7a53; }
.kpi-tile .delta.down { background: var(--danger-wash); color: var(--danger); }
.kpi-tile .delta.flat { background: var(--grid); color: var(--text-muted); }
.kpi-tile .delta svg { width: 10px; height: 10px; }

.kpi-tile .value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.kpi-tile .label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 5px;
  font-weight: 600;
}

.kpi-tile .spark { margin-top: 12px; }

/* ==========================================================================
   Cards & panels
   ========================================================================== */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  margin-bottom: 22px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.card-head h2 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.card-head p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-head a.see-all {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}
.card-head a.see-all:hover { color: var(--primary-dark); }

.dash-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 980px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Trend chart (SVG line + area, inline)
   ========================================================================== */
.trend-chart { width: 100%; }
.trend-chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.trend-chart .area { fill: var(--primary); opacity: 0.08; }
.trend-chart .line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trend-chart .dot { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.trend-chart .axis-label { fill: var(--text-faint); font-size: 10.5px; font-family: inherit; }

.spark-svg .line { fill: none; stroke: var(--primary); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.spark-svg .area { fill: var(--primary); opacity: 0.10; }
.spark-svg.green .line { stroke: var(--secondary); }
.spark-svg.green .area { fill: var(--secondary); }

/* ==========================================================================
   Status distribution bars
   ========================================================================== */
.status-list { display: flex; flex-direction: column; gap: 13px; }
.status-row { display: flex; align-items: center; gap: 12px; }
.status-row .status-name { width: 118px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.status-row .track { flex: 1; height: 8px; border-radius: 999px; background: var(--grid); overflow: hidden; }
.status-row .fill { height: 100%; border-radius: 999px; background: var(--primary); }
.status-row .count { width: 34px; text-align: right; flex-shrink: 0; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; font-size: 13.5px; }
th {
  color: var(--text-faint);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { border-bottom: 1px solid var(--grid); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .muted { color: var(--text-muted); font-size: 12px; }

.row-entity { display: flex; align-items: center; gap: 10px; }
.row-entity .avatar {
  width: 30px; height: 30px; border-radius: 999px; flex-shrink: 0;
  background: var(--primary-wash); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.row-entity .avatar img { width: 100%; height: 100%; border-radius: 999px; object-fit: cover; }
.row-entity .name { font-weight: 700; font-size: 13.5px; }

/* ==========================================================================
   Badges (status = reserved meaning, always icon + label)
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge svg, .badge .dot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.badge .dot { display: inline-block; }
.badge-warning { background: var(--warning-wash); color: #92650f; }
.badge-warning .dot { background: var(--warning); }
.badge-success { background: var(--secondary-wash); color: #1f7a53; }
.badge-success .dot { background: var(--secondary); }
.badge-danger { background: var(--danger-wash); color: var(--danger); }
.badge-danger .dot { background: var(--danger); }
.badge-muted { background: var(--grid); color: var(--text-muted); }
.badge-muted .dot { background: var(--text-faint); }
.badge-primary { background: var(--primary-wash); color: var(--primary-dark); }
.badge-primary .dot { background: var(--primary); }

/* ==========================================================================
   Ratings (stars — status-adjacent, never color-only: number ships beside)
   ========================================================================== */
.stars { display: inline-flex; align-items: center; gap: 2px; }
.stars svg { width: 14px; height: 14px; }
.stars .on { color: var(--warning); fill: var(--warning); }
.stars .off { color: var(--border); fill: var(--border); }
.rating-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }

/* ==========================================================================
   Filters (chips row, above content, scopes everything below)
   ========================================================================== */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.filters .filter-label { font-size: 12px; font-weight: 700; color: var(--text-faint); margin-right: 2px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--text); border-color: var(--text); color: #fff; }
.chip.active.warn { background: var(--danger); border-color: var(--danger); }

.filters select {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  font-family: inherit;
}

/* ==========================================================================
   Empty states
   ========================================================================== */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 52px 20px;
}
.empty .icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--grid); display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
}
.empty .icon svg { width: 20px; height: 20px; }
.empty .title { font-weight: 700; color: var(--text); font-size: 14px; }
.empty .desc { font-size: 12.5px; max-width: 320px; }

/* ==========================================================================
   Alert / notice list (dashboard right rail)
   ========================================================================== */
.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.notice .icon {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: var(--warning-wash); color: #92650f;
  display: flex; align-items: center; justify-content: center;
}
.notice .icon svg { width: 15px; height: 15px; }
.notice .icon.red { background: var(--danger-wash); color: var(--danger); }
.notice .body { flex: 1; min-width: 0; }
.notice .body .title { font-size: 13px; font-weight: 700; }
.notice .body .desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.notice .cta { font-size: 12px; font-weight: 800; color: var(--primary); flex-shrink: 0; align-self: center; }

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination { margin-top: 18px; display: flex; justify-content: center; }
.pagination nav { display: flex; }
.pagination span, .pagination a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-muted);
}
.pagination a:hover { background: var(--grid); color: var(--text); }
.pagination span[aria-current] span { background: var(--primary); color: #fff; border-radius: 8px; }

/* ==========================================================================
   Misc
   ========================================================================== */
.section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 12px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

.icon-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-wash); }
.icon-btn svg { width: 16px; height: 16px; }

/* ==========================================================================
   Modals — dialogs opened over the current page, driven by admin.js
   (data-modal-target / data-modal-close), no page navigation required.
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 19, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.modal-overlay.is-open { opacity: 1; pointer-events: auto; }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  width: 100%;
  max-width: 560px;
  max-height: min(720px, 90vh);
  display: flex;
  flex-direction: column;
  transform: translateY(14px) scale(0.97);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(.2,.9,.3,1.3), opacity 0.18s ease;
}
.modal-overlay.is-open .modal-box { transform: translateY(0) scale(1); opacity: 1; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-head .icon-wrap {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--primary-wash); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.modal-head .icon-wrap svg { width: 18px; height: 18px; }
.modal-head .titles { flex: 1; min-width: 0; }
.modal-head h3 { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.modal-head p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.modal-head .modal-close {
  background: transparent; border: none; color: var(--text-faint);
  cursor: pointer; padding: 7px; border-radius: 8px; flex-shrink: 0;
}
.modal-head .modal-close:hover { background: var(--grid); color: var(--text); }
.modal-head .modal-close svg { width: 17px; height: 17px; }

.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

body.modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .modal-overlay { padding: 12px; }
  .modal-box { max-height: 92vh; }
}
