:root {
  --primary: #2563EB;
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); }

.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width); background: var(--sidebar-bg);
  display: flex; flex-direction: column; position: fixed; height: 100vh; z-index: 100;
}
.sidebar-brand {
  padding: 1.5rem; font-size: 1.25rem; font-weight: 700;
  color: white; border-bottom: 1px solid #334155; display: flex; align-items: center;
}
.sidebar-nav { padding: 1rem 0; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.5rem; color: var(--sidebar-text);
  text-decoration: none; transition: all 0.2s; font-size: 0.9rem;
}
.nav-link i { font-size: 1.1rem; }
.nav-link:hover, .nav-link.active { color: var(--sidebar-active); background: rgba(255,255,255,0.08); }
.nav-link.active { border-left: 3px solid var(--primary); }

.main-content { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-height); background: var(--card-bg);
  border-bottom: 1px solid #e2e8f0; display: flex; align-items: center;
  justify-content: space-between; padding: 0 2rem; position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-weight: 600; font-size: 0.85rem; letter-spacing: 0.05em; color: #64748b; }
.topbar-user { display: flex; align-items: center; font-size: 0.9rem; color: #64748b; }

.page-content { padding: 2rem; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--card-bg); border-radius: 12px; padding: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.4rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.85rem; color: #64748b; margin-top: 0.25rem; }

.card { background: var(--card-bg); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: none; }
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid #f1f5f9; background: transparent; }

.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; padding: 0.75rem 1.5rem; }
.table td { padding: 1rem 1.5rem; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ─── Tabs (shared) — underline-style active, used by /exports, /catalogue, … ─── */
.tabs, .tabs-row { display: flex; gap: 0.25rem; border-bottom: 1px solid #e2e8f0; margin-bottom: 1rem; }
.tabs .tab, .tabs-row .tab { background: transparent; border: none; padding: 0.6rem 1rem; cursor: pointer; color: #475569; font-weight: 600; font-size: 0.9rem; border-bottom: 2px solid transparent; transition: color 0.12s, border-color 0.12s; display: inline-flex; align-items: center; gap: 0.4rem; }
.tabs .tab:hover, .tabs-row .tab:hover { color: #1e293b; }
.tabs .tab.active, .tabs-row .tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .tab i, .tabs-row .tab i { font-size: 0.95rem; }

/* ─── Modal — shared shell. Overrides Bootstrap's plain black .modal-backdrop
       so our own dialogs render with a white card on a dim navy overlay. */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.6); opacity: 1; display: flex; align-items: center; justify-content: center; z-index: 1050; padding: 1rem; }
.modal-card { background: white; border-radius: 12px; padding: 1.5rem; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(2,6,23,0.45); }
.modal-card.large, .modal-card-wide { max-width: 720px; }
.modal-card.xlarge { max-width: 920px; }
.modal-card h3 { font-size: 1.1rem; font-weight: 700; color: #0f172a; margin: 0 0 1rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* ─── Form fields — shared label + input spacing for our modal/page forms. */
.form-field { margin-bottom: 0.75rem; }
.form-field > label { display: block; font-weight: 600; font-size: 0.85rem; color: #475569; margin-bottom: 0.3rem; }

/* ─── Layout helpers — two-column form grid used in modal editors. */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
