/* ============================================================================
   SAVIQ Bakery — design system (single source for Blazor AND design/ previews)
   Tokens: SAVIQ brand tokens.css (Editorial Light for the app, Aurora for login/dark).
   Class vocabulary kept from TradeERP app.css (kpi-card, chip--*, t-num, empty-state,
   skel, sess-z, r80, pos-*) and the responsive rules from SchoolERP app.css.
   RTL first: only CSS logical properties, never left/right.
   ============================================================================ */

@font-face { font-family: "Vazirmatn"; src: url("fonts/Vazirmatn-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("fonts/Vazirmatn-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("fonts/Vazirmatn-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("fonts/Vazirmatn-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("fonts/Vazirmatn-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
/* Cairo (SIL OFL 1.1, fonts/Cairo-OFL.txt) — the face of RestaurantERP; bundled so the till looks the same offline. */
@font-face { font-family: "Cairo"; src: url("fonts/Cairo-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("fonts/Cairo-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("fonts/Cairo-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("fonts/Cairo-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("fonts/Cairo-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter-ExtraBold.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
    /* brand (never change) */
    --saviq-navy: #0B0F2A; --saviq-cobalt: #315BFF; --saviq-violet: #8A3FFC;
    --saviq-teal: #00D4B3; --saviq-sky: #63E9FF; --saviq-light: #F5F7FF; --saviq-slate: #94A3B8;
    --saviq-gradient: linear-gradient(90deg, #00D4B3 0%, #315BFF 55%, #8A3FFC 100%);
    --bakery-amber: #F59E0B;

    /* semantic — Editorial Light */
    --bg: #F2F3F7; --surface: #FFFFFF; --surface-2: #EEF1FB;
    --text: #0B0F2A; --text-muted: #55607A; --text-faint: #8A93A8;
    --border: #E3E7F2; --hairline: rgba(11, 15, 42, .16);
    --primary: #315BFF; --primary-hover: #2446D8; --on-primary: #FFFFFF; --primary-soft: #E9EEFF;
    --accent: #8A3FFC; --focus-ring: rgba(49, 91, 255, .35);
    --success: #00806C; --success-soft: #DDF7F1;
    --warning: #B45309; --warning-soft: #FEF3D7;
    --danger: #D92D20; --danger-soft: #FDE7E5;
    --amber: #F59E0B; --amber-ink: #92400E; --amber-soft: #FFF4DC;
    --violet-soft: #F1E8FF;

    --sidebar-bg: #0B0F2A; --sidebar-text: #A9B3D1; --sidebar-text-strong: #FFFFFF; --sidebar-w: 248px;

    --font-body: "Cairo", "Vazirmatn", "Inter", "Segoe UI", Tahoma, system-ui, sans-serif;
    --font-num: "Inter", "Cairo", "Vazirmatn", "Segoe UI", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
    --fs-display: 34px; --fs-h1: 24px; --fs-h2: 18px; --fs-h3: 16px;
    --fs-body: 15px; --fs-small: 13.5px; --fs-label: 12px;

    --radius-sm: 8px; --radius-md: 12px; --radius-lg: 20px; --radius-pill: 999px;
    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px;
    --shadow-card: 0 8px 24px rgba(11, 15, 42, .08);
    --shadow-sm: 0 1px 2px rgba(11, 15, 42, .05);
    --control-height: 44px;
    --topbar-h: 60px; --bottomnav-h: 64px;
}

/* Kurdish (Sorani): Cairo lacks ڕ ڵ ۆ ێ ە and a word drawn from two fonts breaks its joining. */
html[lang="ku"] {
    --font-body: "Vazirmatn", "Inter", "Segoe UI", Tahoma, system-ui, sans-serif;
    --font-num: "Inter", "Vazirmatn", "Segoe UI", system-ui, sans-serif;
    --mud-typography-default-family: "Vazirmatn", "Inter", "Segoe UI", Tahoma, sans-serif;
    --mud-typography-button-family: "Vazirmatn", "Inter", "Segoe UI", Tahoma, sans-serif;
    --mud-typography-h6-family: "Vazirmatn", "Inter", "Segoe UI", Tahoma, sans-serif;
}
html[lang="ku"] .r80 { font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif; }

[data-theme="dark"] {
    --bg: #0B0F2A; --surface: #141A3C; --surface-2: #1B2250;
    --text: #FFFFFF; --text-muted: #94A3B8; --text-faint: #6B7699;
    --border: #232B5C; --hairline: rgba(255, 255, 255, .14);
    --primary: #315BFF; --primary-hover: #4A70FF; --primary-soft: rgba(49, 91, 255, .22);
    --accent: #63E9FF; --focus-ring: rgba(99, 233, 255, .45);
    --success: #00D4B3; --success-soft: rgba(0, 212, 179, .16);
    --warning: #F5A524; --warning-soft: rgba(245, 165, 36, .16);
    --danger: #FF6B6B; --danger-soft: rgba(255, 107, 107, .16);
    --amber: #F5A524; --amber-ink: #FFD08A; --amber-soft: rgba(245, 158, 11, .16);
    --violet-soft: rgba(138, 63, 252, .2);
    --sidebar-bg: #060918;
    --shadow-card: 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg); color: var(--text);
    font-family: var(--font-body); font-size: var(--fs-body); line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }

/* ---- Typography ---- */
.t-display { font-size: var(--fs-display); font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.t-h1 { font-size: var(--fs-h1); font-weight: 800; margin: 0; }
.t-h2 { font-size: var(--fs-h2); font-weight: 700; margin: 0; }
.t-body { font-size: var(--fs-body); }
.t-label { font-size: var(--fs-label); font-weight: 600; color: var(--text-muted); }
.t-muted { color: var(--text-muted); }
/* Money / quantities: always LTR + tabular figures even inside an RTL page (TradeERP rule). */
/* inline-block: the LTR direction must not re-align a block-level number against its column. */
.t-num { display: inline-block; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; direction: ltr; unicode-bidi: isolate; }
td.t-num, th.t-num { direction: inherit; display: table-cell; }
/* Editorial eyebrow: mono, tracked, numbered — "02 / المبيعات". */
.eyebrow { font-family: "Inter", "Cairo", "Vazirmatn", sans-serif; font-weight: 600; font-size: 11.5px; letter-spacing: .06em; color: var(--text-muted); text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.eyebrow::after { content: ""; flex: 1; border-block-start: 1px solid var(--hairline); }
.pos-txt--red { color: var(--danger); font-weight: 700; }
.pos-txt--green { color: var(--success); font-weight: 700; }

/* ============================================================================
   App shell
   ============================================================================ */
.app-shell { display: flex; min-height: 100vh; background: var(--bg); }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
    inline-size: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
    background: var(--sidebar-bg); color: var(--sidebar-text);
    display: flex; flex-direction: column;
    position: sticky; inset-block-start: 0; block-size: 100vh; overflow-y: auto;
}
/* Logo: fixed LTR, never mirrored, clear space = padding around it. */
.sidebar__brand { padding: 22px 22px 14px; direction: ltr; text-align: start; }
.sidebar__brand img { block-size: 34px; inline-size: auto; display: block; }
.sidebar__product { padding: 0 22px 16px; font-size: 12.5px; color: var(--sidebar-text); display: flex; align-items: center; gap: 8px; border-block-end: 1px solid rgba(255, 255, 255, .08); }
.sidebar__product::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--bakery-amber); }
.sidebar__nav { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-family: var(--font-body); font-weight: 700; font-size: 11px; letter-spacing: .04em; color: #6B7699; padding: 14px 12px 6px; }
.nav-item {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px;
    border-radius: var(--radius-md); color: var(--sidebar-text); font-weight: 600; font-size: 14.5px;
    position: relative; transition: background .12s, color .12s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item svg { inline-size: 20px; block-size: 20px; flex: 0 0 auto; }
.sidebar__footer { padding: 14px 22px 18px; font-size: 11.5px; color: #6B7699; border-block-start: 1px solid rgba(255, 255, 255, .08); }
.sidebar__footer::before { content: ""; display: block; block-size: 3px; border-radius: 3px; background: var(--saviq-gradient); margin-block-end: 10px; inline-size: 44px; }

.topbar {
    block-size: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 20px;
    background: var(--surface); border-block-end: 1px solid var(--border);
    position: sticky; inset-block-start: 0; z-index: 20;
}
.topbar__title { font-weight: 700; }
.topbar__spacer { flex: 1; }
.topbar__date { font-size: 13px; color: var(--text-muted); }
.icon-btn {
    inline-size: 44px; block-size: 44px; display: grid; place-items: center; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); border-radius: var(--radius-md); cursor: pointer;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.nav-burger { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); min-height: 44px; }
[dir="rtl"] .user-chip { padding: 4px 4px 4px 10px; }
.avatar { inline-size: 34px; block-size: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.u-name { display: block; font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.u-role { display: block; font-size: 11.5px; color: var(--text-muted); }
.logout-btn { border: 0; background: none; color: var(--danger); font: inherit; font-weight: 700; cursor: pointer; min-height: 44px; padding: 0 10px; border-radius: var(--radius-md); }
.logout-btn:hover { background: var(--danger-soft); }

.content { padding: 24px; flex: 1; max-inline-size: 1480px; inline-size: 100%; margin-inline: auto; }
.nav-backdrop { display: none; }

/* Phone bottom navigation — derived from the same MenuCatalog as the sidebar. */
.bottom-nav { display: none; }

/* ---- Page head ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-block-end: 20px; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-head .eyebrow { margin-block-end: 6px; min-inline-size: 220px; }

/* ---- Cards / grids ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 18px; }
.card--flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 14px; }
.card--flush .card-head { padding: 16px 18px 0; }
.card-title { font-weight: 700; font-size: var(--fs-h3); }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.grid-main { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---- KPI ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-block-end: 16px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; color: inherit; position: relative; overflow: hidden; }
.kpi-card__top { display: flex; align-items: center; gap: 12px; }
.kpi-card__icon { inline-size: 44px; block-size: 44px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.kpi-card__icon svg { inline-size: 22px; block-size: 22px; }
.kpi-card__label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.kpi-card__value { font-size: clamp(19px, 2.1vw, 25px); font-weight: 800; line-height: 1.2; white-space: nowrap; }
.kpi-card__top > div:last-child { min-inline-size: 0; }
.kpi-card__value small { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.kpi-card__delta { font-size: 12px; font-weight: 700; }
.kpi-card__delta.up { color: var(--success); }
.kpi-card__delta.down { color: var(--danger); }
.kpi-card--hero { background: var(--saviq-navy); color: #fff; border-color: var(--saviq-navy); }
.kpi-card--hero .kpi-card__label { color: #A9B3D1; }
.kpi-card--hero::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; block-size: 3px; background: var(--saviq-gradient); }
[data-theme="dark"] .kpi-card--hero { background: linear-gradient(135deg, #1B2250, #141A3C); border-color: var(--primary); }
.tint-blue { background: var(--primary-soft); color: var(--primary); }
.tint-green { background: var(--success-soft); color: var(--success); }
.tint-amber { background: var(--amber-soft); color: var(--amber-ink); }
.tint-red { background: var(--danger-soft); color: var(--danger); }
.tint-violet { background: var(--violet-soft); color: var(--accent); }

/* ---- Chips ---- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip--green { background: var(--success-soft); color: var(--success); }
.chip--amber { background: var(--warning-soft); color: var(--warning); }
.chip--red { background: var(--danger-soft); color: var(--danger); }
.chip--blue { background: var(--primary-soft); color: var(--primary); }
.chip--violet { background: var(--violet-soft); color: var(--accent); }
.chip--gray { background: var(--surface-2); color: var(--text-muted); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--control-height); padding: 0 18px; border-radius: var(--radius-md);
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap;
    transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { inline-size: 18px; block-size: 18px; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { filter: brightness(.93); color: #fff; border-color: var(--danger); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); border-color: transparent; }
.btn--amber { background: var(--amber); border-color: var(--amber); color: #3B2300; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn--lg { min-height: 56px; font-size: 17px; padding: 0 26px; }
.btn--block { inline-size: 100%; }

/* ---- Forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; min-inline-size: 0; }
.field > label, .field__label { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.field__hint { font-size: 12px; color: var(--text-faint); }
.field__error { font-size: 12px; color: var(--danger); font-weight: 600; }
.input, .select, .textarea {
    inline-size: 100%; min-height: var(--control-height); padding: 8px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
}
.textarea { min-height: 88px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--focus-ring); border-color: var(--primary); }
.input.t-num { text-align: start; }
.input--lg { min-height: 56px; font-size: 22px; font-weight: 800; }
.input.invalid { border-color: var(--danger); }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 600; }
.check input { inline-size: 20px; block-size: 20px; accent-color: var(--primary); }
/* Segmented control (cost method, payment method, period). */
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-md); padding: 4px; gap: 4px; }
.seg__btn { min-height: 38px; padding: 0 14px; border: 0; background: transparent; color: var(--text-muted); font: inherit; font-weight: 700; font-size: 13.5px; border-radius: 9px; cursor: pointer; }
.seg__btn.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.seg--block { display: flex; } .seg--block .seg__btn { flex: 1; }

/* ---- Tables ---- */
.tbl-wrap { overflow-x: auto; }
.tbl { inline-size: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 10px 14px; border-block-end: 1px solid var(--hairline); white-space: nowrap; background: var(--surface); }
.tbl td { padding: 11px 14px; border-block-end: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-block-end: 0; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.tbl .num { text-align: end; }
.tbl tfoot td { font-weight: 800; border-block-start: 2px solid var(--text); border-block-end: 0; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-block-end: 1px solid var(--hairline); margin-block-end: 16px; overflow-x: auto; }
.tab { min-height: 44px; padding: 0 16px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--text-muted); cursor: pointer; border-block-end: 3px solid transparent; white-space: nowrap; }
.tab.on { color: var(--primary); border-block-end-color: var(--primary); }

/* ---- States: Loading / Empty / Error / Success ---- */
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 44px 24px; text-align: center; color: var(--text-muted); }
.empty-state__icon { inline-size: 60px; block-size: 60px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text-faint); }
.empty-state--error .empty-state__icon { background: var(--danger-soft); color: var(--danger); }
.empty-state--success .empty-state__icon { background: var(--success-soft); color: var(--success); }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: var(--radius-sm); min-height: 16px; }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md); font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.alert svg { flex: 0 0 auto; inline-size: 20px; block-size: 20px; }
.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--success { background: var(--success-soft); color: var(--success); }
.alert--warn { background: var(--warning-soft); color: var(--warning); }
.alert--info { background: var(--primary-soft); color: var(--primary); }

/* ---- Progress / budget ---- */
.progress { block-size: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress__bar { block-size: 100%; border-radius: 999px; background: var(--success); transition: inline-size .3s; }
.progress__bar--warn { background: var(--amber); }
.progress__bar--over { background: var(--danger); }
.budget-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) repeat(3, minmax(90px, 1fr)) minmax(140px, 1.4fr); gap: 12px; align-items: center; padding: 12px 18px; border-block-end: 1px solid var(--border); }
.budget-row:last-child { border-block-end: 0; }
.budget-row--head { font-size: 12px; font-weight: 700; color: var(--text-muted); border-block-end: 1px solid var(--hairline); }
.budget-row__name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.budget-row__pct { display: flex; align-items: center; gap: 10px; }
.budget-row__pct .progress { flex: 1; }
.dot { inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--amber); display: inline-block; flex: 0 0 auto; }

/* Simple bar chart (dashboard / reports) — pure CSS, no chart lib. */
.bars { display: flex; align-items: flex-end; gap: 8px; block-size: 160px; padding-block-start: 8px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; block-size: 100%; justify-content: flex-end; min-inline-size: 0; }
.bars__bar { flex-shrink: 0; inline-size: 100%; max-inline-size: 38px; border-radius: 6px 6px 0 0; background: var(--primary); min-block-size: 2px; }
.bars__bar--amber { background: var(--amber); }
.bars__lbl { font-size: 11px; color: var(--text-muted); }
.hbar { display: grid; grid-template-columns: minmax(90px, 1fr) 2fr auto; gap: 10px; align-items: center; padding-block: 7px; font-size: 13.5px; }

/* Statement rows (accountant desk, P&L). */
.stmt { display: flex; flex-direction: column; }
.stmt__row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-block-end: 1px solid var(--border); }
.stmt__row--total { font-weight: 800; border-block-start: 2px solid var(--text); border-block-end: 0; font-size: 16px; }
.stmt__row--sub { font-weight: 700; }
.stmt__row--minus .t-num { color: var(--danger); }

/* ============================================================================
   POS — layout adapted from TradeERP Pos.razor, touch tiles first
   ============================================================================ */
.pos-session { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 14px; margin-block-end: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.pos-session--open { border-inline-start: 4px solid var(--success); }
.pos-session--none { border-inline-start: 4px solid var(--amber); }
.pos-session__info { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; }
.pos-session__num { font-weight: 800; }
.pos-session__sep { color: var(--text-faint); }

.pos-brand { direction: ltr; display: flex; align-items: center; padding-inline-end: 12px; border-inline-end: 1px solid var(--hairline); }
.pos-brand img { block-size: 26px; inline-size: auto; display: block; }
.pos-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.pos-left { min-inline-size: 0; display: flex; flex-direction: column; gap: 12px; }
.pos-right { position: sticky; inset-block-start: calc(var(--topbar-h) + 12px); display: flex; flex-direction: column; gap: 12px; }
.pos-scan { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0 12px; min-height: 48px; }
.pos-scan__input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; color: inherit; min-height: 44px; }
.pos-shake { animation: pos-shake .3s; }
@keyframes pos-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.pos-cats { display: flex; gap: 8px; overflow-x: auto; padding-block-end: 2px; }
.cat-chip { min-height: 48px; padding: 0 18px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.cat-chip.on { background: var(--amber); border-color: var(--amber); color: #3B2300; }

.pos-quick__grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.pos-tile {
    display: flex; flex-direction: column; gap: 6px; align-items: flex-start; justify-content: space-between;
    min-height: 92px; padding: 12px; cursor: pointer; text-align: start;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    border-block-start: 4px solid var(--amber);
    font: inherit; color: inherit; transition: border-color .12s, box-shadow .12s, transform .05s;
}
.pos-tile:hover { box-shadow: var(--shadow-card); }
.pos-tile:active { transform: scale(.97); }
.pos-tile__name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.pos-tile__price { font-weight: 800; font-size: 16px; color: var(--primary); }
.pos-tile__meta { font-size: 11.5px; color: var(--text-muted); }
.pos-tile--low { border-block-start-color: var(--danger); }
.pos-tile--out { opacity: .5; }

.cart { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.cart__head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-block-end: 1px solid var(--hairline); font-weight: 800; }
.cart__body { max-block-size: 38vh; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; border-block-end: 1px solid var(--border); }
.cart-line__name { font-weight: 700; font-size: 14.5px; }
.cart-line__unit { font-size: 12px; color: var(--text-muted); }
.cart-line__total { font-weight: 800; min-inline-size: 72px; text-align: end; }
.cart-qty { display: inline-flex; align-items: center; gap: 4px; }
.cart-qty__btn { inline-size: 44px; block-size: 44px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 20px; font-weight: 800; cursor: pointer; display: grid; place-items: center; }
.cart-qty__btn:hover { border-color: var(--primary); color: var(--primary); }
.cart-qty__val { min-inline-size: 36px; text-align: center; font-weight: 800; }

.pos-sum { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.pos-sum__line { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-muted); }
.pos-sum__grand { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 28px; padding-block-start: 8px; border-block-start: 1px solid var(--hairline); }
.pos-sum__grand small { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.pos-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.pos-tool { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: inherit; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.pos-tool:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pos-tool:disabled { opacity: .45; cursor: default; }
.pos-tool kbd { font: inherit; font-size: 10px; opacity: .55; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; }
.pos-tool__badge { background: var(--amber); color: #3B2300; border-radius: 999px; font-size: 11px; padding: 0 6px; min-inline-size: 18px; text-align: center; }
.pos-pay-btn { min-height: 64px; border: 0; border-radius: var(--radius-md); background: var(--primary); color: #fff; font: inherit; font-weight: 800; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 12px; }
.pos-pay-btn:hover:not(:disabled) { background: var(--primary-hover); }
.pos-pay-btn:disabled { opacity: .45; cursor: not-allowed; }
.pos-pay-btn__key { font-size: 11px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 5px; padding: 1px 6px; font-family: var(--font-num); }

.paychips { display: flex; gap: 8px; flex-wrap: wrap; }
.paychip { min-height: 44px; padding: 0 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; color: var(--text); font-family: var(--font-num); }
.paychip:hover { border-color: var(--primary); color: var(--primary); }
.paychip--exact { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.pay-change { display: flex; justify-content: space-between; align-items: baseline; padding: 14px; border-radius: var(--radius-md); background: var(--success-soft); color: var(--success); font-weight: 800; font-size: 22px; }
.pay-change--short { background: var(--danger-soft); color: var(--danger); }

/* Cashier mode (pos.js): the till alone — no sidebar, no top bar, bigger targets. */
body.cashier-mode .sidebar, body.cashier-mode .topbar, body.cashier-mode .nav-backdrop, body.cashier-mode .bottom-nav { display: none !important; }
body.cashier-mode .content { padding: 12px 16px; max-inline-size: none; }
body.cashier-mode .pos-tile { min-height: 112px; }
body.cashier-mode .pos-tile__name { font-size: 17px; }
body.cashier-mode .pos-right { inset-block-start: 12px; }
body.cashier-mode .cart__body { max-block-size: 46vh; }

/* ---- Shift reconciliation + Z report (class names from TradeERP) ---- */
.sess-recon { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-2); }
.sess-recon__line { display: flex; justify-content: space-between; align-items: center; }
.sess-recon__line--strong { font-weight: 800; border-block-start: 1px solid var(--hairline); padding-block-start: 8px; margin-block-start: 2px; }
.sess-z { display: flex; flex-direction: column; gap: 10px; inline-size: 300px; padding: 12px 14px; color: #111; background: #fff; font-size: 12.5px; }
.sess-z__head { text-align: center; }
.sess-z__store { font-size: 15px; font-weight: 800; }
.sess-z__title { font-size: 13px; font-weight: 700; }
.sess-z__section { display: flex; flex-direction: column; gap: 4px; border-block-start: 1px dashed #888; padding-block-start: 8px; }
.sess-z__row { display: flex; justify-content: space-between; gap: 8px; }
.sess-z__row--strong { font-weight: 800; }

/* ---- 80mm receipt (TradeERP Receipt.razor) ---- */
.r80 { inline-size: 300px; padding: 12px 14px; color: #111; background: #fff; font-size: 12.5px; line-height: 1.5; font-family: "Cairo", "Vazirmatn", "Segoe UI", Tahoma, sans-serif; }
.r80-logo { display: block; margin: 0 auto 4px; block-size: 26px; }
.r80-co { text-align: center; font-weight: 800; font-size: 15px; }
.r80-sub { text-align: center; color: #444; font-size: 11px; }
.r80-line { border-block-start: 1px dashed #888; margin: 7px 0; }
.r80-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.r80-item { margin: 3px 0; }
.r80-item-name { font-weight: 600; }
.r80-item-nums { display: flex; justify-content: space-between; color: #333; gap: 8px; }
.r80-tot { display: flex; justify-content: space-between; }
.r80-grand { font-weight: 800; font-size: 14.5px; border-block: 1px solid #111; padding: 3px 0; margin: 3px 0; }
.r80-no { text-align: center; font-family: var(--font-num); font-weight: 800; font-size: 20px; letter-spacing: .04em; }
.r80-thanks { text-align: center; color: #555; font-size: 11px; }
.r80-void { text-align: center; font-weight: 800; border: 2px solid #111; padding: 2px; margin: 4px 0; }
.paper { background: #fff; box-shadow: var(--shadow-card); border-radius: 4px; inline-size: fit-content; margin-inline: auto; }

/* ============================================================================
   Login — Aurora mode (login + dark only)
   ============================================================================ */
.login {
    min-height: 100vh; display: grid; place-items: center; padding: 24px; color: #fff;
    background:
        radial-gradient(42% 60% at 70% 50%, rgba(49, 91, 255, .42), transparent 62%),
        radial-gradient(34% 50% at 100% 100%, rgba(138, 63, 252, .50), transparent 62%),
        radial-gradient(30% 42% at 40% 0%, rgba(0, 212, 179, .26), transparent 62%),
        #060918;
}
.login__wrap { inline-size: min(940px, 100%); display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.login__brand img { block-size: 64px; display: block; margin-block-end: 28px; }
.login__brand { direction: ltr; }
/* the text block takes its direction from its own dir attribute (language) */
.login__title { font-size: 40px; font-weight: 800; line-height: 1.2; margin: 0 0 12px; }
.login__title em { font-style: normal; color: #63E9FF; }
.login__lead { color: #B8C3E2; font-size: 16px; max-inline-size: 420px; }
.login__points { margin: 22px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; color: #B8C3E2; font-size: 14.5px; }
.login__points li::before { content: ""; display: inline-block; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--bakery-amber); margin-inline-end: 10px; }
.login-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04));
    border: 1px solid rgba(255, 255, 255, .16); border-radius: 28px;
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    padding: 32px; display: flex; flex-direction: column; gap: 14px;
}
.login-card h2 { margin: 0; font-size: 22px; font-weight: 800; }
.login-card .field > label { color: #B8C3E2; }
.login-card .input { background: rgba(6, 9, 24, .55); border-color: rgba(255, 255, 255, .18); color: #fff; }
.login-card .input::placeholder { color: #6B7699; }
.login-cta { min-height: 52px; border: 0; border-radius: var(--radius-md); background: linear-gradient(90deg, #315BFF, #8A3FFC); box-shadow: 0 12px 40px rgba(80, 90, 255, .55); color: #fff; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; }
.login-alert { background: rgba(255, 107, 107, .16); border: 1px solid rgba(255, 107, 107, .4); color: #FFB4B4; padding: 10px 12px; border-radius: var(--radius-md); font-weight: 600; font-size: 14px; }
.login-demo { font-size: 12.5px; color: #94A3B8; border-block-start: 1px solid rgba(255, 255, 255, .12); padding-block-start: 12px; }
.login-demo code { font-family: var(--font-num); color: #63E9FF; direction: ltr; unicode-bidi: isolate; }

/* ============================================================================
   Responsive — tablet (≤1100) and phone (≤760), breakpoints from SchoolERP
   ============================================================================ */
@media (max-width: 1100px) {
    .grid-2, .grid-3, .grid-main { grid-template-columns: 1fr; }
    .pos-grid { grid-template-columns: minmax(0, 1fr) 340px; }
    .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; transform: translateX(-105%); transition: transform .2s; }
    [dir="rtl"] .sidebar { transform: translateX(105%); }
    .nav-open .sidebar { transform: none; }
    .nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(6, 9, 24, .55); z-index: 50; }
    .nav-burger { display: grid; }
}
@media (max-width: 760px) {
    .content { padding: 14px 14px calc(var(--bottomnav-h) + 22px); }
    .topbar { padding: 0 12px; }
    .topbar__date, .user-chip > span:not(.avatar) { display: none; }
    .user-chip { padding: 4px; }
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi-card { padding: 12px; }
    .kpi-card__top { gap: 8px; align-items: flex-start; }
    .kpi-card__icon { inline-size: 32px; block-size: 32px; border-radius: 9px; }
    .kpi-card__icon svg { inline-size: 18px; block-size: 18px; }
    .kpi-card__value { font-size: 17px; }
    .kpi-card__value small { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .pos-grid { grid-template-columns: 1fr; }
    .pos-right { position: static; }
    .pos-quick__grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
    .budget-row { grid-template-columns: 1fr 1fr; }
    .budget-row--head { display: none; }
    .budget-row__name, .budget-row__pct { grid-column: 1 / -1; }
    .login__wrap { grid-template-columns: 1fr; gap: 24px; }
    .login__title { font-size: 28px; }
    .login__points { display: none; }
    .page-head { align-items: flex-start; }
    /* Sidebar becomes bottom navigation: 4 primary destinations + "more" (opens the drawer). */
    .bottom-nav {
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        position: fixed; inset-inline: 10px; inset-block-end: 10px; z-index: 40;
        block-size: var(--bottomnav-h); padding: 6px;
        background: color-mix(in srgb, var(--surface) 82%, transparent);
        backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
        border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-card);
    }
    .bottom-nav__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; border: 0; background: none; color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 700; border-radius: 16px; cursor: pointer; }
    .bottom-nav__item svg { inline-size: 22px; block-size: 22px; }
    .bottom-nav__item.active { color: var(--primary); background: var(--primary-soft); }
}

/* ============================================================================
   Print — receipts (80mm) and reports (A4)
   ============================================================================ */
.print-only { display: none; }
@media print {
    .sidebar, .topbar, .bottom-nav, .no-print, .mud-snackbar-location-bottom-center { display: none !important; }
    .content { padding: 0; max-inline-size: none; }
    body { background: #fff; }
    .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
    .print-only { display: block; }
    @page { margin: 12mm; }
}

/* ---- Blazor framework bits ---- */
.blazor-error-boundary { background: var(--danger); padding: 1rem; color: white; border-radius: var(--radius-sm); }
.blazor-error-boundary::after { content: "حدث خطأ غير متوقع."; }
#blazor-error-ui { background: var(--warning-soft); color: var(--warning); inset-block-end: 0; inset-inline: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2); display: none; padding: .6rem 1.25rem; position: fixed; z-index: 1000; font-weight: 600; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; inset-inline-end: .75rem; inset-block-start: .5rem; }
.mud-dialog { border-radius: var(--radius-lg) !important; }
.mud-dialog .mud-dialog-title { font-weight: 800; }
.dlg-body { display: flex; flex-direction: column; gap: 14px; min-inline-size: min(440px, 80vw); }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 8px 16px 16px; inline-size: 100%; flex-wrap: wrap; }

/* ---- Additions used by the Blazor pages ---- */
.bars__val { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-num); }
.bars__plot { flex: 1; inline-size: 100%; display: flex; align-items: flex-end; justify-content: center; min-block-size: 0; }
.link-btn { border: 0; background: none; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.muted-row td { color: var(--text-faint); text-decoration: line-through; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-block-end: 1px dashed var(--border); font-size: 14px; }
.kv:last-child { border-block-end: 0; }
.kv > span:first-child { color: var(--text-muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-block-end: 14px; }
.toolbar .field { min-inline-size: 150px; }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-block-end: 16px; }
.report-card { text-align: start; padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; min-height: 76px; }
.report-card.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.report-card b { display: block; font-size: 14.5px; }
.report-card span { display: block; font-size: 12px; color: var(--text-muted); }
.report-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.recipe-line { display: grid; grid-template-columns: minmax(140px, 2fr) 1fr 1fr 1fr 44px; gap: 8px; align-items: end; padding-block: 6px; }
.center { display: grid; place-items: center; padding: 40px; }
.mud-dialog .mud-dialog-content { padding-block: 8px; }
.mud-dialog-title { font-family: var(--font-body) !important; }
@media (max-width: 760px) { .recipe-line { grid-template-columns: 1fr 1fr; } .dlg-body { min-inline-size: 0; } }
@media print { .receipt-print-area { position: absolute; inset: 0 auto auto 0; } }
[dir="rtl"] .mud-dialog .mud-button-close { right: auto; left: 8px; }
.mud-dialog .mud-dialog-title { padding-inline-end: 52px; }

/* ============================================================================
   v2 — features brought over from the sister systems
   ============================================================================ */
/* Product pictures */
.pos-tile__img { inline-size: 100%; block-size: 62px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
body.cashier-mode .pos-tile__img { block-size: 78px; }
.product-thumb { inline-size: 72px; block-size: 72px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-2); }
.product-thumb--sm { inline-size: 34px; block-size: 34px; border-radius: var(--radius-sm); flex: 0 0 auto; }

/* Receipt barcode (Code 128) */
.r80-barcode { text-align: center; margin: 4px 0; }
.r80-barcode svg { max-inline-size: 100%; block-size: 42px; }

/* Notification bell */
.bell-wrap { position: relative; }
.bell-wrap .icon-btn { position: relative; }
.bell-badge { position: absolute; inset-block-start: -5px; inset-inline-end: -5px; min-inline-size: 20px; block-size: 20px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }
.menu-backdrop { position: fixed; inset: 0; z-index: 29; }
.notif-panel { position: absolute; inset-block-start: 52px; inset-inline-end: 0; z-index: 30; inline-size: min(360px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.notif-panel__head { padding: 14px 16px; font-weight: 800; border-block-end: 1px solid var(--hairline); }
.notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; color: var(--text); border-block-end: 1px solid var(--border); min-height: 44px; }
.notif-item:last-child { border-block-end: 0; }
.notif-item:hover { background: var(--surface-2); }
.notif-item .dot { margin-block-start: 7px; }
.notif-empty { display: flex; gap: 10px; align-items: center; padding: 22px 16px; color: var(--success); font-weight: 600; }
@media (max-width: 480px) { .notif-panel { position: fixed; inset-block-start: 66px; inset-inline: 10px; inline-size: auto; } }

/* Folded sidebar: a rail of icons that opens over the page while hovered (TradeERP nav-mini) */
.nav-collapse { display: none; }
.sidebar__brand .sidebar__logo-icon { display: none; }
@media (min-width: 1101px) {
    .nav-collapse { display: grid; }
    .sidebar { transition: inline-size .18s ease, margin .18s ease; }
    .app-shell.nav-mini .sidebar { inline-size: 76px; flex: 0 0 auto; z-index: 50; overflow-x: hidden; }
    .app-shell.nav-mini .sidebar:hover { inline-size: var(--sidebar-w); margin-inline-end: calc(76px - var(--sidebar-w)); box-shadow: 0 0 40px rgba(6, 9, 24, .45); }
    .app-shell.nav-mini .sidebar:not(:hover) .nav-item span,
    .app-shell.nav-mini .sidebar:not(:hover) .nav-label,
    .app-shell.nav-mini .sidebar:not(:hover) .sidebar__product,
    .app-shell.nav-mini .sidebar:not(:hover) .sidebar__footer,
    .app-shell.nav-mini .sidebar:not(:hover) .sidebar__brand .sidebar__logo-full { display: none; }
    .app-shell.nav-mini .sidebar:not(:hover) .sidebar__brand .sidebar__logo-icon { display: block; block-size: 34px; margin-inline: auto; }
    .app-shell.nav-mini .sidebar:not(:hover) .sidebar__brand { padding-inline: 0; }
    .app-shell.nav-mini .sidebar:not(:hover) .nav-item { justify-content: center; padding-inline: 0; }
    .app-shell.nav-mini .sidebar:not(:hover) .sidebar__nav { padding-inline: 10px; }
}
body.cashier-mode .nav-collapse { display: none; }

/* ---- Language switch (ar / en / ku) ---- */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface-2); direction: ltr; }
.lang-switch > * { min-inline-size: 38px; min-block-size: 38px; padding: 0 8px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text-muted); font: inherit; font-weight: 800; font-size: 12.5px; cursor: pointer; display: grid; place-items: center; }
.lang-switch > .on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.lang-switch--aurora { background: rgba(6, 9, 24, .5); align-self: flex-end; }
.lang-switch--aurora > * { color: #B8C3E2; }
.lang-switch--aurora > .on { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
@media (max-width: 760px) { .topbar .lang-switch > * { min-inline-size: 32px; padding: 0 5px; } }

/* ============================================================================
   Login — two doors (method from RestaurantERP): till picker + PIN pad, or username/password
   ============================================================================ */
.login-card h2 { margin: 0; }
.login-hint { margin: 2px 0 12px; color: #B8C3E2; font-size: 13.5px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-flags { display: flex; gap: 6px; justify-content: flex-end; direction: ltr; }
.login-flags a { inline-size: 36px; block-size: 25px; display: grid; place-items: center; border-radius: 6px; overflow: hidden; opacity: .5; border: 1px solid rgba(255, 255, 255, .25); transition: opacity .12s, transform .08s; }
.login-flags a:hover { opacity: .85; }
.login-flags a:active { transform: scale(.94); }
.login-flags a.on { opacity: 1; border-color: #63E9FF; box-shadow: 0 0 0 2px rgba(99, 233, 255, .35); }
.flag { display: block; inline-size: 100%; block-size: 100%; }
.login-runs { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 22px; }
.login-runs span { padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); color: #B8C3E2; font-size: 13px; font-weight: 600; }
.login-runs span:first-child { border-color: var(--bakery-amber); color: #FFD08A; }

.login-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(6, 9, 24, .55); border: 1px solid rgba(255, 255, 255, .12); }
.login-modes a { min-block-size: 44px; display: grid; place-items: center; border-radius: 10px; color: #B8C3E2; font-weight: 700; text-decoration: none; }
.login-modes a.on { background: rgba(255, 255, 255, .14); color: #fff; }

.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.who__btn { display: flex; align-items: center; gap: 10px; min-block-size: 60px; padding: 8px 10px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(6, 9, 24, .4); color: #fff; font: inherit; cursor: pointer; text-align: start; transition: border-color .12s, transform .08s; }
.who__btn:hover { border-color: #63E9FF; }
.who__btn:active { transform: scale(.985); }
.who__initial { inline-size: 38px; block-size: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; background: var(--bakery-amber); color: #3B2300; font-weight: 800; }
.who__name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.who__text { display: flex; flex-direction: column; min-inline-size: 0; }
.who__role { font-size: 11.5px; color: #B8C3E2; }
.who__btn--captain .who__initial { background: #34D399; color: #052E1C; }
.who__btn--last { order: -1; border-color: rgba(99, 233, 255, .55); }
.login-tip { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(99, 233, 255, .08); border: 1px dashed rgba(99, 233, 255, .35); color: #B8C3E2; font-size: 12.5px; line-height: 1.6; }

.pad[hidden], .who[hidden] { display: none; }
.pad__who { display: flex; align-items: center; gap: 10px; font-weight: 800; margin-block-end: 12px; }
.pad__back { inline-size: 44px; block-size: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .18); background: transparent; color: #fff; font-size: 18px; cursor: pointer; }
.pad__back:hover { border-color: #63E9FF; }
.dots { display: flex; justify-content: center; gap: 12px; margin-block-end: 16px; min-block-size: 16px; direction: ltr; }
.pin-dot { inline-size: 14px; block-size: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); transition: background-color .12s, border-color .12s, transform .12s; }
.pin-dot--on { background: #63E9FF; border-color: #63E9FF; transform: scale(1.1); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-block-end: 14px; }
.key { min-block-size: 62px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(6, 9, 24, .45); color: #fff; font-family: var(--font-num); font-size: 24px; font-weight: 700; cursor: pointer; transition: background-color .08s, transform .05s; touch-action: manipulation; }
.key:hover { border-color: rgba(255, 255, 255, .4); }
.key:active { background: rgba(49, 91, 255, .5); transform: scale(.97); }
.key--soft { font-family: var(--font-body); font-size: 14px; color: #B8C3E2; }
.login-cta { inline-size: 100%; }
.login-cta:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.login-cta.is-busy { opacity: .7; pointer-events: none; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-inline-end: 46px; }
.pw-eye { position: absolute; inset-block: 0; inset-inline-end: 0; inline-size: 44px; border: 0; background: none; color: #B8C3E2; cursor: pointer; display: grid; place-items: center; }
@media (prefers-reduced-motion: reduce) { .pin-dot, .key, .who__btn { transition: none; } }

/* ============================================================================
   Service types — takeaway / hall / delivery (idea from RestaurantERP)
   ============================================================================ */
.svc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.svc__order { display: flex; align-items: center; gap: 8px; }
.svc__tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.table-chip { min-block-size: 56px; padding: 6px 8px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.table-chip b { font-size: 13.5px; }
.table-chip span { font-size: 11.5px; color: var(--text-muted); }
.table-chip.busy { background: var(--amber-soft); border-color: var(--amber); }
.table-chip.busy span { color: var(--amber-ink); font-weight: 700; }
.table-chip.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus-ring); }
.svc__delivery { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-block-size: 48px; padding: 8px 12px; border-radius: var(--radius-md); border: 1px dashed var(--hairline); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; text-align: start; }
.svc__delivery svg { vertical-align: middle; }

/* Hall floor + delivery board */
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.floor-table { display: flex; flex-direction: column; gap: 6px; min-block-size: 120px; padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--border); border-block-start: 4px solid var(--success); background: var(--surface); color: var(--text); text-align: start; font: inherit; cursor: pointer; }
.floor-table:hover { box-shadow: var(--shadow-card); }
.floor-table--busy { border-block-start-color: var(--amber); background: var(--amber-soft); }
.floor-table__name { font-weight: 800; font-size: 16px; }
.floor-table__total { font-weight: 800; font-size: 20px; margin-block-start: auto; }
.custody { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-block-end: 16px; }

.r80-svc { text-align: center; font-weight: 800; border: 1px solid #111; border-radius: 6px; padding: 2px 4px; margin: 4px 0; }
.r80-addr { font-size: 11.5px; margin-block: 2px; }

/* ---- The bakery's own identity (logo / mark) ---- */
.sidebar__store { display: flex; align-items: center; gap: 10px; padding: 0 22px 16px; font-size: 13.5px; font-weight: 700; color: var(--sidebar-text-strong); border-block-end: 1px solid rgba(255, 255, 255, .08); }
.sidebar__store img { inline-size: 40px; block-size: 40px; border-radius: 12px; object-fit: cover; background: #F1EEE3; flex: 0 0 auto; }
.app-shell.nav-mini .sidebar:not(:hover) .sidebar__store span { display: none; }
.app-shell.nav-mini .sidebar:not(:hover) .sidebar__store { justify-content: center; padding-inline: 0; }
.login-store { display: grid; place-items: center; background: #F1EEE3; border-radius: 18px; padding: 6px; }
.login-store img { max-inline-size: 100%; max-block-size: 150px; display: block; border-radius: 12px; }
.r80-store-logo { display: block; margin: 0 auto 4px; max-inline-size: 150px; max-block-size: 90px; object-fit: contain; filter: grayscale(1) contrast(1.15); }
.logo-edit { display: flex; gap: 16px; flex-wrap: wrap; }
.logo-edit__item { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.logo-tile { inline-size: 96px; block-size: 96px; border-radius: var(--radius-md); background: #F1EEE3; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.logo-tile--wide { inline-size: 170px; }
.logo-tile img { inline-size: 100%; block-size: 100%; object-fit: contain; }
