/* ============================================================
   La Belajar Admin — Design System
   Ported from design_handoff_la_belajar_admin
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Base */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-muted: #f9fafb;
  --border: #e6e8ec;
  --border-strong: #d1d5db;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;

  /* Sidebar */
  --sidebar-bg: #1e1b4b;
  --sidebar-bg-2: #1a1742;
  --sidebar-text: #c7d2fe;
  --sidebar-text-muted: #8a8cb8;
  --sidebar-active: #3b82f6;
  --sidebar-hover: rgba(255,255,255,0.06);
  --indigo: #1e1b4b;
  --indigo-2: #1a1742;
  --indigo-3: #312e81;

  /* Accents */
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: #eff6ff;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --success: #10b981;
  --success-soft: #ecfdf5;

  /* Subject colors */
  --subj-bm: #e74c3c;
  --subj-bm-soft: #fdecea;
  --subj-bi: #3b5bdb;
  --subj-bi-soft: #eaeefb;
  --subj-mt: #16a085;
  --subj-mt-soft: #e6f5f1;
  --subj-sains: #2e8b57;
  --subj-sains-soft: #e8f3ec;

  /* Tier */
  --tier-a: #10b981;
  --tier-b: #f59e0b;
  --tier-c: #ef4444;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 1px 1px rgba(15,23,42,0.03);
  --shadow: 0 1px 3px rgba(15,23,42,0.06), 0 4px 16px -4px rgba(15,23,42,0.06);
  --shadow-lg: 0 10px 25px -10px rgba(15,23,42,0.25), 0 4px 12px -4px rgba(15,23,42,0.08);
}

html.dark {
  --bg: #0b0d12;
  --surface: #14171f;
  --surface-muted: #11141b;
  --border: #232732;
  --border-strong: #2c313d;
  --text: #e6e8ee;
  --text-muted: #9aa3b2;
  --text-soft: #6b7280;
  --accent-soft: #1c2742;
  --danger-soft: #2a1517;
  --warning-soft: #2a2010;
  --success-soft: #122218;
  --subj-bm-soft: #2a1614;
  --subj-bi-soft: #161a2c;
  --subj-mt-soft: #112621;
  --subj-sains-soft: #11241a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 6px 18px -6px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 30px -10px rgba(0,0,0,0.6);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 14px; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
code, .mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- App Layout ---- */
.app-layout { display: flex; min-height: 100vh; }
.app-sidebar { width: 248px; flex: 0 0 248px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 10; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-content { padding: 28px 36px 48px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ---- Sidebar ---- */
.sb-brand { padding: 22px 20px 18px; display: flex; gap: 12px; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06); }
.sb-logo { width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: white; flex: 0 0 36px; }
.sb-title { font-weight: 600; color: #fff; font-size: 14px; line-height: 1.2; }
.sb-subtitle { font-size: 11.5px; color: var(--sidebar-text-muted); margin-top: 2px; }

.sb-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sb-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--sidebar-text-muted); padding: 12px 12px 6px; font-weight: 600; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: var(--sidebar-text); font-size: 13.5px; cursor: pointer; border: none; background: transparent;
  width: 100%; text-align: left; transition: background 120ms; text-decoration: none; }
.sb-item:hover { background: var(--sidebar-hover); color: #fff; }
.sb-item.active { background: rgba(59,130,246,0.18); color: #fff; box-shadow: inset 2px 0 0 var(--sidebar-active); }
.sb-item-icon { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; opacity: 0.9; }
.sb-item.active .sb-item-icon { opacity: 1; }
.sb-count { margin-left: auto; font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.08); color: var(--sidebar-text-muted); }
.sb-item.active .sb-count { background: rgba(255,255,255,0.18); color: #fff; }

.sb-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sb-version { font-size: 11px; color: var(--sidebar-text-muted); font-family: 'JetBrains Mono', monospace; }
.sb-theme { display: inline-flex; align-items: center; gap: 0; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04); border-radius: 999px; padding: 3px; }
.sb-theme-btn { background: transparent; border: 0; color: var(--sidebar-text-muted);
  padding: 4px 8px; border-radius: 999px; font-size: 11.5px; display: inline-flex; align-items: center; gap: 4px;
  transition: background 120ms, color 120ms; }
.sb-theme-btn:hover { color: #ddd; }
.sb-theme-btn.active { background: rgba(255,255,255,0.10); color: #fff; }

.sb-user { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06); }
.sb-user-name { font-size: 12px; font-weight: 500; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-role { font-size: 10.5px; color: var(--sidebar-text-muted); }
.sb-logout { background: transparent; border: 0; color: var(--sidebar-text-muted);
  padding: 6px; border-radius: 6px; display: inline-flex; transition: background 120ms, color 120ms; }
.sb-logout:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ---- Topbar ---- */
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 0 36px; height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.crumbs strong { color: var(--text); font-weight: 600; }
.crumbs svg { opacity: 0.5; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.tb-search { display: flex; align-items: center; gap: 8px; background: var(--surface-muted);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; width: 280px; color: var(--text-muted); }
.tb-search input { background: transparent; border: 0; outline: 0; color: var(--text);
  font: inherit; flex: 1; width: 100%; font-size: 13px; }
.tb-search kbd { font-size: 10px; padding: 2px 5px; border-radius: 4px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-soft); font-family: inherit; }
.tb-bell { background: transparent; border: 0; color: var(--text-muted); padding: 6px; border-radius: 6px;
  display: inline-flex; transition: background 120ms; }
.tb-bell:hover { background: var(--surface-muted); }
.avatar { width: 32px; height: 32px; border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }

/* ---- Page headings ---- */
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.page-sub { color: var(--text-muted); margin-top: 4px; font-size: 13.5px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: background 120ms, border-color 120ms, transform 80ms; text-decoration: none; }
.btn:hover { background: var(--surface-muted); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Login ---- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px; animation: fadein 200ms; }
.login-shell { width: 100%; max-width: 1100px; height: min(720px, calc(100vh - 48px));
  display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface);
  border-radius: 16px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lg); }

.lp-left { background: linear-gradient(140deg, var(--indigo-3) 0%, var(--indigo) 55%, var(--indigo-2) 100%);
  color: white; padding: 36px 44px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; }
.lp-dots { position: absolute; inset: 0; opacity: 0.25; }
.lp-glow { position: absolute; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.45), transparent 70%);
  top: -120px; right: -120px; }
.lp-eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(199,210,254,0.8); font-weight: 600; }
.lp-headline { font-size: 32px; font-weight: 600; line-height: 1.2; margin: 12px 0 14px; letter-spacing: -0.02em; }
.lp-headline span { color: #a5b4fc; }
.lp-body { color: rgba(199,210,254,0.85); font-size: 14px; line-height: 1.55; max-width: 380px; margin: 0; }
.lp-update { margin-top: 18px; max-width: 420px; padding: 12px 14px;
  border-radius: 8px; border: 1px solid rgba(199,210,254,0.22);
  background: rgba(15,23,42,0.18); box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); }
.lp-update-label { color: rgba(199,210,254,0.72); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; }
.lp-update-time { color: #fff; font-size: 14px; font-weight: 600; margin-top: 5px; }
.lp-update-pack { display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-top: 8px; color: rgba(224,231,255,0.86); font-size: 11.5px; }
.lp-update-pack span { padding: 2px 7px; border-radius: 999px;
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.10); }
.lp-update-pack strong { color: #fff; font-weight: 500; }
.lp-update-cache { margin-top: 8px; color: rgba(199,210,254,0.62); font-size: 11px; }
.lp-chips { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.lp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: 999px; font-size: 11.5px; color: white;
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.14); }
.lp-chip-dot { width: 7px; height: 7px; border-radius: 999px; }
.lp-footer { position: relative; z-index: 1; display: flex; justify-content: space-between;
  align-items: center; font-size: 11.5px; color: rgba(199,210,254,0.7); }

.lf-brand { display: inline-flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.lf-logo { width: 40px; height: 40px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; color: white;
  background: rgba(255,255,255,0.12); backdrop-filter: blur(6px); flex: 0 0 40px; }
.lf-brand-title { font-weight: 600; font-size: 15px; line-height: 1.2; color: white; }
.lf-brand-sub { font-size: 12px; color: rgba(199,210,254,0.85); margin-top: 2px; }

.lf-form { padding: 52px 56px; display: flex; flex-direction: column; justify-content: center; }
.lf-form-inner { max-width: 360px; width: 100%; margin: 0 auto; }
.lf-eyebrow { font-size: 12px; color: var(--text-muted); font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; }
.lf-heading { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 8px 0 6px; }
.lf-subhead { color: var(--text-muted); margin: 0 0 26px; font-size: 13.5px; }

.lf-label { font-size: 12.5px; font-weight: 500; margin-bottom: 6px; display: block; color: var(--text); }
.lf-input { width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; outline: 0;
  transition: border-color 120ms, box-shadow 120ms; }
.lf-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
.lf-input-wrap { position: relative; }
.lf-input-wrap .lf-input { padding-left: 38px; }
.lf-input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-soft); display: inline-flex; }
.lf-input-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--text-muted); padding: 6px; border-radius: 6px; cursor: pointer; }
.lf-input-toggle:hover { background: var(--surface-muted); }
.lf-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lf-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted);
  cursor: pointer; user-select: none; }
.lf-check input { accent-color: var(--accent); }
.lf-link { color: var(--accent); font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; }
.lf-link:hover { text-decoration: underline; }
.lf-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: background 120ms, transform 80ms; cursor: pointer; }
.lf-btn:hover { background: var(--surface-muted); }
.lf-btn:active { transform: translateY(1px); }
.lf-btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.lf-btn-primary:hover { background: var(--accent-hover); }
.lf-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.lf-divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted);
  font-size: 12px; margin: 18px 0; }
.lf-divider::before, .lf-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.lf-error { display: none; padding: 10px 12px; border-radius: 8px;
  background: color-mix(in oklab, var(--danger) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--danger) 30%, var(--border));
  color: var(--danger); font-size: 12.5px; align-items: center; gap: 8px; margin-bottom: 14px; }
.lf-error.show { display: flex; animation: shake 280ms; }
.lf-field { margin-bottom: 14px; }

/* ---- Animations ---- */
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-3px)} 75%{transform:translateX(3px)} }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }

/* ---- Blazor error UI ---- */
.blazor-error-boundary { background: #b32121; padding: 1rem 1rem 1rem 3.7rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred."; }
#blazor-error-ui { display: none; }

/* ---- Stat grid (for dashboard) ---- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-label { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.stat-icon { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); border-radius: 8px; }
.stat-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-top: 10px; }

/* ---- Tables ---- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl thead th { text-align: left; font-weight: 500; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted);
  padding: 11px 14px; background: var(--surface-muted); border-bottom: 1px solid var(--border); }
table.tbl tbody td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--surface-muted); }

/* ---- Pills & badges ---- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; font-size: 11.5px;
  border-radius: 999px; font-weight: 500; line-height: 1.6; }
.mono-tag { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 11.5px;
  color: var(--text-muted); padding: 2px 6px; border-radius: 5px; background: var(--surface-muted); border: 1px solid var(--border); }

/* ---- Chips ---- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 500; border: none; background: transparent; color: var(--text-muted);
  cursor: pointer; transition: background 120ms, color 120ms; white-space: nowrap; }
.chip:hover { background: var(--surface-muted); color: var(--text); }
.chip.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.chip-dot { width: 7px; height: 7px; border-radius: 999px; flex: 0 0 7px; }

/* ---- Modals ---- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadein 150ms; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; display: flex; flex-direction: column;
  max-height: calc(100vh - 48px); animation: modalIn 200ms; }
.modal.modal-lg { max-width: 620px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px;
  border-bottom: 1px solid var(--border); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px;
  border-top: 1px solid var(--border); gap: 12px; }

@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---- Row actions ---- */
.row-actions { display: inline-flex; gap: 2px; }

/* ---- Stepper ---- */
.steps { display: flex; align-items: center; gap: 0; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.step.active { color: var(--accent); font-weight: 500; }
.step.done { color: var(--success); }
.step-num { width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; background: var(--surface-muted); border: 1px solid var(--border); color: var(--text-muted); }
.step.active .step-num { background: var(--accent); color: white; border-color: var(--accent); }
.step.done .step-num { background: var(--success); color: white; border-color: var(--success); }
.step-line { flex: 1; height: 1px; background: var(--border); margin: 0 10px; min-width: 16px; }

/* ---- Dropzone ---- */
.dropzone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 40px 24px;
  text-align: center; cursor: pointer; transition: border-color 120ms, background 120ms; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; margin: 0 auto 14px; }

/* ---- Status dots ---- */
.status-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 999px; }
.status-pub::before { background: var(--success); } .status-pub { color: var(--success); }
.status-draft::before { background: var(--warning); } .status-draft { color: var(--warning); }
.status-rev::before { background: var(--danger); } .status-rev { color: var(--danger); }

/* ---- Toast ---- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex;
  flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 10px;
  color: white; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); pointer-events: auto;
  white-space: nowrap; max-width: 420px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }

/* ---- Loading state ---- */
.loading-state { display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 24px; }
.loading-spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 999px; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Empty state ---- */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px 24px; color: var(--text); }
.empty-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--surface-muted);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); }

/* ---- Mobile hamburger (inline in topbar) ---- */
.mobile-menu-btn { display: none; background: transparent; border: none;
  color: var(--text-muted); padding: 6px; border-radius: 6px; flex: 0 0 auto; margin-right: 4px;
  align-items: center; justify-content: center; transition: background 120ms; }
.mobile-menu-btn:hover { background: var(--surface-muted); }

/* ---- Sidebar close button (mobile only) ---- */
.sb-close { display: none; background: transparent; border: 0; color: var(--sidebar-text-muted);
  padding: 4px; border-radius: 6px; margin-left: auto; flex: 0 0 auto;
  align-items: center; justify-content: center; transition: background 120ms, color 120ms; }
.sb-close:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ---- Sidebar backdrop ---- */
.mobile-overlay { display: none; position: fixed; inset: 0; z-index: 70;
  background: rgba(15,23,42,0.45); backdrop-filter: blur(2px); animation: fadein 150ms; }

/* ---- Responsive: ≤1100px — stat grid 2-col ---- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- Responsive: ≤900px — sidebar drawer + tablet ---- */
@media (max-width: 900px) {
  .app-sidebar { position: fixed; top: 0; left: 0; height: 100vh;
    transform: translateX(-100%);
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.3, 1);
    z-index: 80; box-shadow: 0 0 40px rgba(0,0,0,0.4); }
  .app-sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: inline-flex; }
  .mobile-overlay { display: block; }
  .sb-close { display: inline-flex; }

  .app-content { padding: 24px 18px 36px; }
  .topbar { padding: 0 18px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table.tbl { min-width: 720px; }

  .steps { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 14px; }
  .step-line { min-width: 20px; }

  .modal { max-width: calc(100vw - 24px); }

  .login-shell { grid-template-columns: 1fr; height: auto; }
  .login-shell .lp-left { display: none; }
  .lf-form { padding: 36px 28px; }
}

/* ---- Responsive: ≤560px — small phones ---- */
@media (max-width: 560px) {
  .crumbs { display: none; }
  .tb-search { display: none; }

  .app-content { padding: 18px 14px 28px; }
  .topbar { height: 48px; }
  .page-title { font-size: 20px; }

  .page-header .btn { width: 100%; justify-content: center; }

  .filter-bar { flex-direction: column; align-items: stretch; }

  .stat-value { font-size: 22px; }
  .card-pad { padding: 14px 16px; }

  .toast-container { right: 0; left: 0; bottom: 0; padding: 0; gap: 0; }
  .toast { border-radius: 0; max-width: 100%; width: 100%; }

  .row-actions { opacity: 1 !important; }
  .row-actions button { opacity: 1 !important; }

  .modal-body { padding: 14px 16px; }
  .modal-foot { flex-direction: column; gap: 8px; }
  .modal-foot > * { width: 100%; }
  .modal-foot .btn { justify-content: center; }
}
