/* EduSaaS — Pakistani emerald + gold, glass cards, RTL ready. Koi blue rang nahi. */
:root {
  --emerald: 158 64% 32%;
  --gold: 43 78% 46%;
  --bg: 150 24% 96%;
  --ink: 162 28% 12%;
  --muted: 160 9% 38%;
  --line: 152 16% 84%;
  --surface: 0 0% 100%;
  --glass: hsla(0, 0%, 100%, .7);
  --glass-strong: hsla(0, 0%, 100%, .88);
  --glass-border: hsla(0, 0%, 100%, .8);
  --danger: 0 62% 44%;
  --ok-soft: 152 48% 91%;
  --gold-soft: 44 92% 90%;
  --danger-soft: 0 78% 95%;
  --shadow: 0 1px 2px hsla(160, 40%, 10%, .05), 0 10px 30px hsla(158, 50%, 18%, .08);
  --radius: 12px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ur: 'Noto Nastaliq Urdu', 'Manrope', serif;
  --sb-w: 256px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --emerald: 158 56% 44%; --gold: 43 80% 55%;
  --bg: 162 32% 6%; --ink: 150 18% 92%; --muted: 155 10% 66%; --line: 160 18% 20%; --surface: 160 26% 10%;
  --glass: hsla(160, 30%, 12%, .66); --glass-strong: hsla(160, 30%, 11%, .92); --glass-border: hsla(150, 30%, 60%, .14);
  --ok-soft: 158 45% 15%; --gold-soft: 43 45% 16%; --danger-soft: 0 40% 17%; --danger: 0 70% 62%;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --emerald: 158 56% 44%; --gold: 43 80% 55%;
    --bg: 162 32% 6%; --ink: 150 18% 92%; --muted: 155 10% 66%; --line: 160 18% 20%; --surface: 160 26% 10%;
    --glass: hsla(160, 30%, 12%, .66); --glass-strong: hsla(160, 30%, 11%, .92); --glass-border: hsla(150, 30%, 60%, .14);
    --ok-soft: 158 45% 15%; --gold-soft: 43 45% 16%; --danger-soft: 0 40% 17%; --danger: 0 70% 62%;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 14px/1.5 var(--font); color: hsl(var(--ink)); min-height: 100vh;
  background-color: hsl(var(--bg));
  background-image: radial-gradient(60rem 40rem at 100% -10%, hsla(43, 80%, 55%, .13), transparent 60%),
                    radial-gradient(50rem 40rem at -10% 110%, hsla(158, 64%, 40%, .13), transparent 60%);
  background-attachment: fixed;
}
[dir="rtl"] body { font-family: var(--font-ur); line-height: 2; }
[dir="rtl"] .num, [dir="rtl"] td.num, [dir="rtl"] input[type="number"], [dir="rtl"] kbd { font-family: var(--font); }
a { color: hsl(var(--emerald)); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid hsl(var(--gold)); outline-offset: 2px; }
::selection { background: hsla(43, 80%, 50%, .3); }
input, select, textarea, button { font: inherit; color: inherit; }
input[type="checkbox"], input[type="radio"] { accent-color: hsl(var(--emerald)); width: 16px; height: 16px; }
h1, h2, h3 { line-height: 1.3; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 8px; top: -40px; z-index: 100; background: hsl(var(--gold)); color: #111; padding: 6px 10px; border-radius: 8px; }
.skip:focus { top: 8px; }
.muted { color: hsl(var(--muted)); }
.small { font-size: 12px; }
.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.flip { display: inline-block; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin;
  background: hsla(160, 58%, 12%, .95); color: hsl(150 22% 86%);
  padding: 14px 10px 28px; border-inline-end: 1px solid hsla(43, 80%, 50%, .2);
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 14px; border-bottom: 1px solid hsla(150, 30%, 60%, .15); margin-bottom: 10px; }
.brand img, .brand-mark { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex: none; }
.brand-mark { display: grid; place-items: center; background: hsl(var(--gold)); color: hsl(160 58% 12%); font-weight: 700; font-family: var(--font); }
.brand strong { display: block; color: #fff; font-size: 14px; line-height: 1.3; }
.brand small { color: hsl(150 15% 70%); font-size: 12px; }
.nav-link, .nav-group summary { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: inherit; cursor: pointer; font-size: 13.5px; text-decoration: none; }
.nav-group summary { list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-link:hover, .nav-group summary:hover { background: hsla(150, 30%, 60%, .1); text-decoration: none; }
.nav-link.active { background: hsla(43, 80%, 50%, .18); color: #fff; box-shadow: inset 3px 0 0 hsl(var(--gold)); }
[dir="rtl"] .nav-link.active { box-shadow: inset -3px 0 0 hsl(var(--gold)); }
.nav-link.sub { padding-inline-start: 40px; font-size: 13px; }
.nav .ti { font-size: 18px; opacity: .9; }
.chev { margin-inline-start: auto; transition: transform .15s; font-size: 14px !important; }
.nav-group[open] > summary .chev { transform: rotate(180deg); }
.soon { margin-inline-start: auto; font-style: normal; font-size: 10px; line-height: 16px; padding: 0 6px; border-radius: 6px; background: hsla(150, 30%, 60%, .14); color: hsl(150 15% 72%); font-family: var(--font); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 16px;
  background: var(--glass-strong); backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid hsl(var(--line));
}
.ctx { margin: 0; }
.ctx select { height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid hsl(var(--line)); background: hsl(var(--surface)); max-width: 230px; font-size: 13px; font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; background: hsl(var(--ok-soft)); color: hsl(var(--emerald)); font-weight: 600; font-size: 13px; }
.search { position: relative; flex: 1; max-width: 340px; margin: 0; }
.search .ti { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: hsl(var(--muted)); }
.search input { width: 100%; height: 34px; padding-inline: 32px 10px; border-radius: 9px; border: 1px solid hsl(var(--line)); background: hsl(var(--surface)); }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.top-actions form { margin: 0; }
.btn-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: hsl(var(--ink)); cursor: pointer; position: relative; text-decoration: none; }
.btn-icon:hover { background: hsla(158, 64%, 32%, .1); text-decoration: none; }
.btn-icon .ti { font-size: 19px; }
.bell b { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: hsl(var(--gold)); color: hsl(160 58% 12%); font: 700 10px/16px var(--font); }
.lang-btn { width: auto; padding: 0 10px; font-weight: 700; font-size: 13px; }
.usermenu { position: relative; }
.avatar { list-style: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: hsl(var(--emerald)); color: #fff; font: 700 13px var(--font); cursor: pointer; }
.avatar::-webkit-details-marker { display: none; }
.pop { position: absolute; inset-inline-end: 0; top: 42px; width: 250px; padding: 6px; z-index: 40; background: var(--glass-strong); }
.pop a, .pop button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; color: hsl(var(--ink)); cursor: pointer; text-align: start; text-decoration: none; }
.pop a:hover, .pop button:hover { background: hsla(158, 64%, 32%, .1); }
.pop form { margin: 0; }
.pop-head { padding: 8px 10px 10px; border-bottom: 1px solid hsl(var(--line)); margin-bottom: 4px; }
.pop-head small { display: block; color: hsl(var(--muted)); font-size: 12px; }

/* ---------- Content ---------- */
.content { padding: 12px 18px 40px; width: 100%; max-width: 1480px; }
.page-head { display: flex; align-items: center; gap: 8px; min-height: 34px; margin-bottom: 10px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 16px; font-weight: 700; }
.page-actions { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.card { background: var(--glass); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 16px; margin-bottom: 14px; }
.panel > h2, .panel-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { padding: 14px 16px; position: relative; overflow: hidden; }
.stat span { display: block; color: hsl(var(--muted)); font-size: 12.5px; }
.stat b { display: block; font: 700 22px/1.35 var(--font); }
.stat .ti { position: absolute; inset-inline-end: 12px; top: 12px; font-size: 22px; color: hsl(var(--gold)); }
.stat.income b { color: hsl(var(--emerald)); }

/* ---------- Forms ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; color: hsl(var(--muted)); margin-bottom: 12px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select, textarea {
  display: block; width: 100%; margin-top: 4px; height: 36px; padding: 0 10px; border: 1px solid hsl(var(--line)); border-radius: 8px;
  background: hsl(var(--surface)); color: hsl(var(--ink)); font-weight: 500; font-size: 13.5px;
}
[dir="rtl"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), [dir="rtl"] select { height: 40px; line-height: 1.6; }
textarea { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: hsl(var(--emerald)); box-shadow: 0 0 0 3px hsla(158, 64%, 32%, .18); }
input[readonly] { background: hsla(158, 20%, 50%, .06); }
.req { color: hsl(var(--danger)); }
.check { display: flex; align-items: center; gap: 8px; color: hsl(var(--ink)); font-weight: 500; }
.hint { display: block; font-weight: 400; font-size: 12px; color: hsl(var(--muted)); margin-top: 3px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.alert ul { margin: 0; padding-inline-start: 18px; }
.alert-error { background: hsl(var(--danger-soft)); color: hsl(var(--danger)); }
.alert-ok { background: hsl(var(--ok-soft)); color: hsl(var(--emerald)); }
.alert-warn { background: hsl(var(--gold-soft)); color: hsl(38 70% 28%); }
:root[data-theme="dark"] .alert-warn { color: hsl(43 80% 70%); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid hsl(var(--line)); background: hsl(var(--surface)); color: hsl(var(--ink)); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: hsl(var(--emerald)); text-decoration: none; }
.btn-primary { background: hsl(var(--emerald)); border-color: hsl(var(--emerald)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-gold { background: hsl(var(--gold)); border-color: hsl(var(--gold)); color: hsl(160 58% 10%); }
.btn-danger { color: hsl(var(--danger)); }
.btn-danger:hover { border-color: hsl(var(--danger)); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn .ti { font-size: 16px; }
.actions { display: flex; gap: 4px; flex-wrap: wrap; }
.actions form { margin: 0; display: inline; }
.btn-group { display: inline-flex; gap: 0; }
.btn-group .btn { border-radius: 0; margin-inline-start: -1px; }
.btn-group .btn:first-child { border-start-start-radius: 9px; border-end-start-radius: 9px; margin-inline-start: 0; }
.btn-group .btn:last-child { border-start-end-radius: 9px; border-end-end-radius: 9px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 10px; text-align: start; border-bottom: 1px solid hsl(var(--line)); vertical-align: middle; }
th { font-size: 12px; font-weight: 700; color: hsl(var(--muted)); background: hsla(158, 30%, 50%, .06); white-space: nowrap; }
tbody tr:hover { background: hsla(158, 64%, 32%, .04); }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; border-top: 2px solid hsl(var(--line)); }
.sort { color: inherit; }
.cell-sub { display: block; font-size: 12px; color: hsl(var(--muted)); }
tr.group-row td { font-weight: 700; background: hsla(158, 30%, 50%, .05); }
tr.inactive td { opacity: .55; }
.indent-1 { padding-inline-start: 26px !important; } .indent-2 { padding-inline-start: 44px !important; } .indent-3 { padding-inline-start: 62px !important; }

/* ---------- Bits ---------- */
.badge { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: hsla(158, 20%, 50%, .12); color: hsl(var(--muted)); white-space: nowrap; }
.badge-ok { background: hsl(var(--ok-soft)); color: hsl(var(--emerald)); }
.badge-warn { background: hsl(var(--gold-soft)); color: hsl(38 70% 30%); }
.badge-bad { background: hsl(var(--danger-soft)); color: hsl(var(--danger)); }
.badge-gold { background: hsl(var(--gold)); color: hsl(160 58% 10%); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid hsl(var(--line)); margin-bottom: 12px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: hsl(var(--muted)); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a.active { color: hsl(var(--emerald)); border-bottom-color: hsl(var(--gold)); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.toolbar label { margin: 0; min-width: 140px; }
.pagination { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.pagination a { min-width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0 8px; border: 1px solid hsl(var(--line)); border-radius: 7px; background: hsl(var(--surface)); text-decoration: none; font-family: var(--font); }
.pagination a.active { background: hsl(var(--emerald)); color: #fff; border-color: hsl(var(--emerald)); }
.pagination .muted { margin-inline-start: 8px; font-size: 12px; }
.empty { text-align: center; padding: 34px 16px; color: hsl(var(--muted)); }
.empty .ti { font-size: 34px; color: hsl(var(--gold)); }
.empty h3 { margin: 8px 0 4px; font-size: 15px; color: hsl(var(--ink)); }
.empty p { margin: 0 0 12px; }
kbd { display: inline-block; padding: 1px 7px; border: 1px solid hsl(var(--line)); border-bottom-width: 2px; border-radius: 6px; font: 600 11.5px var(--font); background: hsl(var(--surface)); white-space: nowrap; }
.chip-list { display: flex; gap: 4px; flex-wrap: wrap; }
.chip-list form { margin: 0; }
.role-chip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 4px 1px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: hsl(var(--ok-soft)); color: hsl(var(--emerald)); }
.role-chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 3px; line-height: 1; }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.modules .panel { margin: 0; }
.modules ul { list-style: none; margin: 0; padding: 0; }
.modules li { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px dashed hsl(var(--line)); font-size: 13px; }
.modules li:last-child { border-bottom: 0; }
.modules li kbd, .modules li .badge { margin-inline-start: auto; }

/* ---------- Toasts & dialogs ---------- */
.toasts { position: fixed; top: 60px; inset-inline-end: 16px; z-index: 90; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--glass-strong); backdrop-filter: blur(12px); border: 1px solid hsl(var(--line)); box-shadow: var(--shadow); border-inline-start: 4px solid hsl(var(--emerald)); }
.toast-error { border-inline-start-color: hsl(var(--danger)); }
.toast-error .ti-alert-circle { color: hsl(var(--danger)); }
.toast .ti-circle-check { color: hsl(var(--emerald)); }
.toast span { flex: 1; }
.toast button { border: 0; background: none; cursor: pointer; color: hsl(var(--muted)); }
.modal { border: 1px solid var(--glass-border); border-radius: 14px; padding: 18px; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: hsl(var(--surface)); color: hsl(var(--ink)); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { width: min(900px, calc(100vw - 24px)); }
.modal::backdrop { background: hsla(160, 40%, 5%, .45); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; font-size: 16px; flex: 1; }
.modal .form-actions { justify-content: flex-end; border-top: 1px solid hsl(var(--line)); padding-top: 12px; margin-top: 6px; }
.sc-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 55vh; overflow-y: auto; }
.sc-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 2px; border-bottom: 1px solid hsl(var(--line)); }
fieldset { border: 1px solid hsl(var(--line)); border-radius: 10px; padding: 10px 12px 0; margin: 0 0 12px; }
legend { font-size: 12px; font-weight: 700; color: hsl(var(--muted)); padding: 0 6px; }

/* ---------- Auth pages ---------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 16px; background-color: hsl(160 58% 10%); }
.auth-card { width: 100%; max-width: 420px; padding: 28px; border-top: 4px solid hsl(var(--gold)); background: var(--glass-strong); }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; }
.auth-card > p { margin-top: 0; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-brand .brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: hsl(var(--gold)); color: hsl(160 58% 12%); font-weight: 800; }
.auth-lang { position: fixed; top: 14px; inset-inline-end: 14px; margin: 0; }
.btn-block { width: 100%; height: 40px; }
.error-detail { white-space: pre-wrap; font-size: 12px; background: hsl(var(--danger-soft)); color: hsl(var(--danger)); padding: 10px; border-radius: 8px; }

/* ---------- Voucher print ---------- */
.voucher { max-width: 900px; margin: 0 auto; padding: 24px; background: hsl(var(--surface)); }
.v-head { display: flex; gap: 14px; align-items: center; border-bottom: 2px solid hsl(var(--emerald)); padding-bottom: 12px; margin-bottom: 12px; }
.v-head img { width: 56px; height: 56px; object-fit: contain; }
.v-head h2 { margin: 0; font-size: 18px; }
.v-title { text-align: center; margin: 10px 0; }
.v-title span { display: inline-block; padding: 4px 18px; border: 1px solid hsl(var(--gold)); border-radius: 20px; font-weight: 700; letter-spacing: .02em; }
.v-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 16px; margin-bottom: 12px; font-size: 13px; }
.v-meta b { color: hsl(var(--muted)); font-weight: 600; margin-inline-end: 6px; }
.v-words { margin: 10px 0; padding: 8px 12px; border-radius: 8px; background: hsla(158, 30%, 50%, .06); font-style: italic; }
.v-sign { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 54px; text-align: center; font-size: 12px; }
.v-sign div { border-top: 1px solid hsl(var(--ink)); padding-top: 6px; }
.v-stamp { color: hsl(var(--danger)); border: 2px solid hsl(var(--danger)); display: inline-block; padding: 2px 12px; border-radius: 6px; font-weight: 800; transform: rotate(-6deg); }

/* ---------- Voucher form lines ---------- */
.lines td { padding: 4px 6px; }
.lines input, .lines select { margin-top: 0 !important; }
.lines .w-amt { width: 150px; }
.totals-bar { display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; padding: 10px; font-weight: 700; }
.diff-bad { color: hsl(var(--danger)); }
.diff-ok { color: hsl(var(--emerald)); }

/* ---------- Mobile ---------- */
.scrim { display: none; position: fixed; inset: 0; background: hsla(160, 40%, 5%, .45); z-index: 50; }
.bottom-nav { display: none; position: fixed; inset-inline: 0; bottom: 0; z-index: 30; height: 62px; padding-bottom: env(safe-area-inset-bottom); background: var(--glass-strong); backdrop-filter: blur(14px); border-top: 1px solid hsl(var(--line)); justify-content: space-around; }
.bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: hsl(var(--muted)); background: none; border: 0; text-decoration: none; cursor: pointer; }
.bottom-nav .active { color: hsl(var(--emerald)); font-weight: 700; }
.bottom-nav .ti { font-size: 20px; }
@media (min-width: 1024px) {
  body.sb-collapsed .shell { grid-template-columns: minmax(0, 1fr); }
  body.sb-collapsed .sidebar { display: none; }
}
@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(84vw, 300px); z-index: 60; transform: translateX(-105%); transition: transform .2s ease; }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  body.sb-open .sidebar { transform: none; }
  body.sb-open .scrim { display: block; }
  .content { padding: 10px 10px 84px; }
  .search, .hide-sm { display: none; }
  .bottom-nav { display: flex; }
  .ctx select { max-width: 150px; }
  .topbar { padding: 0 8px; gap: 4px; }
  .v-sign { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Loading bar ---------- */
body.is-loading::before { content: ""; position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 200; background: linear-gradient(90deg, hsl(var(--emerald)), hsl(var(--gold))); animation: load 1.1s ease-in-out infinite; transform-origin: left; }
@keyframes load { 0% { transform: scaleX(.1); } 60% { transform: scaleX(.8); } 100% { transform: scaleX(1); opacity: .4; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .bottom-nav, .toasts, .no-print, .scrim, .pagination, .tabs { display: none !important; }
  body { background: #fff !important; color: #000; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; backdrop-filter: none; background: #fff; border: 0; }
  .voucher { padding: 0; }
  a { color: inherit; }
  th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
