/* AIScore — Shared Design System */

/* ── Page fade-in (prevents navigation flicker) ── */
@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body { animation: page-fade-in 0.12s ease; }
/* Fonts: Manrope (headings) + Inter (body) via Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

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

/* ── Design tokens ──────────────────────────────── */
:root {
  /* Brand — orange accent on deep navy */
  --primary:        #f97316;
  --primary-h:      #ea6c0c;
  --primary-light:  rgba(249,115,22,0.12);
  --secondary:      #3b82f6;
  --accent:         #f97316;

  /* Backgrounds — dark navy system */
  --bg:             #0b1221;
  --bg-dark:        #070d1a;
  --card:           #101c30;
  --card-dark:      #0d1628;

  /* Text */
  --text:           #e2e8f0;
  --text-muted:     #7e95b0;
  --text-subtle:    #4a6080;
  --text-on-dark:   #f1f5f9;

  /* UI */
  --border:         #1d3050;
  --border-dark:    #263a62;
  --error:          #ef4444;
  --error-light:    rgba(239,68,68,0.12);
  --success:        #22c55e;
  --success-light:  rgba(34,197,94,0.12);
  --warning:        #f59e0b;

  /* Radius */
  --radius-sm:      8px;
  --radius:         12px;
  --radius-lg:      18px;
  --radius-xl:      24px;

  /* Shadows — stronger for dark surfaces */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.25);
  --shadow:         0 4px 16px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.25);
  --shadow-lg:      0 10px 40px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.35);

  /* Nav */
  --nav-h:          60px;
  --sidebar-w:      220px;

  /* Typography */
  --font-sans:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading:   'Manrope', 'Inter', -apple-system, sans-serif;
}

/* ── Base ───────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  letter-spacing: -0.03em;
  line-height: 1.25;
}

/* ── Navigation ─────────────────────────────────── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(7,13,26,0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 200;
}

.topnav-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.topnav-sep { color: var(--border); font-size: 1.2rem; }

.topnav-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.topnav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topnav-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.topnav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: background 0.12s, color 0.12s;
}
.topnav-link:hover { background: var(--bg); color: var(--text); }

/* ── Language toggle ────────────────────────────── */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--card);
}
.lang-opt {
  padding: 0.22rem 0.6rem;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  letter-spacing: 0.04em;
}
.lang-opt:hover { color: var(--text); }
.lang-opt.lang-active {
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
}
.lang-sep {
  font-size: 0.72rem;
  color: var(--border);
  padding: 0 0.05rem;
  pointer-events: none;
  user-select: none;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.12s, transform 0.08s, box-shadow 0.12s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(249,115,22,0.3);
}
.btn-primary:hover { background: var(--primary-h); box-shadow: 0 4px 12px rgba(249,115,22,0.35); }
.btn-primary:disabled { background: var(--text-subtle); box-shadow: none; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: var(--card);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); border-color: #cbd5e1; }

.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover { background: #16a34a; }

/* ── Form elements ──────────────────────────────── */
label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.label-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: 0.3rem;
}

.label-required {
  color: var(--error);
  margin-left: 0.1rem;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.875rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--card);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-subtle);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}

input.field-error,
textarea.field-error,
select.field-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-light);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}

/* ── Status chips ───────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
  flex-shrink: 0;
}

.chip-applied           { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.chip-under_review      { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.chip-approved          { background: rgba(34,197,94,0.14);   color: #4ade80; }
.chip-rejected          { background: rgba(239,68,68,0.14);   color: #f87171; }
.chip-called            { background: rgba(139,92,246,0.15);  color: #c4b5fd; }
.chip-awaiting_payment  { background: rgba(245,158,11,0.15);  color: #fcd34d; }
.chip-paid              { background: rgba(34,197,94,0.14);   color: #4ade80; }
.chip-in_production     { background: rgba(99,102,241,0.15);  color: #a5b4fc; }
.chip-qc_review         { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.chip-qc_passed         { background: rgba(34,197,94,0.14);   color: #4ade80; }
.chip-qc_failed         { background: rgba(239,68,68,0.14);   color: #f87171; }
.chip-escalated         { background: rgba(239,68,68,0.18);   color: #fca5a5; }
.chip-retry             { background: rgba(249,115,22,0.15);  color: #fb923c; }
.chip-cancelled         { background: rgba(148,163,184,0.12); color: #94a3b8; }
.chip-ready_for_review_call { background: rgba(6,182,212,0.15); color: #22d3ee; }
.chip-completed             { background: linear-gradient(135deg, rgba(34,197,94,0.2) 0%, rgba(16,185,129,0.2) 100%); color: #34d399; border: 1px solid rgba(52,211,153,0.3); font-weight: 600; letter-spacing: 0.02em; }

/* ── View icon button ─────────────────────────────── */
.view-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.view-icon-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.07);
}

/* ── Spinner ────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ──────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.22s ease;
  max-width: 340px;
  pointer-events: auto;
}
.toast.success { background: #15803d; }
.toast.error   { background: #b91c1c; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Error / success banners ───────────────────── */
.error-banner {
  display: none;
  background: var(--error-light);
  border: 1.5px solid var(--error);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  color: #f87171;
  font-size: 0.875rem;
  margin-top: 1rem;
  line-height: 1.5;
}

.error-banner ul {
  margin-top: 0.4rem;
  margin-left: 1.25rem;
}

.error-banner li { margin-top: 0.15rem; }

/* ── Cards ──────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Empty state ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  opacity: 0.35;
}
.empty-state p { font-size: 0.9rem; }

/* ── Table base ─────────────────────────────────── */
.table-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--bg);
}

.table-meta-count { font-size: 0.8rem; color: var(--text-muted); }
.table-meta-count strong { color: var(--text); }

table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 0.65rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--bg);
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(249,115,22,0.04); }
tbody tr.clickable-row { cursor: pointer; }
tbody tr.clickable-row:hover { background: rgba(249,115,22,0.07); }
tbody tr.clickable-row:focus { outline: 2px solid var(--primary); outline-offset: -2px; background: rgba(249,115,22,0.07); }

td {
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  vertical-align: middle;
}

.td-company { font-weight: 600; }
.td-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }
.td-link { color: var(--primary); text-decoration: none; font-size: 0.8rem; }
.td-link:hover { text-decoration: underline; }

/* ── Filter chips ───────────────────────────────── */
.filter-chip {
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  transition: all 0.12s;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Search box ─────────────────────────────────── */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}
.search-box input {
  border: none;
  outline: none;
  background: none;
  font-size: 0.875rem;
  color: var(--text);
  width: 100%;
  padding: 0;
  box-shadow: none;
}
.search-box input::placeholder { color: var(--text-subtle); }
.search-icon { color: var(--text-muted); width: 16px; height: 16px; flex-shrink: 0; }

/* ── Modal ──────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--bg);
}

.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-header p  { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: background 0.1s, color 0.1s;
  display: flex;
  align-items: center;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body { padding: 1.25rem 1.5rem; }

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--bg);
}

/* ── Pagination ─────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--bg);
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-sans);
  transition: all 0.1s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.page-info { font-size: 0.8rem; color: var(--text-muted); margin-right: 0.5rem; }

/* ── Loading row ────────────────────────────────── */
.loading-row td {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* ── Section heading ────────────────────────────── */
.section-heading {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 1.75rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-heading svg { opacity: 0.6; }

/* ── Icon utilities (Lucide) ─────────────────── */
[data-lucide] {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke-width: 2;
}
.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }

/* ── Admin layout ───────────────────────────── */
.admin-layout {
  display: flex;
  padding-top: var(--nav-h);
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: var(--nav-h);
  left: 0;
  bottom: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
}
.admin-sidebar::-webkit-scrollbar { display: none; }

.admin-sidebar-body {
  padding: 1.25rem 0;
  flex: 1;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.75rem 1rem 0.25rem;
}

.sidebar-section {
  padding: 0 0.75rem;
  margin-bottom: 0.25rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
  cursor: pointer;
}
.sidebar-item:hover { background: var(--bg); }
.sidebar-item.active { background: var(--primary-light); color: var(--primary); }

.sidebar-count {
  margin-left: auto;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}
.sidebar-item.active .sidebar-count {
  background: var(--primary);
  color: #fff;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Collapse button at the bottom of sidebar */
.sidebar-collapse-btn-bottom {
  width: 36px;
  height: 36px;
  margin: 0 auto;
}

.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem 2rem 4rem;
  min-width: 0;
}

/* ── KPI Grid ───────────────────────────────── */
.kpi-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1100px) {
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .kpi-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

.kpi-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--kpi-color, var(--primary));
  position: relative;
  overflow: hidden;
}

.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.kpi-icon-bg {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  opacity: 0.08;
  color: var(--kpi-color, var(--primary));
}

/* ── Hamburger toggle button ─────────────────── */
.sidebar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.sidebar-hamburger:hover { background: var(--bg); color: var(--text); }

/* ── Sidebar overlay (mobile backdrop) ──────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.4);
  z-index: 140;
}
.sidebar-overlay.active { display: block; }

/* ── Sidebar collapse toggle (desktop) ──────── */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s, transform 0.2s;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover { background: var(--bg); color: var(--text); }
.admin-sidebar.collapsed .sidebar-collapse-btn { transform: rotate(180deg); }

.sidebar-top-bar {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem 0;
  gap: 0.5rem;
}

/* ── Collapsed sidebar (desktop) ────────────── */
.admin-sidebar.collapsed {
  width: 60px;
  overflow: visible;
}
.admin-sidebar.collapsed .admin-sidebar-body { padding: 0.75rem 0; }
.admin-sidebar.collapsed .sidebar-label { display: none; }
.admin-sidebar.collapsed .sidebar-section { padding: 0 0.35rem; }
.admin-sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 0.55rem;
  gap: 0;
}
.admin-sidebar.collapsed .sidebar-item .sidebar-text { display: none; }
.admin-sidebar.collapsed .sidebar-count { display: none; }
.admin-sidebar.collapsed .sidebar-footer { display: flex; padding: 0.75rem 0; }
.admin-sidebar.collapsed .sidebar-item { position: relative; }
.admin-sidebar.collapsed .sidebar-item:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--border-dark);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  z-index: 300;
  border: 1px solid var(--border);
}

.admin-main.sidebar-collapsed {
  margin-left: 60px;
}

/* ── Mobile responsive sidebar ───────────────── */
@media (max-width: 768px) {
  .sidebar-hamburger { display: flex; }

  .admin-sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    z-index: 150;
    box-shadow: none;
  }

  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .admin-sidebar.collapsed {
    width: var(--sidebar-w);
  }
  .admin-sidebar.collapsed .sidebar-label { display: block; }
  .admin-sidebar.collapsed .sidebar-section { padding: 0 0.75rem; }
  .admin-sidebar.collapsed .sidebar-item { justify-content: flex-start; padding: 0.5rem 0.75rem; gap: 0.6rem; }
  .admin-sidebar.collapsed .sidebar-item .sidebar-text { display: inline; }
  .admin-sidebar.collapsed .sidebar-count { display: inline-flex; }
  .admin-sidebar.collapsed .sidebar-footer { display: block; }
  .admin-sidebar.collapsed .sidebar-collapse-btn { display: flex; }

  .admin-main { margin-left: 0 !important; padding: 1.25rem 1rem 4rem; }

  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }

  .topnav { padding: 0 1rem; }
}

@media (max-width: 480px) {
  .kpi-grid-4 { grid-template-columns: 1fr 1fr; }
  .admin-main { padding: 1rem 0.75rem 4rem; }
}

/* ── Page header ────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.2rem;
}

/* ── Toolbar ────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.toolbar-right { margin-left: auto; display: flex; gap: 0.5rem; }

/* ── Action button (icon-only table actions) ── */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.1s, color 0.1s;
}
.action-btn:hover { background: var(--bg); color: var(--text); }
.action-btn.blue:hover { background: var(--primary-light); color: var(--primary); }
.action-btn.red:hover  { background: var(--error-light); color: var(--error); }

/* ── Score bar ───────────────────────────────── */
.score-wrap { display: flex; align-items: center; gap: 0.5rem; }
.score-bar-bg { width: 60px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; flex-shrink: 0; }
.score-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--primary), #fb923c); }
.score-val { font-size: 0.8rem; font-weight: 700; color: var(--text); min-width: 28px; }

/* ── Badge (simple status indicator) ─────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}
.badge-booked  { background: var(--success-light); color: #4ade80; }
.badge-waiting { background: rgba(245,158,11,0.15); color: #fbbf24; }
