/* ==========================================================================
   Karaz Coffee — Main Stylesheet
   One file for the public site + admin panel, LTR (English) and RTL (Arabic).

   Fonts are loaded with <link> in the page <head> (faster than @import):
   Playfair Display, Inter, Cairo. (The logo is an image: assets/images/logo_horz*.png)

   Contents
   01. Design tokens (:root)
   02. RTL / Arabic overrides
   03. Reset
   04. Base typography
   05. Layout helpers
   06. Buttons
   07. Forms
   08. Badges
   09. Cards
   10. Alerts / flash messages
   11. Price display ($ + LBP)
   12. Language switch
   13. Utilities & accessibility
   ---- Components added in later steps ----
   14. Header
   15. Footer
   16. Menu page
   17. Item modal & cart
   18. About page
   19. Contact page
   20. Auth pages
   21. Admin layout (sidebar, top bar, cards, tables)
   22. Admin dashboard
   23. Admin pages
   24. Admin pages — items
   25. Sales — list, sale view, point of sale, receipt
   26. Users, roles & permissions
   27. Messages, settings, my profile
   28. Expenses, expense form, reports (+ admin print)
   29. Lock screen, PIN keypad, quick sign-in
   ========================================================================== */


/* ==========================================================================
   01. Design tokens
   ========================================================================== */
:root {
    /* Brand — cherry burgundy */
    --primary:          #7B1E2B;
    --primary-dark:     #5E1220;
    --primary-light:    #A33A48;
    --primary-soft:     #F6E7E8;
    --primary-ring:     rgba(123, 30, 43, .18);

    /* Neutrals — cream & espresso */
    --bg:               #FAF6F0;
    --surface:          #FFFFFF;
    --surface-alt:      #F3EDE5;
    --border:           #E8DFD5;
    --border-strong:    #D6C9BC;
    --text:             #2B1D1A;
    --text-soft:        #5A4A44;
    --text-muted:       #8A7B73;
    --text-inverse:     #FFFFFF;
    --overlay:          rgba(28, 20, 18, .55);

    /* Admin sidebar */
    --sidebar-bg:       #1C1412;
    --sidebar-bg-alt:   #261C19;
    --sidebar-text:     #CFC5BF;
    --sidebar-width:    260px;

    /* Status */
    --success:          #2E7D4F;
    --success-soft:     #E5F3EA;
    --warning:          #C98A1B;
    --warning-soft:     #FBF1DC;
    --danger:           #C0392B;
    --danger-soft:      #FBE6E4;
    --info:             #2F6FA3;
    --info-soft:        #E3EEF7;

    /* Chart palette */
    --chart-1:          #7B1E2B;
    --chart-2:          #D9A066;
    --chart-3:          #4E6B3A;
    --chart-4:          #B5838D;
    --chart-5:          #8A7B73;

    /* Typography */
    --font-heading:     'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body:        'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-arabic:      'Cairo', 'Segoe UI', Tahoma, sans-serif;

    --fs-xs:            .75rem;     /* 12 */
    --fs-sm:            .875rem;    /* 14 */
    --fs-base:          1rem;       /* 16 */
    --fs-md:            1.125rem;   /* 18 */
    --fs-lg:            1.375rem;   /* 22 */
    --fs-xl:            1.75rem;    /* 28 */
    --fs-2xl:           clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
    --fs-3xl:           clamp(2.25rem, 1.5rem + 3.2vw, 3.5rem);

    --lh-tight:         1.2;
    --lh-base:          1.6;

    /* Spacing scale */
    --space-1:          .25rem;
    --space-2:          .5rem;
    --space-3:          .75rem;
    --space-4:          1rem;
    --space-5:          1.5rem;
    --space-6:          2rem;
    --space-7:          3rem;
    --space-8:          4rem;
    --space-9:          6rem;

    /* Shape & depth */
    --radius-sm:        8px;
    --radius:           14px;
    --radius-lg:        22px;
    --radius-pill:      999px;

    --shadow-sm:        0 1px 3px rgba(43, 29, 26, .06);
    --shadow:           0 6px 20px rgba(43, 29, 26, .08);
    --shadow-lg:        0 16px 40px rgba(43, 29, 26, .12);
    --shadow-primary:   0 8px 20px rgba(123, 30, 43, .28);

    /* Motion */
    --ease:             cubic-bezier(.2, .8, .2, 1);
    --transition:       .2s var(--ease);

    /* Layout */
    --container:        1200px;
    --gutter:           1rem;
    --header-height:    76px;

    /* Layers */
    --z-dropdown:       100;
    --z-header:         200;
    --z-overlay:        900;
    --z-modal:          1000;
    --z-toast:          1100;
}

@media (min-width: 640px) {
    :root { --gutter: 1.5rem; }
}


/* ==========================================================================
   02. RTL / Arabic
   Layout uses logical properties (margin-inline-start, inset-inline-end...)
   so most components flip automatically. Only fonts & icons need overrides.
   ========================================================================== */
[dir="rtl"] {
    --font-heading:     var(--font-arabic);
    --font-body:        var(--font-arabic);
    --lh-base:          1.75;    /* Arabic script needs more line height */
}

/* Directional icons (arrows, chevrons) mirror in RTL */
[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* Keep numbers, prices, phones & emails readable left-to-right inside Arabic text */
[dir="rtl"] .ltr,
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="url"] {
    direction: ltr;
    unicode-bidi: isolate;
}
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="url"] { text-align: right; }

/* Arabic doesn't use letter-spacing or uppercase */
[dir="rtl"] .eyebrow,
[dir="rtl"] .text-upper {
    letter-spacing: 0;
    text-transform: none;
}


/* ==========================================================================
   03. Reset
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img,
picture,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

img { height: auto; }

input,
button,
textarea,
select { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }

a { color: inherit; text-decoration: none; }

/* :where() = zero specificity, so components can still set their own padding */
:where(ul[role="list"], ol[role="list"]) { list-style: none; padding: 0; }

table { border-collapse: collapse; width: 100%; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

/* Body scroll lock while a modal / drawer is open */
body.is-locked { overflow: hidden; }


/* ==========================================================================
   04. Base typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: var(--lh-tight);
    color: var(--text);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); }

p { color: var(--text-soft); }

strong, b { font-weight: 600; }

small { font-size: var(--fs-sm); }

::selection { background: var(--primary); color: var(--text-inverse); }

/* Small uppercase label above titles ("OUR MENU") */
.eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 500;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--primary);
}

.lead {
    font-size: var(--fs-md);
    color: var(--text-soft);
}

.link {
    color: var(--primary);
    font-weight: 500;
    transition: color var(--transition);
}
.link:hover { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }


/* ==========================================================================
   05. Layout helpers
   ========================================================================== */
.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--narrow { max-width: calc(820px + var(--gutter) * 2); }

.section { padding-block: var(--space-8); }
.section--sm { padding-block: var(--space-6); }

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-3) var(--space-5);
    margin-bottom: var(--space-5);
}

.stack > * + * { margin-top: var(--space-4); }

.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap     { flex-wrap: wrap; }
.items-center  { align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

/* Responsive grid: 1 → 2 → 3 → 4 columns */
.grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(var(--cols-sm, 1), minmax(0, 1fr));
}
@media (min-width: 640px)  { .grid { gap: var(--space-5); grid-template-columns: repeat(var(--cols-md, 2), minmax(0, 1fr)); } }
@media (min-width: 960px)  { .grid { grid-template-columns: repeat(var(--cols-lg, 3), minmax(0, 1fr)); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(var(--cols-xl, var(--cols-lg, 3)), minmax(0, 1fr)); } }

.grid--2 { --cols-md: 2; --cols-lg: 2; }
.grid--3 { --cols-md: 2; --cols-lg: 3; }
.grid--4 { --cols-sm: 2; --cols-md: 3; --cols-lg: 4; }


/* ==========================================================================
   06. Buttons
   ========================================================================== */
.btn {
    --btn-bg: var(--surface);
    --btn-color: var(--text);
    --btn-border: var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 44px;                 /* touch target */
    padding: .625rem 1.375rem;
    border: 1px solid var(--btn-border);
    border-radius: var(--radius-pill);
    background: var(--btn-bg);
    color: var(--btn-color);
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition), color var(--transition),
                border-color var(--transition), box-shadow var(--transition),
                transform var(--transition);
}
.btn:hover   { border-color: var(--border-strong); }
.btn:active  { transform: translateY(1px); }
.btn:disabled,
.btn.is-disabled { opacity: .55; pointer-events: none; }

.btn svg { width: 1.125em; height: 1.125em; flex-shrink: 0; }

.btn--primary {
    --btn-bg: var(--primary);
    --btn-color: var(--text-inverse);
    --btn-border: var(--primary);
}
.btn--primary:hover {
    --btn-bg: var(--primary-dark);
    --btn-border: var(--primary-dark);
    box-shadow: var(--shadow-primary);
}

.btn--soft {
    --btn-bg: var(--primary-soft);
    --btn-color: var(--primary);
    --btn-border: transparent;
}
.btn--soft:hover { --btn-bg: #F0D9DB; --btn-border: transparent; }

.btn--outline {
    --btn-bg: transparent;
    --btn-color: var(--primary);
    --btn-border: var(--primary);
}
.btn--outline:hover { --btn-bg: var(--primary); --btn-color: var(--text-inverse); }

.btn--ghost {
    --btn-bg: transparent;
    --btn-border: transparent;
}
.btn--ghost:hover { --btn-bg: var(--surface-alt); --btn-border: transparent; }

.btn--light {
    --btn-bg: rgba(255, 255, 255, .92);
    --btn-color: var(--text);
    --btn-border: transparent;
}

.btn--danger {
    --btn-bg: var(--danger);
    --btn-color: var(--text-inverse);
    --btn-border: var(--danger);
}
.btn--danger:hover { filter: brightness(.92); }

.btn--sm    { min-height: 36px; padding: .4rem 1rem; font-size: var(--fs-xs); }
.btn--lg    { min-height: 52px; padding: .8rem 1.75rem; font-size: var(--fs-base); }
.btn--block { display: flex; width: 100%; }
.btn--square { border-radius: var(--radius-sm); }

/* Round icon-only button (the "+" on menu cards, close X, etc.) */
.btn-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    color: var(--text);
    transition: background-color var(--transition), color var(--transition), transform var(--transition);
}
.btn-icon:hover { background: var(--surface-alt); }
.btn-icon svg { width: 20px; height: 20px; }

.btn-icon--primary { background: var(--primary); color: var(--text-inverse); }
.btn-icon--primary:hover { background: var(--primary-dark); transform: scale(1.06); }

.btn-icon--sm { width: 32px; height: 32px; }
.btn-icon--sm svg { width: 16px; height: 16px; }


/* ==========================================================================
   07. Forms
   ========================================================================== */
.form-grid {
    display: grid;
    gap: var(--space-4);
}
@media (min-width: 640px) {
    .form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid .span-full { grid-column: 1 / -1; }
}

.form-group { display: flex; flex-direction: column; gap: var(--space-2); }

.form-label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text);
}
.form-label .required { color: var(--danger); margin-inline-start: 2px; }

.form-control {
    width: 100%;
    min-height: 46px;
    padding: .7rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: var(--fs-sm);
    line-height: 1.4;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
}
.form-control::placeholder { color: var(--text-muted); opacity: 1; }
.form-control:hover { border-color: var(--border-strong); }
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-ring);
}
.form-control:disabled { background: var(--surface-alt); color: var(--text-muted); cursor: not-allowed; }

textarea.form-control { min-height: 130px; resize: vertical; }

select.form-control {
    padding-inline-end: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A7B73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}
[dir="rtl"] select.form-control { background-position: left 1rem center; }

/* Input with a leading icon (search fields) */
.input-icon { position: relative; }
.input-icon > svg {
    position: absolute;
    inset-inline-start: 1rem;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.input-icon > .form-control { padding-inline-start: 2.75rem; }

/* Validation states */
.form-control.is-invalid,
.is-invalid > .form-control { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(192, 57, 43, .15); }
.form-error { font-size: var(--fs-xs); color: var(--danger); }
.form-hint  { font-size: var(--fs-xs); color: var(--text-muted); }

/* Checkbox / radio */
.check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    cursor: pointer;
}
.check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* Toggle switch: <label class="switch"><input type="checkbox"><span></span> Active</label> */
.switch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--fs-sm);
    cursor: pointer;
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
/* Only the span right after the checkbox is the track (other spans are label text) */
.switch input + span {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    background: var(--border-strong);
    transition: background-color var(--transition);
}
.switch input + span::after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition);
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); }
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-20px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px var(--primary-ring); }

/* Honeypot field (anti-spam) — hidden from humans, visible to bots */
.hp-field {
    position: absolute !important;
    inset-inline-start: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}


/* ==========================================================================
   08. Badges
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: .25rem .7rem;
    border-radius: var(--radius-pill);
    background: var(--surface-alt);
    color: var(--text-soft);
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.badge--primary { background: var(--primary-soft); color: var(--primary); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger); }
.badge--info    { background: var(--info-soft);    color: var(--info); }

/* Small count bubble (cart icon, notifications) */
.count-bubble {
    position: absolute;
    top: -4px;
    inset-inline-end: -6px;
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding-inline: 5px;
    border: 2px solid var(--surface);
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--text-inverse);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.count-bubble:empty,
.count-bubble[data-count="0"] { display: none; }


/* ==========================================================================
   09. Cards
   ========================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card__body   { padding: var(--space-5); }
.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}
.card__title { font-size: var(--fs-md); }
.card__footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border);
}

.card--hover { transition: transform var(--transition), box-shadow var(--transition); }
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* Round soft icon holder (category icons, KPI icons, quick actions) */
.icon-circle {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
}
.icon-circle svg { width: 22px; height: 22px; }


/* ==========================================================================
   10. Alerts / flash messages
   ========================================================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    line-height: 1.5;
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.alert--success { background: var(--success-soft); border-color: #CBE7D5; color: var(--success); }
.alert--error   { background: var(--danger-soft);  border-color: #F3CBC6; color: var(--danger); }
.alert--warning { background: var(--warning-soft); border-color: #F2DFB4; color: #946210; }
.alert--info    { background: var(--info-soft);    border-color: #C9DCEC; color: var(--info); }

/* Floating toast (bottom corner) — used for "Added to your order" etc. */
.toast-stack {
    position: fixed;
    inset-inline-end: var(--space-4);
    bottom: var(--space-4);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 240px;
    max-width: calc(100vw - 2rem);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--text-inverse);
    font-size: var(--fs-sm);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in .3s var(--ease);
}
.toast svg { width: 18px; height: 18px; color: #F0B9C0; }
.toast.is-leaving { animation: toast-out .25s var(--ease) forwards; }

@keyframes toast-in  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to   { opacity: 0; transform: translateY(12px); } }


/* ==========================================================================
   11. Price display ($ + LBP)
   <span class="price"><span class="price__usd">$4.00</span><span class="price__lbp">LBP 358,000</span></span>
   ========================================================================== */
.price {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.2;
    direction: ltr;           /* "$4.00" / "LBP 358,000" always read LTR */
    unicode-bidi: isolate;
}
[dir="rtl"] .price { align-items: flex-end; }

.price__usd {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--text);
}
.price__lbp {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 500;
    color: var(--text-muted);
}
.price--lg .price__usd { font-size: var(--fs-xl); color: var(--primary); }
.price--lg .price__lbp { font-size: var(--fs-sm); }

.price--inline { flex-direction: row; align-items: baseline; gap: var(--space-2); }


/* ==========================================================================
   12. Language switch  (EN | ع)
   ========================================================================== */
.lang-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-size: var(--fs-xs);
    font-weight: 600;
}
.lang-switch a {
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 28px;
    padding-inline: var(--space-2);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    transition: background-color var(--transition), color var(--transition);
}
.lang-switch a:hover { color: var(--primary); }
.lang-switch a[aria-current="true"] {
    background: var(--primary);
    color: var(--text-inverse);
}
.lang-switch a[lang="ar"] { font-family: var(--font-arabic); font-size: var(--fs-sm); }

/* Dark variant for the admin sidebar */
.lang-switch--dark { background: var(--sidebar-bg-alt); border-color: rgba(255, 255, 255, .08); }
.lang-switch--dark a { color: var(--sidebar-text); }


/* ==========================================================================
   13. Utilities & accessibility
   ========================================================================== */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* "Skip to content" link for keyboard users */
.skip-link {
    position: absolute;
    top: -100px;
    inset-inline-start: var(--space-4);
    z-index: calc(var(--z-toast) + 1);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: var(--text-inverse);
    font-weight: 600;
}
.skip-link:focus { top: var(--space-4); }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

.text-center  { text-align: center; }
.text-start   { text-align: start; }
.text-end     { text-align: end; }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-sm      { font-size: var(--fs-sm); }
.text-xs      { font-size: var(--fs-xs); }
.text-upper   { text-transform: uppercase; letter-spacing: .08em; }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.w-full { width: 100%; }
.hidden,
[hidden] { display: none !important; }

/* Hide / show by breakpoint */
@media (max-width: 959.98px) { .hide-mobile  { display: none !important; } }
@media (min-width: 960px)    { .hide-desktop { display: none !important; } }

/* Image placeholder (when an item has no photo yet) */
.img-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--surface-alt), var(--primary-soft));
    color: var(--primary-light);
}
.img-placeholder svg { width: 40%; max-width: 64px; height: auto; opacity: .55; }

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-7) var(--space-4);
    text-align: center;
    color: var(--text-muted);
}
.empty-state svg { width: 56px; height: 56px; color: var(--border-strong); }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print: clean black-on-white (reports, invoices) */
@media print {
    body { background: #fff; color: #000; }
    .no-print { display: none !important; }
    .card { box-shadow: none; border-color: #ccc; }
}


/* ==========================================================================
   14. Header
   ========================================================================== */

/* ---- Brand logo (official horizontal logo image) ----
   Size is controlled by height only; width follows the image ratio (≈2.8:1). */
.brand { display: inline-flex; align-items: center; }
.brand__img {
    display: block;
    width: auto;
    height: var(--logo-h, 48px);
}
.brand--sm { --logo-h: 38px; }

/* ---- Sticky header bar ---- */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: rgba(250, 246, 240, .86);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid transparent;
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.site-header.is-scrolled {
    background: rgba(255, 255, 255, .94);
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

/* Mobile:  [☰]   [logo]   [bag]
   Desktop: [logo]  [nav]   [search · EN|ع · My Order] */
.site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-4);
    height: var(--header-height);
}
.site-header__toggle  { justify-self: start; margin-inline-start: -8px; }
.site-header__brand   { justify-self: center; border-radius: var(--radius-sm); }
.site-header__actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.site-header__cart { position: relative; margin-inline-end: -8px; }

/* Mobile: the logo is centered on the SCREEN (not between the side buttons),
   so it stays perfectly centered whatever sits on the left/right. */
@media (max-width: 959.98px) {
    .site-header__inner   { position: relative; }
    .site-header__toggle  { grid-column: 1; }
    .site-header__actions { grid-column: 3; gap: var(--space-2); }
    .site-header__brand {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}
@media (min-width: 960px) {
    .site-header__brand { justify-self: start; }
}

/* Mobile language button (shows the OTHER language: "ع" or "EN") */
.lang-toggle {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 32px;
    padding-inline: var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--primary);
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 700;
    line-height: 1;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}
.lang-toggle[lang="ar"] { font-family: var(--font-arabic); font-size: var(--fs-base); padding-bottom: 3px; }
.lang-toggle:hover { background: var(--primary); border-color: var(--primary); color: var(--text-inverse); }

/* Very small phones: slightly smaller logo so nothing touches */
@media (max-width: 379.98px) {
    .site-header .site-header__brand .brand { --logo-h: 34px; }
}

/* ---- Desktop navigation ---- */
.site-nav__list {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}
.site-nav__link {
    position: relative;
    display: inline-block;
    padding-block: .5rem;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--text-soft);
    transition: color var(--transition);
}
.site-nav__link::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -2px;
    height: 2px;
    border-radius: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform .25s var(--ease);
}
.site-nav__link:hover { color: var(--text); }
.site-nav__link:hover::after { transform: scaleX(.4); }
.site-nav__link[aria-current="page"] { color: var(--text); font-weight: 600; }
.site-nav__link[aria-current="page"]::after { transform: scaleX(1); }

/* "My Order" pill */
.site-header__order { position: relative; padding-inline: 1.25rem 1.4rem; }
.site-header__order .count-bubble { top: -6px; inset-inline-end: -6px; }

/* ---- Mobile slide-in drawer ---- */
.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    visibility: hidden;
    transition: visibility 0s linear .32s;
}
.mobile-nav.is-open {
    visibility: visible;
    transition-delay: 0s;
}
.mobile-nav__backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    transition: opacity .32s var(--ease);
}
.mobile-nav.is-open .mobile-nav__backdrop { opacity: 1; }

.mobile-nav__panel {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    width: min(86vw, 360px);
    padding: var(--space-4) var(--space-5) calc(var(--space-5) + env(safe-area-inset-bottom));
    overflow-y: auto;
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform .32s var(--ease);
}
[dir="rtl"] .mobile-nav__panel { transform: translateX(100%); }
.mobile-nav__panel:focus { outline: none; }
.mobile-nav.is-open .mobile-nav__panel { transform: none; }

.mobile-nav__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border);
}

.mobile-nav__list { display: grid; gap: var(--space-2); }
.mobile-nav__link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    font-weight: 600;
    transition: background-color var(--transition);
}
.mobile-nav__link .icon-circle { width: 42px; height: 42px; }
.mobile-nav__link .icon-circle svg { width: 20px; height: 20px; }
.mobile-nav__link:hover { background: var(--surface); }
.mobile-nav__link[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.mobile-nav__link[aria-current="page"] .icon-circle { background: var(--primary); color: var(--text-inverse); }
.mobile-nav__chevron { width: 18px; height: 18px; margin-inline-start: auto; color: var(--text-muted); }

.mobile-nav__section { display: grid; gap: var(--space-2); }
.mobile-nav__label {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
[dir="rtl"] .mobile-nav__label { letter-spacing: 0; }
.mobile-nav__section .lang-switch { justify-self: start; }
.mobile-nav__section .lang-switch a { min-width: 84px; height: 34px; font-size: var(--fs-sm); }

.mobile-nav__info {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: var(--fs-sm);
    color: var(--text-soft);
}
.mobile-nav__info li { display: flex; align-items: center; gap: var(--space-3); }
.mobile-nav__info svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }

.mobile-nav__staff {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: auto;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}
.mobile-nav__staff svg { width: 18px; height: 18px; }
.mobile-nav__staff:hover { color: var(--primary); }

/* ---- Mobile bottom tab bar ---- */
.tabbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: var(--z-header);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(43, 29, 26, .06);
}
.tabbar__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition);
}
.tabbar__item svg { width: 22px; height: 22px; }
.tabbar__icon { position: relative; }
.tabbar__icon .count-bubble { top: -6px; inset-inline-end: -10px; }
.tabbar__item:hover { color: var(--text); }
.tabbar__item[aria-current="page"] { color: var(--primary); font-weight: 600; }
.tabbar__item[aria-current="page"]::before {
    content: "";
    position: absolute;
    top: 0;
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--primary);
}

/* Keep page content & toasts above the fixed tab bar on mobile */
@media (max-width: 959.98px) {
    :root { --header-height: 64px; }
    body.site { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    body.site .toast-stack { bottom: calc(76px + env(safe-area-inset-bottom)); }
    .site-header .brand { --logo-h: 40px; }
}

.site-main:focus { outline: none; }

/* Footer always sits at the bottom, even on short pages */
body.site {
    display: flex;
    flex-direction: column;
}
.site-main { flex: 1 0 auto; }


/* ==========================================================================
   15. Footer
   ========================================================================== */

/* ---- CTA band above the footer (About / Contact pages) ---- */
.footer-cta {
    position: relative;
    margin-top: var(--space-8);
    padding-block: var(--space-8);
    background:
        linear-gradient(100deg, rgba(28, 20, 18, .92) 0%, rgba(94, 18, 32, .78) 55%, rgba(28, 20, 18, .35) 100%),
        url("../images/menu_bar.png") center / cover no-repeat;
    color: var(--text-inverse);
    overflow: hidden;
}
[dir="rtl"] .footer-cta {
    background:
        linear-gradient(-100deg, rgba(28, 20, 18, .92) 0%, rgba(94, 18, 32, .78) 55%, rgba(28, 20, 18, .35) 100%),
        url("../images/menu_bar.png") center / cover no-repeat;
}
.footer-cta__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
}
.footer-cta__title { color: var(--text-inverse); font-size: var(--fs-2xl); }
.footer-cta__text  { margin-top: var(--space-2); color: rgba(255, 255, 255, .8); max-width: 46ch; }
.footer-cta .btn--light:hover { --btn-bg: #fff; --btn-color: var(--primary); box-shadow: var(--shadow-lg); }

/* ---- Footer ---- */
.site-footer {
    position: relative;
    padding-top: var(--space-8);
    background:
        radial-gradient(60% 80% at 100% 0%, rgba(123, 30, 43, .28), transparent 60%),
        var(--sidebar-bg);
    color: var(--sidebar-text);
    font-size: var(--fs-sm);
}
.footer-cta + .site-footer { margin-top: 0; }
.site-main + .site-footer  { margin-top: var(--space-8); }

.site-footer p { color: var(--sidebar-text); }
.site-footer a { transition: color var(--transition); }
.site-footer a:hover { color: var(--text-inverse); }

.site-footer__grid {
    display: grid;
    gap: var(--space-6) var(--space-5);
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-footer__brand { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
    .site-footer__grid { grid-template-columns: 1.5fr 1fr 1.2fr 1.1fr; gap: var(--space-6); }
    .site-footer__brand { grid-column: auto; }
}

/* Logo on dark background */
.site-footer__brand .brand { --logo-h: 58px; }

.site-footer__about {
    max-width: 34ch;
    margin-top: var(--space-4);
    color: var(--sidebar-text);
    opacity: .85;
}

.site-footer__socials {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-5);
}
.site-footer__socials a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    color: var(--sidebar-text);
    transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}
.site-footer__socials a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.site-footer__socials svg { width: 18px; height: 18px; }

.site-footer__title {
    margin-bottom: var(--space-4);
    font-size: var(--fs-md);
    color: var(--text-inverse);
}

.site-footer__links { display: grid; gap: var(--space-3); }
.site-footer__links a,
.site-footer__links button {
    position: relative;
    display: inline-block;
    color: var(--sidebar-text);
    font-size: var(--fs-sm);
    text-align: start;
}
.site-footer__links button:hover { color: var(--text-inverse); }
.site-footer__links [aria-current="page"] { color: #F0B9C0; }

.site-footer__contact { display: grid; gap: var(--space-3); }
.site-footer__contact li,
.site-footer__hours {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}
.site-footer__contact svg,
.site-footer__hours svg {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    color: #E08A97;
}
.site-footer__contact a { overflow-wrap: anywhere; }

.site-footer__rate {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    margin-top: var(--space-5);
    padding: var(--space-3) var(--space-4);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .04);
}
.site-footer__rate-label {
    font-size: var(--fs-xs);
    color: var(--sidebar-text);
    opacity: .7;
}
.site-footer__rate strong { color: var(--text-inverse); font-weight: 600; }

/* Bottom bar */
.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-5);
    margin-top: var(--space-7);
    padding-block: var(--space-5);
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: var(--fs-xs);
}
.site-footer__bottom p { color: var(--sidebar-text); opacity: .75; }
.site-footer__crafted { display: inline-flex; align-items: center; gap: var(--space-1); }
.site-footer__crafted svg { width: 14px; height: 14px; color: #E08A97; fill: currentColor; }
.site-footer__credit a {
    color: var(--text-inverse);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(224, 138, 151, .6);
    text-underline-offset: 3px;
}
.site-footer__credit a:hover { color: #F0B9C0; text-decoration-color: currentColor; }
.site-footer__bottom-links {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}
.site-footer__bottom-links > a { opacity: .75; }
.site-footer__bottom-links > a:hover { opacity: 1; }

@media (max-width: 639.98px) {
    .site-footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ---- Floating "back to top" button ---- */
.back-to-top {
    position: fixed;
    inset-inline-end: var(--space-4);
    bottom: var(--space-4);
    z-index: calc(var(--z-header) - 1);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity var(--transition), transform var(--transition), visibility 0s linear .2s,
                background-color var(--transition), color var(--transition);
}
.back-to-top svg { width: 20px; height: 20px; transform: rotate(180deg); }
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
}
.site-footer .back-to-top:hover { background: var(--primary); color: #fff; }

@media (max-width: 959.98px) {
    .back-to-top { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media print {
    .site-footer, .footer-cta, .tabbar, .back-to-top { display: none !important; }
}


/* ==========================================================================
   16. Menu page
   ========================================================================== */

/* ---- Hero ---- */
.menu-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: 300px;
    padding-block: var(--space-7) 5.5rem;
    overflow: hidden;
    color: var(--text-inverse);
    background: var(--sidebar-bg);
}
.menu-hero::before,
.menu-hero::after {
    content: "";
    position: absolute;
    inset: 0;
}
.menu-hero::before {
    z-index: -2;
    background: url("../images/menu_bar.png") 70% center / cover no-repeat;
}
.menu-hero::after {
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(28, 20, 18, .88) 0%, rgba(28, 20, 18, .6) 45%, rgba(28, 20, 18, .1) 80%),
        linear-gradient(0deg, rgba(28, 20, 18, .35), transparent 40%);
}
/* Arabic: mirror the photo so the cup stays on the side opposite the text */
[dir="rtl"] .menu-hero::before { transform: scaleX(-1); }
[dir="rtl"] .menu-hero::after {
    background:
        linear-gradient(-90deg, rgba(28, 20, 18, .88) 0%, rgba(28, 20, 18, .6) 45%, rgba(28, 20, 18, .1) 80%),
        linear-gradient(0deg, rgba(28, 20, 18, .35), transparent 40%);
}

.menu-hero__inner { position: relative; }
.menu-hero__eyebrow { color: rgba(255, 255, 255, .88); }
.menu-hero__title {
    max-width: 16ch;
    margin-top: var(--space-3);
    color: var(--text-inverse);
    font-size: clamp(2.1rem, 1.5rem + 2.8vw, 3.4rem);
    font-weight: 500;
    line-height: 1.12;
}
.menu-hero__text {
    max-width: 34ch;
    margin-top: var(--space-4);
    color: rgba(255, 255, 255, .86);
    font-size: var(--fs-md);
}

@media (min-width: 960px) {
    .menu-hero { min-height: 380px; padding-block: var(--space-8) 6.5rem; }
}
@media (max-width: 639.98px) {
    .menu-hero::before { background-position: 78% center; }
    .menu-hero::after  { background: linear-gradient(90deg, rgba(28, 20, 18, .85), rgba(28, 20, 18, .45)); }
    [dir="rtl"] .menu-hero::after { background: linear-gradient(-90deg, rgba(28, 20, 18, .85), rgba(28, 20, 18, .45)); }
    .menu-hero__text { font-size: var(--fs-base); }
}

/* ---- Search bar (overlaps the hero) ---- */
.menu-search {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    height: 60px;
    margin-top: -30px;
    padding-inline-start: 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transition: box-shadow var(--transition), border-color var(--transition);
}
.menu-search:focus-within { border-color: var(--primary); box-shadow: var(--shadow-lg), 0 0 0 4px var(--primary-ring); }
/* While the filter dropdown is open, lift it above the sticky category bar */
.menu-search:has(.menu-filter__panel:not([hidden])) { z-index: calc(var(--z-header) - 1); }
.menu-search__icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--text-muted); }
.menu-search__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding-inline: var(--space-3);
    border: 0;
    background: transparent;
    font-size: var(--fs-base);
    outline: none;
}
.menu-search__input::placeholder { color: var(--text-muted); }
.menu-search__input::-webkit-search-cancel-button { appearance: none; }
.menu-search__clear {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-inline-end: var(--space-1);
    border-radius: 50%;
    color: var(--text-muted);
}
.menu-search__clear:hover { background: var(--surface-alt); color: var(--text); }
.menu-search__clear svg { width: 18px; height: 18px; }

/* Filter button + dropdown */
.menu-filter { position: relative; height: 100%; }
.menu-filter__toggle {
    position: relative;
    display: grid;
    place-items: center;
    width: 60px;
    height: 100%;
    border-inline-start: 1px solid var(--border);
    color: var(--text);
    transition: color var(--transition), background-color var(--transition);
}
.menu-filter__toggle:hover,
.menu-filter__toggle[aria-expanded="true"] { color: var(--primary); background: var(--primary-soft); }
.menu-filter__toggle svg { width: 20px; height: 20px; }
[dir="ltr"] .menu-filter__toggle { border-radius: 0 var(--radius) var(--radius) 0; }
[dir="rtl"] .menu-filter__toggle { border-radius: var(--radius) 0 0 var(--radius); }
.menu-filter__dot {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--surface);
}
.menu-filter__panel {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    z-index: var(--z-dropdown);
    display: grid;
    gap: var(--space-4);
    width: 270px;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: pop-in .18s var(--ease);
}
.menu-filter__panel fieldset { display: grid; gap: var(--space-1); border: 0; padding: 0; }
.menu-filter__legend {
    margin-bottom: var(--space-2);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
}
[dir="rtl"] .menu-filter__legend { letter-spacing: 0; }
.menu-filter__option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    cursor: pointer;
}
.menu-filter__option:hover { background: var(--surface-alt); }
.menu-filter__option input { accent-color: var(--primary); width: 16px; height: 16px; }
.menu-filter__featured { padding-top: var(--space-3); border-top: 1px solid var(--border); }

@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---- Category chips (sticky under the header) ---- */
.menu-cats {
    position: sticky;
    top: var(--header-height);
    z-index: calc(var(--z-header) - 2);
    padding-block: var(--space-4) var(--space-2);
    background: var(--bg);
    transition: box-shadow var(--transition);
}
.menu-cats.is-stuck { box-shadow: 0 10px 16px -12px rgba(43, 29, 26, .18); }

.menu-cats__track {
    display: flex;
    gap: var(--space-2);
    padding-bottom: var(--space-2);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
.menu-cats__track::-webkit-scrollbar { display: none; }
@media (min-width: 960px) {
    .menu-cats__track { justify-content: space-between; }
}

.menu-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 84px;
    padding: var(--space-3) var(--space-3) var(--space-2);
    border-radius: 18px;
    color: var(--text-soft);
    font-size: var(--fs-xs);
    font-weight: 500;
    white-space: nowrap;
    scroll-snap-align: start;
    transition: background-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.menu-cat__icon { color: var(--primary); transition: color var(--transition); }
.menu-cat__icon svg { width: 26px; height: 26px; }
.menu-cat:hover { background: var(--surface); color: var(--text); }
.menu-cat[aria-current="true"] {
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-primary);
}
.menu-cat[aria-current="true"] .menu-cat__icon { color: var(--text-inverse); }

/* Uploaded category image instead of an icon */
.menu-cat__img {
    width: 44px;
    height: 44px;
    margin-block: -9px -3px;          /* keep the chip the same height as icon chips */
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px var(--surface);
}
.menu-cat[aria-current="true"] .menu-cat__img { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.menu-section__icon { overflow: hidden; }
.menu-section__img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 639.98px) {
    .menu-cat { min-width: 72px; padding-inline: var(--space-2); }
    .menu-cat__icon svg { width: 24px; height: 24px; }
}

/* ---- Sections ---- */
.menu { padding-bottom: var(--space-4); }
.menu__status { min-height: 1.5em; font-size: var(--fs-sm); color: var(--text-muted); }
.menu__status:empty { min-height: 0; }

.menu-section {
    padding-top: var(--space-5);
    scroll-margin-top: calc(var(--header-height) + 120px);
}
.menu-section + .menu-section { padding-top: var(--space-6); }

.menu-section__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.menu-section__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
}
.menu-section__icon svg { width: 22px; height: 22px; }
.menu-section__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 var(--space-4);
    min-width: 0;
}
.menu-section__title { font-size: var(--fs-xl); font-weight: 500; }
.menu-section__tagline { font-size: var(--fs-sm); color: var(--text-muted); }
.menu-section__all {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-inline-start: auto;
    flex-shrink: 0;
    color: var(--primary);
    font-size: var(--fs-sm);
    font-weight: 600;
    white-space: nowrap;
}
.menu-section__all svg { width: 16px; height: 16px; transition: transform var(--transition); }
.menu-section__all:hover svg { transform: translateX(3px); }
[dir="rtl"] .menu-section__all:hover svg { transform: scaleX(-1) translateX(3px); }

@media (max-width: 639.98px) {
    .menu-section__heading { flex-direction: column; gap: 0; }
    .menu-section__title { font-size: var(--fs-lg); }
    .menu-section__tagline { font-size: var(--fs-xs); }
}

/* ---- Item grid & cards ---- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}
@media (min-width: 640px) { .menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); } }
@media (min-width: 960px) { .menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); } }

.menu-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.menu-card:has(.menu-card__open:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }

.menu-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-alt);
}
.menu-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--ease);
}
.menu-card:hover .menu-card__media img { transform: scale(1.06); }

.menu-card__badge {
    position: absolute;
    top: var(--space-2);
    inset-inline-start: var(--space-2);
    box-shadow: var(--shadow-sm);
}
.menu-card__badge svg { width: 12px; height: 12px; fill: currentColor; }

.menu-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3) var(--space-4) var(--space-4);
}
.menu-card__title {
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: 1.25;
}
.menu-card__open { text-align: start; font: inherit; color: inherit; }
/* Stretch the button over the whole card */
.menu-card__open::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}
.menu-card__open:focus-visible { outline: none; }

.menu-card__desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}
.menu-card__foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: auto;
    padding-top: var(--space-3);
}
.menu-card__add {
    position: relative;
    z-index: 2;     /* above the stretched button */
    width: 36px;
    height: 36px;
}
.menu-card__add svg { width: 18px; height: 18px; }
.menu-card__add.is-added { animation: add-pop .45s var(--ease); }

@keyframes add-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.25); background: var(--success); }
    100% { transform: scale(1); }
}

@media (max-width: 639.98px) {
    .menu-card__body  { padding: var(--space-2) var(--space-3) var(--space-3); }
    .menu-card__title { font-size: var(--fs-base); }
    .menu-card__desc  { font-size: var(--fs-xs); -webkit-line-clamp: 1; }
    .menu-card .price__usd { font-size: var(--fs-sm); }
    .menu-card .price__lbp { font-size: 10px; }
    .menu-card__add { width: 32px; height: 32px; }
}


/* ==========================================================================
   17. Item modal & cart
   ========================================================================== */

/* ---- Quantity stepper ---- */
.qty {
    display: inline-flex;
    align-items: center;
    height: 52px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
}
.qty__btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--text);
    transition: background-color var(--transition), color var(--transition);
}
.qty__btn:hover { background: var(--primary-soft); color: var(--primary); }
.qty__btn svg { width: 18px; height: 18px; }
.qty__value { min-width: 2.25rem; text-align: center; font-weight: 700; }

.qty--sm { height: 36px; padding: 2px; }
.qty--sm .qty__btn { width: 30px; height: 30px; }
.qty--sm .qty__btn svg { width: 14px; height: 14px; }
.qty--sm .qty__value { min-width: 1.75rem; font-size: var(--fs-sm); }

/* ---- Item details modal (native <dialog>) ---- */
.item-modal {
    width: min(900px, calc(100vw - 2rem));
    max-width: none;
    max-height: calc(100dvh - 2rem);
    margin: auto;           /* restore native dialog centering (reset sets margin: 0) */
    padding: 0;
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.item-modal::backdrop {
    background: rgba(28, 20, 18, .62);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
.item-modal[open] { animation: modal-in .3s var(--ease); }
.item-modal[open]::backdrop { animation: fade-in .3s var(--ease); }

.item-modal__inner {
    position: relative;
    display: grid;
    max-height: inherit;
    overflow-y: auto;
    overscroll-behavior: contain;
}
@media (min-width: 768px) {
    .item-modal__inner { grid-template-columns: 1.05fr 1fr; }
}

.item-modal__close {
    position: absolute;
    top: var(--space-3);
    inset-inline-end: var(--space-3);
    z-index: 2;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow-sm);
}
.item-modal__close:hover { background: #fff; color: var(--primary); }

.item-modal__media {
    display: flex;
    flex-direction: column;
    background: var(--surface-alt);
}
.item-modal__image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
@media (min-width: 768px) {
    .item-modal__image { flex: 1; aspect-ratio: auto; min-height: 380px; }
}
.item-modal__image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fade-in .25s var(--ease);
}
.item-modal__image .img-placeholder { position: absolute; inset: 0; }
.item-modal__image .img-placeholder svg { max-width: 96px; }

.item-modal__thumbs {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3);
    overflow-x: auto;
}
.item-modal__thumb {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    opacity: .7;
    transition: opacity var(--transition), border-color var(--transition);
}
.item-modal__thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-modal__thumb:hover { opacity: 1; }
.item-modal__thumb[aria-current="true"] { border-color: var(--primary); opacity: 1; }

.item-modal__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-6) var(--space-5);
}
.item-modal__title { font-size: var(--fs-2xl); font-weight: 500; }
.item-modal__price { margin-top: var(--space-1); }
.item-modal__desc  { color: var(--text-soft); white-space: pre-line; }

/* Checkout footer: [Quantity  − 1 +]   [Total $16.50 / LBP …]
                    [ 🛍 Add to my order                    ] */
.item-modal__actions {
    display: grid;
    gap: var(--space-4);
    margin-top: auto;
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
}
.item-modal__row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
}
.item-modal__qty,
.item-modal__total {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.item-modal__total { align-items: flex-end; text-align: end; }
.item-modal__label {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
[dir="rtl"] .item-modal__label { letter-spacing: 0; }
.item-modal__total .price__usd { font-size: var(--fs-lg); color: var(--text); }
.item-modal__total .price__lbp { font-size: var(--fs-xs); }
.item-modal .qty { height: 46px; }
.item-modal .qty__btn { width: 38px; height: 38px; }
.item-modal__add { min-height: 54px; font-size: var(--fs-base); }

/* Phones: bottom sheet */
@media (max-width: 767.98px) {
    .item-modal {
        width: 100%;
        max-height: 92dvh;
        margin: auto 0 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    .item-modal[open] { animation: sheet-in .35s var(--ease); }
    .item-modal__body { padding: var(--space-5) var(--space-5) 0; }
    /* Checkout footer stays pinned at the bottom of the sheet while scrolling */
    .item-modal__actions {
        position: sticky;
        bottom: 0;
        margin-inline: calc(-1 * var(--space-5));
        padding: var(--space-4) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom));
        background: var(--surface);
        box-shadow: 0 -8px 16px -12px rgba(43, 29, 26, .2);
    }
}

@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }

/* ---- My Order drawer ---- */
.cart {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    visibility: hidden;
    transition: visibility 0s linear .32s;
}
.cart.is-open { visibility: visible; transition-delay: 0s; }
.cart__backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    transition: opacity .32s var(--ease);
}
.cart.is-open .cart__backdrop { opacity: 1; }

.cart__panel {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    display: flex;
    flex-direction: column;
    width: min(100vw, 430px);
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform .32s var(--ease);
}
[dir="rtl"] .cart__panel { transform: translateX(-100%); }
.cart.is-open .cart__panel { transform: none; }
.cart__panel:focus { outline: none; }

.cart__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--border);
}
.cart__title {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-lg);
}
.cart__title svg { width: 22px; height: 22px; color: var(--primary); }
.cart__subtitle { margin-top: var(--space-1); font-size: var(--fs-sm); color: var(--text-muted); }

.cart__list {
    flex: 1;
    display: grid;
    align-content: start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.cart__list:empty { display: none; }
.cart__empty { flex: 1; justify-content: center; }

.cart-line {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: var(--space-3);
    row-gap: var(--space-2);
    align-items: center;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    animation: fade-in .25s var(--ease);
}
.cart-line__media {
    grid-row: 1 / 3;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--surface-alt);
}
.cart-line__media img { width: 100%; height: 100%; object-fit: cover; }
.cart-line__media .img-placeholder svg { width: 26px; }
.cart-line__info { min-width: 0; }
.cart-line__name {
    overflow: hidden;
    color: var(--text);
    font-size: var(--fs-sm);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-line__unit { font-size: var(--fs-xs); color: var(--text-muted); }
.cart-line .qty { grid-column: 2; justify-self: start; }
.cart-line__end {
    grid-column: 3;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    align-self: stretch;
}
.cart-line__total { font-size: var(--fs-sm); font-weight: 700; }
.cart-line__remove {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--text-muted);
    transition: color var(--transition), background-color var(--transition);
}
.cart-line__remove:hover { background: var(--danger-soft); color: var(--danger); }
.cart-line__remove svg { width: 16px; height: 16px; }

.cart__foot {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5) calc(var(--space-4) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.cart__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    font-weight: 600;
}
.cart__total .price { align-items: flex-end; }
.cart__note {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: var(--fs-xs);
}
.cart__note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.cart__rate { font-size: var(--fs-xs); color: var(--text-muted); }
.cart__clear { justify-self: start; color: var(--text-muted); padding-inline: var(--space-3); }
.cart__clear:hover { color: var(--danger); }

/* While the drawer is open, show toasts on the opposite side so they don't cover it */
@media (min-width: 640px) {
    .cart.is-open ~ .toast-stack { inset-inline-end: auto; inset-inline-start: var(--space-4); }
}
@media (max-width: 639.98px) {
    .cart.is-open ~ .toast-stack { bottom: auto; top: var(--space-4); }
}


/* ==========================================================================
   18. Inner pages (shared) + About page
   ========================================================================== */

/* ---- Page banner (About, Contact, …) ---- */
.page-hero {
    position: relative;
    isolation: isolate;
    padding-block: var(--space-7) var(--space-8);
    overflow: hidden;
    background: var(--sidebar-bg);
    color: var(--text-inverse);
    text-align: center;
}
.page-hero::before,
.page-hero::after { content: ""; position: absolute; inset: 0; }
.page-hero::before {
    z-index: -2;
    background: url("../images/menu_bar.png") center 60% / cover no-repeat;
}
.page-hero::after {
    z-index: -1;
    background:
        radial-gradient(70% 90% at 50% 50%, rgba(28, 20, 18, .55), rgba(28, 20, 18, .85)),
        linear-gradient(0deg, rgba(94, 18, 32, .35), transparent 60%);
}
.page-hero__inner { display: flex; flex-direction: column; align-items: center; }
.page-hero__eyebrow { margin-top: var(--space-4); color: rgba(255, 255, 255, .85); }
.page-hero__title {
    margin-top: var(--space-2);
    color: var(--text-inverse);
    font-size: var(--fs-3xl);
    font-weight: 500;
}
.page-hero__text {
    max-width: 52ch;
    margin-top: var(--space-3);
    color: rgba(255, 255, 255, .85);
    font-size: var(--fs-md);
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, .7);
}
.breadcrumb li + li::before {
    content: "/";
    margin-inline-end: var(--space-2);
    opacity: .5;
}
.breadcrumb a:hover { color: var(--text-inverse); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb [aria-current="page"] { color: var(--text-inverse); font-weight: 600; }

/* ---- Section heading block ---- */
.section-intro {
    max-width: 640px;
    margin: 0 auto var(--space-6);
    text-align: center;
}
.section-intro h2 { font-size: var(--fs-2xl); font-weight: 500; }
.section-intro p  { margin-top: var(--space-2); color: var(--text-muted); }
.section-intro--split {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-3);
    max-width: none;
    margin-inline: 0;
    text-align: start;
}

/* ---- Story ---- */
.about-story__grid {
    display: grid;
    gap: var(--space-7);
    align-items: center;
}
@media (min-width: 960px) {
    .about-story__grid { grid-template-columns: 1fr 1.05fr; gap: var(--space-8); }
}

.about-story__media { position: relative; padding-bottom: var(--space-5); }
.about-story__photo {
    aspect-ratio: 4 / 3.4;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.about-story__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 82% center;     /* focus on the cup */
}
[dir="rtl"] .about-story__photo img { transform: scaleX(-1); }

.about-story__badge {
    position: absolute;
    bottom: 0;
    inset-inline-end: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    max-width: 280px;
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    font-family: var(--font-heading);
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1.25;
}
[dir="rtl"] .about-story__badge { padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); }
.about-story__badge img {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.about-story__content { display: grid; gap: var(--space-4); }
.about-story__title { font-size: var(--fs-2xl); font-weight: 500; }

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-3);
}
.about-stats__item {
    display: flex;
    flex-direction: column-reverse;    /* number above label, while dt stays first in the markup */
    justify-content: center;
    gap: 2px;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}
.about-stats dd {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--fs-2xl);
    font-weight: 600;
    font-variant-numeric: lining-nums tabular-nums;   /* Playfair defaults to old-style figures */
    line-height: 1.1;
    color: var(--primary);
}
.about-stats dt { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---- Values ---- */
.about-values { background: var(--surface); border-block: 1px solid var(--border); }
.about-values__grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
}
@media (min-width: 640px) { .about-values__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .about-values__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); } }

.value-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.value-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.value-card__icon { width: 52px; height: 52px; }
.value-card__icon svg { width: 24px; height: 24px; }
.value-card:hover .value-card__icon { background: var(--primary); color: var(--text-inverse); }
.value-card__title { font-size: var(--fs-md); }
.value-card__text  { font-size: var(--fs-sm); color: var(--text-muted); }

/* ---- Signature picks (reuses .menu-card) ---- */
.menu-card__go {
    position: relative;
    z-index: 2;
    background: var(--primary-soft);
    color: var(--primary);
    transition: background-color var(--transition), color var(--transition);
}
.menu-card:hover .menu-card__go { background: var(--primary); color: var(--text-inverse); }

/* ---- Visit card (address, hours, map) ---- */
.visit-card {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}
@media (min-width: 960px) {
    .visit-card { grid-template-columns: 1fr 1.1fr; }
}
.visit-card__info {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-6);
}
.visit-card__title { font-size: var(--fs-2xl); font-weight: 500; }
.visit-card__list { display: grid; gap: var(--space-4); margin-top: var(--space-3); }
.visit-card__list li { display: flex; align-items: center; gap: var(--space-3); }
.visit-card__list .icon-circle { width: 44px; height: 44px; }
.visit-card__list .icon-circle svg { width: 20px; height: 20px; }
.visit-card__list div { display: flex; flex-direction: column; font-size: var(--fs-sm); }
.visit-card__list strong { color: var(--text); }
.visit-card__list span,
.visit-card__list a { color: var(--text-soft); }
.visit-card__list a:hover { color: var(--primary); }
[dir="rtl"] .visit-card__list a.ltr { text-align: right; }
.visit-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.visit-card__map {
    position: relative;
    min-height: 320px;
    background: var(--surface-alt);
}
.visit-card__map iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.visit-card__map-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-5);
    background:
        radial-gradient(circle at 30% 30%, rgba(123, 30, 43, .10), transparent 45%),
        radial-gradient(circle at 75% 70%, rgba(78, 107, 58, .10), transparent 40%),
        repeating-linear-gradient(0deg, transparent 0 38px, rgba(43, 29, 26, .05) 38px 39px),
        repeating-linear-gradient(90deg, transparent 0 38px, rgba(43, 29, 26, .05) 38px 39px),
        var(--surface-alt);
    text-align: center;
}
.visit-card__map-fallback .icon-circle {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-primary);
}
.visit-card__map-fallback .icon-circle svg { width: 28px; height: 28px; }
.visit-card__map-fallback strong { font-family: var(--font-heading); font-size: var(--fs-lg); }
.visit-card__map-fallback .link { display: inline-flex; align-items: center; gap: var(--space-1); }
.visit-card__map-fallback .link svg { width: 16px; height: 16px; }

@media (max-width: 639.98px) {
    .page-hero { padding-block: var(--space-6) var(--space-7); }
    .about-story__badge { inset-inline-end: var(--space-3); font-size: var(--fs-sm); }
    .about-story__badge img { width: 46px; height: 46px; }
    .about-stats__item { padding: var(--space-3) var(--space-2); }
    .about-stats dd { font-size: var(--fs-xl); }
    .visit-card__info { padding: var(--space-5); }
    .visit-card__map { min-height: 240px; }
}


/* ==========================================================================
   19. Contact page
   ========================================================================== */
.contact__grid {
    display: grid;
    gap: var(--space-6);
    align-items: start;
}
@media (min-width: 960px) {
    .contact__grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: var(--space-7); }
    .contact__info { position: sticky; top: calc(var(--header-height) + var(--space-5)); }
}

.contact__heading { font-size: var(--fs-xl); font-weight: 500; }
.contact__info > p { margin-top: var(--space-2); }

/* Direct contact cards */
.contact-cards { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
.contact-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.contact-card:hover { border-color: transparent; box-shadow: var(--shadow); transform: translateY(-2px); }
.contact-card .icon-circle { transition: background-color var(--transition), color var(--transition); }
.contact-card:hover .icon-circle { background: var(--primary); color: var(--text-inverse); }
.contact-card--whatsapp:hover .icon-circle { background: #25D366; }
.contact-card__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: var(--fs-sm);
    color: var(--text-soft);
}
.contact-card__body strong { color: var(--text); font-size: var(--fs-base); }
.contact-card__body small {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: 2px;
    color: var(--text-muted);
}
.contact-card__body small svg { width: 14px; height: 14px; }
[dir="rtl"] .contact-card__body .ltr { text-align: right; }
.contact-card__arrow {
    width: 18px;
    height: 18px;
    margin-inline-start: auto;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color var(--transition), transform var(--transition);
}
.contact-card:hover .contact-card__arrow { color: var(--primary); transform: translateX(3px); }
[dir="rtl"] .contact-card:hover .contact-card__arrow { transform: scaleX(-1) translateX(3px); }

.contact__socials { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
.contact__social-list { display: flex; gap: var(--space-2); }
.contact__social-list a {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}
.contact__social-list a:hover { background: var(--primary); border-color: var(--primary); color: var(--text-inverse); }
.contact__social-list svg { width: 18px; height: 18px; }

/* Form card */
.contact__form-card {
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    scroll-margin-top: calc(var(--header-height) + var(--space-4));
}
.contact__form-head { margin-bottom: var(--space-5); }
.contact__form-head p { margin-top: var(--space-1); }
.contact__form-card .alert { margin-bottom: var(--space-5); }

.form-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}
.form-meta [data-counter-output] { margin-inline-start: auto; flex-shrink: 0; }
.form-meta [data-counter-output].is-near { color: var(--warning); }

.contact__submit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-top: var(--space-2);
}
.contact__submit .form-hint { display: inline-flex; align-items: center; gap: var(--space-2); max-width: 36ch; }
.contact__submit .form-hint svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--primary); }

.btn.is-loading { pointer-events: none; opacity: .8; }
.btn.is-loading svg { animation: spin-pulse 1s ease-in-out infinite; }
@keyframes spin-pulse { 50% { opacity: .3; } }

/* Success state */
.contact-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-3);
    text-align: center;
    animation: fade-in .4s var(--ease);
}
.contact-success__icon {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin-bottom: var(--space-2);
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    box-shadow: 0 0 0 10px rgba(46, 125, 79, .06);
}
.contact-success__icon svg { width: 36px; height: 36px; stroke-width: 2.25; }
.contact-success h2 { font-size: var(--fs-2xl); font-weight: 500; }
.contact-success p  { max-width: 42ch; margin-bottom: var(--space-3); }

/* Map */
.contact-map { padding-bottom: var(--space-4); }
.contact-map__frame {
    position: relative;
    aspect-ratio: 16 / 6;
    min-height: 300px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.contact-map__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (max-width: 639.98px) {
    .contact__form-card { padding: var(--space-5) var(--space-4); }
    .contact__submit .btn { width: 100%; }
}


/* ==========================================================================
   20. Auth pages (login, forgot / reset / change password)
   ========================================================================== */

/* "Back" arrows: arrow-right mirrored in English, natural in Arabic */
[dir="ltr"] .icon-flip-reverse { transform: scaleX(-1); }

.auth-body { background: var(--bg); }

.auth {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
}
@media (min-width: 960px) {
    .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---- Photo panel ---- */
.auth__visual {
    position: relative;
    isolation: isolate;
    display: none;
    overflow: hidden;
    background: var(--sidebar-bg);
    color: var(--text-inverse);
}
@media (min-width: 960px) { .auth__visual { display: block; } }
.auth__visual::before,
.auth__visual::after { content: ""; position: absolute; inset: 0; }
.auth__visual::before {
    z-index: -2;
    background: url("../images/menu_bar.png") 78% center / cover no-repeat;
}
[dir="rtl"] .auth__visual::before { transform: scaleX(-1); }
.auth__visual::after {
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(28, 20, 18, .55) 0%, rgba(28, 20, 18, .25) 40%, rgba(28, 20, 18, .9) 100%),
        linear-gradient(90deg, rgba(94, 18, 32, .35), transparent 70%);
}
.auth__visual-inner {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-6);
    height: 100vh;
    height: 100dvh;
    padding: var(--space-7);
}
.auth__visual .brand { --logo-h: 64px; }
.auth__visual-title {
    color: var(--text-inverse);
    font-family: var(--font-heading);
    font-size: var(--fs-3xl);
    font-weight: 500;
    line-height: 1.1;
    max-width: 12ch;
}
.auth__visual-text {
    max-width: 40ch;
    margin-top: var(--space-4);
    color: rgba(255, 255, 255, .82);
    font-size: var(--fs-md);
}
.auth__visual-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    align-self: flex-start;
    padding: var(--space-2) var(--space-4);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, .08);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-size: var(--fs-sm);
}
.auth__visual-badge svg { width: 16px; height: 16px; }

/* ---- Form side ---- */
.auth__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-4) var(--gutter) var(--space-5);
    background:
        radial-gradient(90% 60% at 100% 0%, rgba(123, 30, 43, .07), transparent 60%),
        var(--bg);
}
.auth__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 560px;
}
@media (min-width: 960px) { .auth__top { max-width: none; } }
.auth__back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-soft);
    transition: color var(--transition);
}
.auth__back svg { width: 16px; height: 16px; }
.auth__back:hover { color: var(--primary); }

.auth__card {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    width: 100%;
    max-width: 440px;
    margin-block: auto;
    padding: var(--space-6);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.auth__logo { align-self: center; }
.auth__logo .brand { --logo-h: 52px; }

.auth__head { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; }
.auth__head-icon { width: 54px; height: 54px; margin-bottom: var(--space-1); }
.auth__head-icon svg { width: 24px; height: 24px; }
.auth__title { font-size: var(--fs-xl); font-weight: 600; }
.auth__subtitle { font-size: var(--fs-sm); color: var(--text-muted); }

.auth__form { display: grid; gap: var(--space-4); }
.auth__form .btn--block { margin-top: var(--space-2); }
.auth__form .flex-between .link { font-size: var(--fs-xs); }

.auth__alt { display: flex; justify-content: center; font-size: var(--fs-sm); }
.auth__alt .link,
.auth__alt button.link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.auth__alt svg { width: 16px; height: 16px; }

.auth__done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
}
.auth__done .btn { margin-top: var(--space-3); }
.auth__done-icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: var(--space-2);
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    box-shadow: 0 0 0 10px rgba(46, 125, 79, .06);
}
.auth__done-icon svg { width: 32px; height: 32px; }
.auth__done-icon--error { background: var(--danger-soft); color: var(--danger); box-shadow: 0 0 0 10px rgba(192, 57, 43, .06); }

.auth__foot {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.auth__foot svg { width: 13px; height: 13px; }

/* ---- Password field with show/hide ---- */
.password-field > .form-control { padding-inline-end: 3rem; }
.password-field__toggle {
    position: absolute;
    top: 50%;
    inset-inline-end: 6px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-muted);
    transform: translateY(-50%);
    transition: background-color var(--transition), color var(--transition);
}
.password-field__toggle:hover { background: var(--surface-alt); color: var(--primary); }
.password-field__toggle svg { width: 18px; height: 18px; }
.password-field__toggle .icon-hide { display: none; }
.password-field__toggle[aria-pressed="true"] .icon-show { display: none; }
.password-field__toggle[aria-pressed="true"] .icon-hide { display: block; }

/* ---- Inline .link that is a <button> ---- */
button.link { padding: 0; background: none; border: 0; cursor: pointer; font: inherit; color: var(--primary); }

@media (max-width: 479.98px) {
    .auth__card { padding: var(--space-5) var(--space-4); border-radius: var(--radius); }
}


/* ==========================================================================
   21. Admin layout (sidebar, top bar, cards, tables)
   ========================================================================== */
.admin-body { background: var(--bg); }
.admin { min-height: 100vh; }

/* ---- Sidebar ---- */
.admin-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
        radial-gradient(120% 40% at 0% 0%, rgba(123, 30, 43, .22), transparent 60%),
        var(--sidebar-bg);
    color: var(--sidebar-text);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.admin-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-5) var(--space-4);
}
.admin-sidebar__brand .brand { --logo-h: 46px; }
/* Desktop: no close / hamburger buttons (doubled class beats .admin-icon-btn's display) */
.admin-sidebar__close.admin-sidebar__close,
.admin-topbar__menu.admin-topbar__menu { display: none; }

.admin-nav { flex: 1; padding: 0 var(--space-3) var(--space-3); }
.admin-nav__group {
    margin: var(--space-5) var(--space-3) var(--space-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(207, 197, 191, .5);
}
.admin-nav__list { display: grid; gap: 2px; }
.admin-nav__link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: .7rem .9rem;
    border-radius: 12px;
    font-size: .9375rem;
    font-weight: 500;
    color: var(--sidebar-text);
    transition: background-color var(--transition), color var(--transition);
}
.admin-nav__link svg { width: 20px; height: 20px; flex-shrink: 0; opacity: .85; }
.admin-nav__link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav__link[aria-current="page"] {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #fff;
    box-shadow: 0 8px 18px -6px rgba(123, 30, 43, .7);
}
.admin-nav__link[aria-current="page"] svg { opacity: 1; }
.admin-nav__badge {
    margin-inline-start: auto;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}
.admin-nav__link[aria-current="page"] .admin-nav__badge { background: #fff; color: var(--primary); }

.admin-sidebar__promo {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 140px;
    margin: var(--space-2) var(--space-4) var(--space-3);
    padding: var(--space-4);
    overflow: hidden;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(28, 20, 18, .1), rgba(28, 20, 18, .85)),
        url("../images/menu_bar.png") 80% center / cover no-repeat;
}
.admin-sidebar__promo p {
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.2;
}
.admin-sidebar__promo svg { display: inline; width: 16px; height: 16px; color: #F0B9C0; vertical-align: middle; }
@media (max-height: 780px) { .admin-sidebar__promo { display: none; } }

.admin-sidebar__foot {
    padding: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, .07);
}

/* ---- Main column ---- */
.admin-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-inline-start: var(--sidebar-width);
}

/* ---- Top bar ---- */
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    height: 72px;
    padding-inline: var(--space-6);
    border-bottom: 1px solid var(--border);
    background: rgba(250, 246, 240, .9);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
}
.admin-topbar__actions { display: flex; align-items: center; gap: var(--space-3); margin-inline-start: auto; }

.admin-icon-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}
.admin-icon-btn:hover { border-color: var(--border-strong); color: var(--primary); }
.admin-icon-btn svg { width: 20px; height: 20px; }
.admin-sidebar .admin-icon-btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: #fff; }

.admin-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 1 380px;
    height: 44px;
    padding-inline: var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.admin-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.admin-search svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.admin-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding-inline: var(--space-3);
    border: 0;
    background: transparent;
    font-size: var(--fs-sm);
    outline: none;
}

.admin-bell__dot {
    position: absolute;
    top: 9px;
    inset-inline-end: 10px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--surface);
}

.admin-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 4px var(--space-3) 4px 4px;
    border-radius: var(--radius-pill);
    text-align: start;
    transition: background-color var(--transition);
}
.admin-user:hover,
.admin-user[aria-expanded="true"] { background: var(--surface); }
.admin-user__text { display: flex; flex-direction: column; line-height: 1.25; }
.admin-user__text strong { font-size: var(--fs-sm); }
.admin-user__text small { font-size: var(--fs-xs); color: var(--text-muted); }
.admin-user__chevron { width: 16px; height: 16px; color: var(--text-muted); transition: transform var(--transition); }
.admin-user[aria-expanded="true"] .admin-user__chevron { transform: rotate(180deg); }

.admin-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 700;
}
.admin-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-avatar--sm { width: 36px; height: 36px; font-size: var(--fs-xs); background: var(--primary-soft); color: var(--primary); }

/* ---- Dropdowns ---- */
.admin-dropdown { position: relative; }
.admin-dropdown__menu {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    z-index: 400;
    min-width: 240px;
    padding: var(--space-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: pop-in .16s var(--ease);
}
.admin-dropdown__menu--wide { width: min(360px, calc(100vw - 2rem)); padding: 0; }
.admin-dropdown__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
}
.admin-dropdown__profile {
    display: flex;
    flex-direction: column;
    padding: var(--space-2) var(--space-3) var(--space-3);
    margin-bottom: var(--space-1);
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-sm);
}
.admin-dropdown__profile span { color: var(--text-muted); font-size: var(--fs-xs); }
.admin-dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: .6rem .75rem;
    border-radius: 10px;
    font-size: var(--fs-sm);
    color: var(--text);
    text-align: start;
    transition: background-color var(--transition), color var(--transition);
}
.admin-dropdown__item svg { width: 18px; height: 18px; color: var(--text-muted); }
.admin-dropdown__item:hover { background: var(--surface-alt); }
.admin-dropdown__item--danger,
.admin-dropdown__item--danger svg { color: var(--danger); }
.admin-dropdown__item--danger:hover { background: var(--danger-soft); }
.admin-dropdown__empty {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-4);
    font-size: var(--fs-sm);
    color: var(--text-muted);
}
.admin-dropdown__empty svg { width: 18px; height: 18px; color: var(--success); }
.admin-dropdown__foot {
    display: block;
    padding: var(--space-3);
    border-top: 1px solid var(--border);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--primary);
    text-align: center;
}
.admin-dropdown__foot:hover { background: var(--surface-alt); }

.admin-notes { max-height: 320px; overflow-y: auto; }
.admin-notes a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3) var(--space-4);
    transition: background-color var(--transition);
}
.admin-notes a:hover { background: var(--surface-alt); }
.admin-notes__icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
}
.admin-notes__icon svg { width: 16px; height: 16px; }
.admin-notes__body { display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-sm); }
.admin-notes__body span { overflow: hidden; color: var(--text-muted); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.admin-notes time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ---- Content area ---- */
.admin-content {
    flex: 1;
    width: 100%;
    max-width: 1520px;
    margin-inline: auto;
    padding: var(--space-6);
}
.admin-content:focus { outline: none; }

.admin-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.admin-footer a { color: var(--primary); font-weight: 600; }

.admin-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.admin-page-title { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem); font-weight: 600; }
.admin-page-sub   { margin-top: var(--space-1); color: var(--text-muted); }

/* Period selector */
.admin-range {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 44px;
    padding-inline: var(--space-4) var(--space-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.admin-range > svg { width: 18px; height: 18px; color: var(--primary); }
.admin-range select {
    height: 100%;
    padding-inline: var(--space-1) var(--space-6);
    border: 0;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A7B73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .4rem center;
    font-size: var(--fs-sm);
    font-weight: 600;
    appearance: none;
    cursor: pointer;
    outline: none;
}

/* Cards */
.admin-card {
    min-width: 0;
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.admin-card--flush { padding: 0; overflow: hidden; }
.admin-card--flush > .admin-card__head { padding: var(--space-5) var(--space-5) 0; }
.admin-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.admin-card__title { font-family: var(--font-body); font-size: 1.0625rem; font-weight: 600; }
.admin-card__sub   { margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); }
.admin-link { font-size: var(--fs-sm); font-weight: 600; color: var(--primary); white-space: nowrap; }
.admin-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { min-width: 100%; font-size: var(--fs-sm); }
.admin-table th {
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border);
    background: #FCFAF7;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-align: start;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}
.admin-table td {
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr { transition: background-color var(--transition); }
.admin-table tbody tr:hover { background: #FCFAF7; }
.admin-table .num { text-align: end; font-variant-numeric: tabular-nums; }
.admin-table--compact th,
.admin-table--compact td { padding: var(--space-2) var(--space-3); }
.nowrap { white-space: nowrap; }
.show-sm { display: none; }
/* !important: these helpers must win over component display rules (e.g. .admin-action { display: grid }) */
@media (max-width: 639.98px) {
    .hide-sm { display: none !important; }
    .show-sm { display: block; }
}
@media (max-width: 1599.98px) and (min-width: 1200px), (max-width: 899.98px) {
    .hide-md { display: none !important; }      /* hidden when its table sits in a narrow column */
}

/* Empty states */
.admin-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 260px;
    padding: var(--space-6) var(--space-4);
    font-size: var(--fs-sm);
    text-align: center;
    color: var(--text-muted);
}
.admin-empty svg { width: 44px; height: 44px; margin-bottom: var(--space-2); color: var(--border-strong); }
.admin-empty strong { color: var(--text); }
.admin-empty .btn { margin-top: var(--space-2); }
.admin-empty--sm { min-height: 0; padding-block: var(--space-6); }

/* ---- Mobile: off-canvas sidebar ---- */
.admin-backdrop { display: none; }

@media (max-width: 1099.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform .3s var(--ease);
        box-shadow: var(--shadow-lg);
    }
    .admin.is-sidebar-open .admin-sidebar { transform: none; }
    .admin-sidebar__close.admin-sidebar__close,
    .admin-topbar__menu.admin-topbar__menu { display: grid; }
    .admin-backdrop {
        position: fixed;
        inset: 0;
        z-index: 250;
        display: block;
        background: var(--overlay);
        opacity: 0;
        visibility: hidden;
        transition: opacity .3s var(--ease), visibility 0s linear .3s;
    }
    .admin.is-sidebar-open .admin-backdrop { opacity: 1; visibility: visible; transition-delay: 0s; }
    .admin-main { margin-inline-start: 0; }
}
@media (max-width: 767.98px) {
    .admin-topbar { gap: var(--space-2); height: 64px; padding-inline: var(--space-4); }
    .admin-search { display: none; }
    .admin-user { padding: 2px; }
    .admin-user__text,
    .admin-user__chevron { display: none; }
    .admin-content { padding: var(--space-4); }
    .admin-footer { padding-inline: var(--space-4); }
    .admin-page-head { margin-bottom: var(--space-5); }
    .admin-card { padding: var(--space-4); }
    .admin-card--flush > .admin-card__head { padding: var(--space-4) var(--space-4) 0; }
    .admin-table th, .admin-table td { padding-inline: var(--space-3); }
    .admin-table th:first-child, .admin-table td:first-child { padding-inline-start: var(--space-4); }
    .admin-table .badge { padding-inline: .5rem; }
}


/* ==========================================================================
   22. Admin dashboard
   ========================================================================== */

/* KPI cards */
.kpi-grid {
    display: grid;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 560px)  { .kpi-grid { gap: var(--space-4); } }
@media (min-width: 1280px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); } }

.kpi-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-card__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 14px;
}
.kpi-card__icon svg { width: 24px; height: 24px; }
.kpi-card__icon--primary { background: var(--primary-soft); color: var(--primary); }
.kpi-card__icon--info    { background: var(--info-soft);    color: var(--info); }
.kpi-card__icon--warning { background: var(--warning-soft); color: #A26E10; }
.kpi-card__icon--success { background: var(--success-soft); color: var(--success); }
.kpi-card__body { min-width: 0; }
.kpi-card__label { font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted); }
.kpi-card__value {
    margin-top: 2px;
    color: var(--text);
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    letter-spacing: -.01em;
}
.kpi-card__sub { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.kpi-card__trend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
    font-size: var(--fs-xs);
}
.trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 700;
}
.trend svg { width: 14px; height: 14px; }
.trend--good { background: var(--success-soft); color: var(--success); }
.trend--bad  { background: var(--danger-soft);  color: var(--danger); }
.trend--flat { background: var(--surface-alt);  color: var(--text-muted); }

/* Phones: compact KPI cards, two per row (icon above the numbers) */
@media (max-width: 559.98px) {
    .kpi-card { flex-direction: column; gap: var(--space-2); padding: var(--space-4) var(--space-3); }
    .kpi-card__icon { width: 38px; height: 38px; border-radius: 10px; }
    .kpi-card__icon svg { width: 19px; height: 19px; }
    .kpi-card__label { font-size: var(--fs-xs); }
    .kpi-card__value { font-size: 1.25rem; }
    .kpi-card__sub { font-size: 10.5px; }
    .kpi-card__trend { gap: 4px; margin-top: var(--space-1); font-size: 10.5px; }
    .trend { padding: 1px 6px; }
    .trend svg { width: 12px; height: 12px; }
}

/* Grid rows */
.dash-grid { display: grid; gap: var(--space-5); margin-bottom: var(--space-5); }
@media (min-width: 1200px) { .dash-grid--main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); } }
@media (min-width: 960px)  { .dash-grid--half { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-stack { display: grid; gap: var(--space-5); align-content: start; min-width: 0; }

/* Sales chart */
.mini-stats { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.mini-stats dt { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.mini-stats dd { margin: 0; font-size: var(--fs-base); font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-box { position: relative; height: 300px; }
@media (max-width: 639.98px) { .chart-box { height: 230px; } }
.chart-table { margin-top: var(--space-3); font-size: var(--fs-sm); }
.chart-table summary { width: max-content; color: var(--text-muted); cursor: pointer; }
.chart-table summary:hover { color: var(--primary); }
.chart-table .table-wrap { max-height: 260px; margin-top: var(--space-3); border: 1px solid var(--border); border-radius: 10px; }

/* Top selling items */
.top-items { display: grid; gap: var(--space-4); }
.top-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 88px;   /* fixed value column → bars line up */
    align-items: center;
    gap: var(--space-3);
}
.top-item__thumb {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface-alt);
}
.top-item__thumb img,
.top-item__thumb .img-placeholder { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.top-item__thumb .img-placeholder svg { width: 22px; }
.top-item__rank {
    position: absolute;
    top: -6px;
    inset-inline-start: -6px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--text);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}
.top-item:first-child .top-item__rank { background: var(--primary); }
.top-item__info { display: flex; flex-direction: column; min-width: 0; }
.top-item__info strong { overflow: hidden; font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.top-item__info > span:not(.top-item__bar) { font-size: var(--fs-xs); color: var(--text-muted); }
.top-item__bar { display: block; height: 4px; margin-top: 6px; border-radius: 4px; background: var(--surface-alt); overflow: hidden; }
.top-item__bar span { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.top-item__value { font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; }

/* Recent orders */
.order-no { display: block; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.order-meta { display: block; font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.order-meta.show-sm { display: none; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 639.98px) { .order-meta.show-sm { display: block; } }
.order-item { display: flex; align-items: center; gap: var(--space-3); min-width: 160px; }
.order-item small { display: block; }
.order-item__thumb { width: 36px; height: 36px; flex-shrink: 0; overflow: hidden; border-radius: 9px; background: var(--surface-alt); }
.order-item__thumb img,
.order-item__thumb .img-placeholder { width: 100%; height: 100%; object-fit: cover; }
.order-item__thumb .img-placeholder svg { width: 18px; }

/* Quick actions */
.quick-actions { display: grid; gap: var(--space-3); }
.quick-action {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid transparent;
    border-radius: 14px;
    background: #FBF3F3;
    transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}
.quick-action:hover { background: var(--primary-soft); border-color: rgba(123, 30, 43, .15); transform: translateX(2px); }
.quick-action__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 14px -6px rgba(123, 30, 43, .6);
}
.quick-action__icon svg { width: 20px; height: 20px; }
.quick-action__text { display: flex; flex-direction: column; min-width: 0; }
.quick-action__text strong { font-size: var(--fs-sm); color: var(--primary-dark); }
.quick-action__text small { font-size: var(--fs-xs); color: var(--text-muted); }
.quick-action__arrow { width: 18px; height: 18px; margin-inline-start: auto; color: var(--primary); opacity: .6; }

/* Expenses breakdown (one hue — the label carries identity) */
.breakdown { display: grid; gap: var(--space-4); }
.breakdown__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--space-3); align-items: baseline; }
.breakdown__label { font-size: var(--fs-sm); font-weight: 500; }
.breakdown__value { font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.breakdown__value small { margin-inline-start: 4px; font-weight: 500; color: var(--text-muted); }
.breakdown__bar { grid-column: 1 / -1; height: 8px; border-radius: 8px; background: var(--surface-alt); overflow: hidden; }
.breakdown__bar span { display: block; height: 100%; border-radius: 8px; background: var(--primary); }

/* Latest messages */
.msg-list { display: grid; gap: 2px; }
.msg-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: 12px;
    transition: background-color var(--transition);
}
.msg-item:hover { background: var(--surface-alt); }
.msg-item.is-unread { background: #FCF6F6; }
.msg-item__body { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: var(--fs-sm); }
.msg-item__top { display: flex; justify-content: space-between; gap: var(--space-2); }
.msg-item__top time { flex-shrink: 0; font-size: 11px; color: var(--text-muted); }
.msg-item__subject { font-size: var(--fs-xs); font-weight: 600; color: var(--primary); }
.msg-item__preview { overflow: hidden; font-size: var(--fs-xs); color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.msg-item.is-unread .msg-item__top strong::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-inline-start: 6px;
    border-radius: 50%;
    background: var(--primary);
    vertical-align: middle;
}


/* ==========================================================================
   23. Admin pages (shared components: split layout, sortable rows, forms)
   ========================================================================== */
.fw-400 { font-weight: 400; }

/* List + side form */
.admin-split { display: grid; gap: var(--space-5); align-items: start; }
@media (min-width: 1200px) {
    .admin-split { grid-template-columns: minmax(0, 1fr) 440px; }
    .admin-split--single { grid-template-columns: minmax(0, 1fr); }
    .admin-form-card { position: sticky; top: calc(72px + var(--space-5)); max-height: calc(100vh - 72px - var(--space-7)); overflow-y: auto; }
}
.admin-form-card { scroll-margin-top: 90px; }

.admin-hint {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.admin-hint svg { width: 14px; height: 14px; }

/* Small square icon buttons in table / list rows */
.admin-action {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--text-muted);
    transition: background-color var(--transition), color var(--transition);
}
.admin-action svg { width: 17px; height: 17px; }
.admin-action:hover { background: var(--surface-alt); color: var(--primary); }
.admin-action--danger:hover { background: var(--danger-soft); color: var(--danger); }
.admin-action:disabled { opacity: .35; cursor: not-allowed; background: none; color: var(--text-muted); }

.badge--button { border: 0; cursor: pointer; transition: filter var(--transition), box-shadow var(--transition); }
.badge--button:hover { filter: brightness(.96); box-shadow: 0 0 0 3px rgba(43, 29, 26, .06); }
a.badge:hover { filter: brightness(.96); }

/* ---- Sortable rows ---- */
.sort-list { padding: 0 var(--space-3) var(--space-3); }
.sort-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--surface);
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.sort-row + .sort-row { margin-top: 4px; }
.sort-row:hover { background: #FCFAF7; border-color: var(--border); }
.sort-row.is-current { background: var(--primary-soft); border-color: rgba(123, 30, 43, .2); }
.sort-row.is-muted .cat-visual,
.sort-row.is-muted .sort-row__info { opacity: .55; }
.sort-row.is-dragging {
    position: relative;
    z-index: 5;
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}
.sort-list.is-sorting { user-select: none; }
.sort-list.is-sorting .sort-row:not(.is-dragging) { transition: transform .18s var(--ease); }

.sort-row__handle {
    display: grid;
    place-items: center;
    width: 28px;
    height: 40px;
    border-radius: 8px;
    color: var(--border-strong);
    cursor: grab;
    touch-action: none;
}
.sort-row__handle:hover,
.sort-row__handle:focus-visible { background: var(--surface-alt); color: var(--text-muted); }
.sort-row__handle:active { cursor: grabbing; }
.sort-row__handle svg { width: 18px; height: 18px; }

.cat-visual {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
}
.cat-visual svg { width: 22px; height: 22px; }
.cat-visual img { width: 100%; height: 100%; object-fit: cover; }

.sort-row__info { display: flex; flex-direction: column; min-width: 0; }
.sort-row__info strong { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); font-size: var(--fs-base); }
.sort-row__ar { font-family: var(--font-arabic); font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted); }
.sort-row__info > span { overflow: hidden; font-size: var(--fs-xs); color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.sort-row__meta { display: flex; align-items: center; gap: var(--space-2); }
.sort-row__actions { display: flex; align-items: center; gap: 2px; }

@media (max-width: 767.98px) {
    .sort-list { padding: 0 var(--space-2) var(--space-2); }
    /* Row 1: [handle] [photo] [name ……………]
       Row 2: [handle] [badges ……] [actions] */
    .sort-row {
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        grid-template-areas:
            "handle visual info info"
            "handle meta   meta actions";
        row-gap: var(--space-2);
    }
    .sort-row__handle  { grid-area: handle; }
    .cat-visual        { grid-area: visual; width: 42px; height: 42px; }
    .sort-row__info    { grid-area: info; }
    .sort-row__meta    { grid-area: meta; }
    .sort-row__actions { grid-area: actions; justify-self: end; }
    .sort-row:not(:has(.sort-row__handle)) {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "visual info info" "meta meta actions";
    }
}

/* ---- Admin forms ---- */
.admin-form { display: grid; gap: var(--space-5); }
.admin-form .form-grid { gap: var(--space-4); }
.admin-form fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.admin-form__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .admin-form-card .form-grid--2 { grid-template-columns: 1fr; }
}

/* Live preview of a menu category chip */
.cat-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    background: var(--bg);
}
.cat-preview__label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.cat-preview__chip { background: var(--surface); box-shadow: var(--shadow-sm); pointer-events: none; }

/* Icon picker */
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: var(--space-2); }
.icon-picker__option { position: relative; cursor: pointer; }
.icon-picker__option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.icon-picker__option > span:not(.sr-only) {
    display: grid;
    place-items: center;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-soft);
    transition: border-color var(--transition), background-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.icon-picker__option svg { width: 22px; height: 22px; }
.icon-picker__option:hover > span:not(.sr-only) { border-color: var(--border-strong); color: var(--primary); }
.icon-picker__option input:checked + span { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.icon-picker__option input:focus-visible + span { box-shadow: 0 0 0 4px var(--primary-ring); }

/* Photo drop zone */
.file-drop {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3);
    border: 1.5px dashed var(--border-strong);
    border-radius: 14px;
    background: var(--bg);
    cursor: pointer;
    transition: border-color var(--transition), background-color var(--transition);
}
.file-drop:hover,
.file-drop.is-dragover { border-color: var(--primary); background: var(--primary-soft); }
.file-drop.is-invalid { border-color: var(--danger); }
.file-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop input[type="file"]:focus-visible ~ .file-drop__thumb { box-shadow: 0 0 0 4px var(--primary-ring); }
.file-drop__thumb {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--surface);
    color: var(--primary);
}
.file-drop__thumb svg { width: 24px; height: 24px; }
.file-drop__thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-drop__text { display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-sm); }
.file-drop__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--primary); }
.file-drop__text small { font-size: var(--fs-xs); color: var(--text-muted); }


/* ==========================================================================
   24. Admin pages — page-specific styles are added below as each page is built
   ========================================================================== */

/* ---- Small helpers ---- */
.d-block { display: block; }
.show-tab { display: none; }
@media (max-width: 1023.98px) {
    .hide-tab { display: none !important; }   /* full-width tables: hide secondary columns on tablets/phones */
    .show-tab { display: block; }
}
.show-md { display: none; }
@media (max-width: 1599.98px) and (min-width: 1200px), (max-width: 899.98px) { .show-md { display: block; } }

.admin-back {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-muted);
}
.admin-back svg { width: 16px; height: 16px; }
.admin-back:hover { color: var(--primary); }

/* ---- Summary strip ---- */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
@media (min-width: 768px) { .stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); } }
.stat-strip__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}
.stat-strip__item span { font-size: var(--fs-xs); color: var(--text-muted); }
.stat-strip__item strong { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }

/* ---- Filter bar ---- */
.admin-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}
.admin-filters__search {
    display: flex;
    align-items: center;
    flex: 1 1 240px;
    height: 42px;
    padding-inline: var(--space-3);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.admin-filters__search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); background: var(--surface); }
.admin-filters__search svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.admin-filters__search input { flex: 1; min-width: 0; height: 100%; padding-inline: var(--space-2); border: 0; background: transparent; font-size: var(--fs-sm); outline: none; }
.admin-select {
    height: 42px;
    padding: 0 2.25rem 0 var(--space-3);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A7B73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .7rem center;
    font-size: var(--fs-sm);
    appearance: none;
    cursor: pointer;
}
.admin-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
@media (max-width: 767.98px) {
    .admin-filters { padding: var(--space-3) var(--space-4); gap: var(--space-2); }
    .admin-filters__search { flex-basis: 100%; }
    .admin-select { flex: 1 1 calc(50% - var(--space-2)); min-width: 0; }
}

.admin-table-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
@media (max-width: 767.98px) { .admin-table-info { padding-inline: var(--space-4); } }

/* ---- Items table ---- */
.items-table tr.is-muted .item-cell,
.items-table tr.is-muted td:nth-last-child(n+3) { opacity: .6; }
.items-table .col-handle { width: 36px; padding-inline: var(--space-2) 0; }
.items-table tr.is-dragging { background: var(--surface); box-shadow: var(--shadow-lg); outline: 1px solid var(--primary); }

.item-cell { display: flex; align-items: center; gap: var(--space-3); min-width: 200px; }
.item-cell__thumb {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--surface-alt);
}
.item-cell__thumb img,
.item-cell__thumb .img-placeholder { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.item-cell__thumb .img-placeholder svg { width: 22px; }
.item-cell__count {
    position: absolute;
    right: -6px;
    bottom: -6px;
    padding: 1px 6px;
    border: 2px solid var(--surface);
    border-radius: var(--radius-pill);
    background: var(--text);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}
.item-cell__text { display: flex; flex-direction: column; min-width: 0; }
.item-cell__text strong { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.item-cell__text strong a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.item-cell__star svg { width: 14px; height: 14px; color: #C98A1B; fill: currentColor; }
.item-cell__ar { font-family: var(--font-arabic); font-size: var(--fs-xs); color: var(--text-muted); text-align: left; }
.item-cell__price { font-size: var(--fs-xs); font-weight: 700; color: var(--text); }
@media (max-width: 639.98px) {
    .item-cell { min-width: 0; gap: var(--space-2); }
    .item-cell__thumb { width: 44px; height: 44px; }
    .items-table .item-cell__text { max-width: 36vw; }
    .items-table .row-actions { flex-direction: column; }
    /* Reorder mode on phones: make room for the drag handles */
    .items-table:has(.col-handle) .item-cell__thumb { display: none; }
    .item-cell__text strong { white-space: normal; }
    .items-table .col-handle { width: 28px; padding-inline: var(--space-1) 0; }
    .item-cell__text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .status-stack { flex-direction: column; gap: 2px; }
}
.item-cell__cat { font-size: var(--fs-xs); color: var(--text-muted); }

.cat-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); white-space: nowrap; }
.cat-link svg { width: 16px; height: 16px; color: var(--primary); }
.cat-link:hover { color: var(--primary); }

.margin { font-size: var(--fs-xs); font-weight: 600; }
.margin--good { color: var(--success); }
.margin--ok   { color: #A26E10; }
.margin--low  { color: var(--danger); }

.status-stack { display: flex; align-items: center; gap: var(--space-2); }
.star-toggle {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: var(--border-strong);
    transition: color var(--transition), background-color var(--transition), transform var(--transition);
}
.star-toggle svg { width: 17px; height: 17px; }
.star-toggle:hover { background: var(--warning-soft); color: #C98A1B; }
.star-toggle.is-on { color: #C98A1B; }
.star-toggle.is-on svg { fill: currentColor; }
.star-toggle:active { transform: scale(.9); }

.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-4);
    border-top: 1px solid var(--border);
}
.pagination__num,
.pagination__btn {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding-inline: var(--space-3);
    border-radius: 10px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-soft);
    transition: background-color var(--transition), color var(--transition);
}
.pagination__num:hover,
.pagination__btn:hover { background: var(--surface-alt); color: var(--primary); }
.pagination__num[aria-current="page"] { background: var(--primary); color: #fff; }
.pagination__btn.is-disabled { opacity: .4; pointer-events: none; }
.pagination__gap { padding-inline: var(--space-1); color: var(--text-muted); }

/* ---- Item form ---- */
.item-form { display: grid; gap: var(--space-5); align-items: start; }
@media (min-width: 1100px) { .item-form { grid-template-columns: minmax(0, 1fr) 360px; } }
.item-form__main,
.item-form__side { display: grid; gap: var(--space-5); min-width: 0; }
@media (min-width: 1100px) {
    .item-form__save { position: sticky; top: calc(72px + var(--space-5)); }
}
.item-form__buttons { display: grid; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.item-form .switch { align-items: flex-start; }
.item-form .switch > span:last-child { font-size: var(--fs-sm); }
.item-form .switch small { font-size: var(--fs-xs); font-weight: 400; }

.input-prefix { position: relative; }
.input-prefix > span {
    position: absolute;
    top: 50%;
    inset-inline-start: var(--space-4);
    transform: translateY(-50%);
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
}
.input-prefix > .form-control { padding-inline-start: 2rem; font-variant-numeric: tabular-nums; font-weight: 600; }

.price-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding: var(--space-4);
    border-radius: 14px;
    background: var(--bg);
}
.price-summary dt { font-size: var(--fs-xs); color: var(--text-muted); }
.price-summary dd { margin: 2px 0 0; font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.price-summary dd.is-good { color: var(--success); }
.price-summary dd.is-ok   { color: #A26E10; }
.price-summary dd.is-low  { color: var(--danger); }
@media (max-width: 559.98px) { .price-summary { grid-template-columns: 1fr; } }

.file-drop--large { flex-direction: column; align-items: stretch; text-align: center; }
.file-drop--large .file-drop__thumb { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.file-drop--large .file-drop__thumb svg { width: 40px; height: 40px; color: var(--border-strong); }

.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.gallery-grid:empty { display: none; }
.gallery-thumb {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 12px;
    background: var(--surface-alt);
    cursor: pointer;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; transition: opacity var(--transition); }
.gallery-thumb input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gallery-thumb__remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--danger);
    box-shadow: var(--shadow-sm);
}
.gallery-thumb__remove svg { width: 15px; height: 15px; }
.gallery-thumb:has(input:checked) { border-color: var(--danger); }
.gallery-thumb:has(input:checked) img { opacity: .35; }
.gallery-thumb:has(input:checked) .gallery-thumb__remove { background: var(--danger); color: #fff; }
.gallery-thumb:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--primary-ring); }
.gallery-grid--new .gallery-thumb { cursor: default; border-color: var(--success); }

.danger-zone {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-5);
    border-color: #F3CBC6;
    background: #FFFBFA;
}


/* ==========================================================================
   25. Sales — list, sale view, point of sale, receipt
   ========================================================================== */

.admin-page-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ---- Period bar (presets + custom range) ---- */
.period-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.period-bar__presets {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    overflow-x: auto;
    scrollbar-width: none;
}
.period-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.period-chip span {
    display: block;
    padding: .45rem .9rem;
    border-radius: 10px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-soft);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition);
}
.period-chip span:hover { background: var(--surface-alt); }
.period-chip input:checked + span { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.period-chip input:focus-visible + span { box-shadow: 0 0 0 4px var(--primary-ring); }
.period-bar__custom { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); color: var(--text-muted); }
.period-bar__custom .form-control { width: auto; min-height: 40px; padding-block: .45rem; }

.chart-box--sm { height: 260px; }
.voided-note {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.voided-note svg { width: 15px; height: 15px; flex-shrink: 0; }
.voided-note a { color: var(--primary); font-weight: 600; }

/* ---- Sales table ---- */
.admin-table tr.is-clickable { cursor: pointer; }
.sales-table tr.is-muted td:not(:last-child):not(:nth-last-child(2)) { opacity: .55; }
.sales-table__items { max-width: 280px; font-size: var(--fs-sm); }
.sales-table__items span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.order-no:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

.pay-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: var(--radius-pill);
    background: var(--surface-alt);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-soft);
}
.pay-chip--cash { background: var(--success-soft); color: var(--success); }
.pay-chip--whish { background: var(--info-soft); color: var(--info); }
.pay-chip--omt { background: var(--warning-soft); color: var(--warning); }

/* ---- Sale view ---- */
.sale-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.sale-title .badge { font-family: var(--font-body); font-size: var(--fs-sm); }
.sale-layout { display: grid; gap: var(--space-5); align-items: start; }
@media (min-width: 1100px) { .sale-layout { grid-template-columns: minmax(0, 1fr) 360px; } }

.sale-totals {
    display: grid;
    gap: var(--space-2);
    margin-inline-start: auto;
    max-width: 340px;
    padding: var(--space-4) var(--space-5) var(--space-5);
    font-size: var(--fs-sm);
}
.sale-totals div { display: flex; justify-content: space-between; gap: var(--space-4); }
.sale-totals dt { color: var(--text-muted); }
.sale-totals dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.sale-totals__total { padding-top: var(--space-3); border-top: 1px solid var(--border); align-items: flex-start; }
.sale-totals__total dt { font-weight: 700; color: var(--text); font-size: var(--fs-base); }
.sale-totals__total dd { display: flex; flex-direction: column; align-items: flex-end; font-size: var(--fs-xl); font-weight: 700; color: var(--primary); }
.sale-totals__total small { font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); }

.detail-list { display: grid; gap: var(--space-3); font-size: var(--fs-sm); }
.detail-list div { display: flex; justify-content: space-between; gap: var(--space-4); }
.detail-list dt { color: var(--text-muted); }
.detail-list dd { margin: 0; font-weight: 600; text-align: end; }
.detail-list__full { flex-direction: column; gap: 2px !important; }
.detail-list__full dd { font-weight: 400; text-align: start; }

.sale-actions { display: grid; gap: var(--space-2); }
.sale-actions__btn { justify-content: flex-start; --btn-border: var(--border); border-radius: 12px; }
.sale-actions__btn:hover { --btn-bg: var(--surface-alt); }
.sale-actions__btn--danger { color: var(--danger); }
.sale-actions__btn--danger:hover { --btn-bg: var(--danger-soft); }

.timeline { display: grid; gap: var(--space-3); padding-inline-start: var(--space-4); border-inline-start: 2px solid var(--border); }
.timeline li { position: relative; display: flex; flex-direction: column; font-size: var(--fs-sm); }
.timeline li::before {
    content: "";
    position: absolute;
    top: 6px;
    inset-inline-start: calc(-1 * var(--space-4) - 6px);
    width: 10px;
    height: 10px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--primary);
}
.timeline span { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---- Segmented control (radio buttons) ---- */
.seg {
    display: flex;
    padding: 4px;
    border-radius: 12px;
    background: var(--surface-alt);
}
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 .6rem;
    border-radius: 9px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-soft);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.seg span svg { width: 16px; height: 16px; }
.seg input:checked + span { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-ring); }
.seg--sm span { min-height: 32px; padding: 0 .7rem; }

/* ---- Point of sale ---- */
.admin-content:has(.pos) { max-width: none; padding-bottom: var(--space-4); }
.pos {
    display: grid;
    gap: var(--space-5);
    align-items: start;
}
@media (min-width: 1024px) { .pos { grid-template-columns: minmax(0, 1fr) 400px; } }
@media (min-width: 1400px) { .pos { grid-template-columns: minmax(0, 1fr) 440px; } }

.pos-saved {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    margin-bottom: var(--space-5);
    padding: var(--space-3) var(--space-4);
    border-radius: 16px;
    background: linear-gradient(135deg, #2E7D4F, #3C9463);
    color: #fff;
    box-shadow: 0 10px 24px -12px rgba(46, 125, 79, .7);
    animation: pop-in .3s var(--ease);
}
.pos-saved__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.pos-saved__icon svg { width: 22px; height: 22px; stroke-width: 2.5; }
.pos-saved__text { display: flex; flex-direction: column; flex: 1; min-width: 200px; }
.pos-saved__text span { font-size: var(--fs-xs); opacity: .85; }
.pos-saved__actions { display: flex; align-items: center; gap: var(--space-2); }
.pos-saved__link { --btn-color: #fff; }
.pos-saved__link:hover { --btn-bg: rgba(255, 255, 255, .12); }
.pos-saved__close { background: transparent; border-color: rgba(255, 255, 255, .3); color: #fff; width: 34px; height: 34px; }

.pos-menu { min-width: 0; }
.pos-menu__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
}
.pos-search {
    display: flex;
    align-items: center;
    flex: 0 1 360px;
    height: 48px;
    padding-inline: var(--space-4);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.pos-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.pos-search svg { width: 20px; height: 20px; color: var(--text-muted); }
.pos-search input { flex: 1; min-width: 0; height: 100%; padding-inline: var(--space-3); border: 0; background: transparent; font-size: var(--fs-base); outline: none; }

.pos-cats {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.pos-cats::-webkit-scrollbar { display: none; }
.pos-cat {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    height: 44px;
    padding: 0 var(--space-4);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-soft);
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}
.pos-cat svg { width: 18px; height: 18px; color: var(--primary); }
.pos-cat:hover { border-color: var(--border-strong); }
.pos-cat[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.pos-cat[aria-selected="true"] svg { color: #fff; }

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-3);
}
@media (max-width: 559.98px) { .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pos-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-2) var(--space-2) var(--space-3);
    border: 2px solid transparent;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-align: start;
    transition: transform .12s var(--ease), box-shadow var(--transition), border-color var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.pos-tile:hover { box-shadow: var(--shadow); }
.pos-tile:active { transform: scale(.96); }
.pos-tile.is-in-order { border-color: var(--primary); }
.pos-tile.is-bump { animation: tile-bump .3s var(--ease); }
@keyframes tile-bump { 40% { transform: scale(.94); } }
.pos-tile__media {
    position: relative;
    aspect-ratio: 4 / 3;
    margin-bottom: var(--space-2);
    overflow: hidden;
    border-radius: 11px;
    background: var(--surface-alt);
}
.pos-tile__media img,
.pos-tile__media .img-placeholder { width: 100%; height: 100%; object-fit: cover; }
.pos-tile__media .img-placeholder svg { width: 34%; }
.pos-tile__qty {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    padding-inline: 6px;
    border: 2px solid #fff;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: #fff;
    font-size: var(--fs-sm);
    font-weight: 700;
    box-shadow: var(--shadow);
}
.pos-tile__name { padding-inline: var(--space-1); font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; }
.pos-tile__price { padding-inline: var(--space-1); font-size: var(--fs-sm); font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.pos-empty { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-6) 0; color: var(--text-muted); }
.pos-empty svg { width: 18px; height: 18px; }

/* Order panel */
.pos-order {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}
@media (min-width: 1024px) {
    .pos-order { position: sticky; top: calc(72px + var(--space-4)); height: calc(100vh - 72px - var(--space-6)); height: calc(100dvh - 72px - var(--space-6)); }
}
.pos-order__head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}
.pos-order__head > div { flex: 1; min-width: 0; }
.pos-order__title { font-family: var(--font-body); font-size: var(--fs-md); font-weight: 700; }
.pos-order__sub { font-size: var(--fs-xs); color: var(--text-muted); }
.pos-order__close { display: none; }
.pos-order__alert { margin: var(--space-3) var(--space-4) 0; }

/* The whole panel scrolls as one; only the Charge bar is pinned. The order lines
   always get room, even on short laptop screens. */
.pos-order { overflow-y: auto; overscroll-behavior: contain; }
.pos-order__head { position: sticky; top: 0; z-index: 2; background: var(--surface); }
.pos-order__body { flex: 1 0 auto; min-height: 220px; padding: var(--space-4) var(--space-4) var(--space-3); }
.pos-order__cta {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 -8px 18px -14px rgba(43, 29, 26, .35);
}
.pos-fields { display: grid; grid-template-columns: 1fr 88px; gap: var(--space-2); margin-bottom: var(--space-3); }
.pos-fields .form-control { min-height: 42px; padding-block: .55rem; }

.pos-lines { display: grid; gap: var(--space-2); }
.pos-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    animation: fade-in .2s var(--ease);
}
.pos-line__info { display: flex; flex-direction: column; min-width: 0; }
.pos-line__info strong { overflow: hidden; font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.pos-line__info span { font-size: var(--fs-xs); color: var(--text-muted); }
.pos-line__total { min-width: 62px; font-size: var(--fs-sm); font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
.pos-line__remove { width: 30px; height: 30px; }
.qty__input {
    width: 2.25rem;
    border: 0;
    background: transparent;
    font-size: var(--fs-sm);
    font-weight: 700;
    text-align: center;
    outline: none;
}
.qty__input:focus { background: var(--primary-soft); border-radius: 6px; }
.pos-line .qty--sm { height: 34px; background: var(--surface); }

.pos-lines-empty { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-6) var(--space-3); text-align: center; font-size: var(--fs-sm); color: var(--text-muted); }
.pos-lines-empty svg { width: 40px; height: 40px; margin-bottom: var(--space-2); color: var(--border-strong); }
.pos-lines-empty strong { color: var(--text); }

.pos-custom { margin-top: var(--space-3); font-size: var(--fs-sm); }
.pos-custom summary { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; cursor: pointer; list-style: none; }
.pos-custom summary::-webkit-details-marker { display: none; }
.pos-custom summary svg { width: 16px; height: 16px; }
.pos-custom__row { display: grid; grid-template-columns: 1fr 96px auto; gap: var(--space-2); margin-top: var(--space-2); }
.pos-custom__row .form-control { min-height: 40px; padding-block: .5rem; }
.pos-custom__row .input-prefix > .form-control { padding-inline-start: 1.6rem; }
.pos-custom__row .input-prefix > span { inset-inline-start: .7rem; }

.pos-order__foot {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
    border-top: 1px solid var(--border);
    background: #FCFAF7;
}
.pos-discount { display: flex; align-items: center; gap: var(--space-2); }
.pos-discount__label { flex: 1; font-size: var(--fs-sm); font-weight: 600; }
.pos-discount__input { width: 90px; min-height: 40px; padding-block: .45rem; text-align: end; }

.pos-totals { display: grid; gap: 4px; font-size: var(--fs-sm); }
.pos-totals div { display: flex; justify-content: space-between; }
.pos-totals dt { color: var(--text-muted); }
.pos-totals dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pos-totals__total { align-items: flex-end; margin-top: 4px; padding-top: var(--space-2); border-top: 1px dashed var(--border-strong); }
.pos-totals__total dt { font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.pos-totals__total dd { display: flex; flex-direction: column; align-items: flex-end; font-size: 1.6rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.pos-totals__total small { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }

.pos-pay { display: grid; gap: var(--space-2); }
.pos-cash { display: grid; gap: var(--space-2); }
.pos-cash[hidden] { display: none; }
.pos-cash__label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.pos-cash .form-control { min-height: 44px; font-size: var(--fs-md); font-weight: 700; text-align: end; font-variant-numeric: tabular-nums; }
.pos-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.pos-quick:empty { display: none; }
.pos-quick__btn {
    flex: 1;
    min-width: 60px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    font-size: var(--fs-xs);
    font-weight: 700;
    transition: background-color var(--transition), border-color var(--transition);
}
.pos-quick__btn:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pos-change { padding: var(--space-2) var(--space-3); border-radius: 10px; font-size: var(--fs-sm); font-weight: 700; }
.pos-change.is-ok  { background: var(--success-soft); color: var(--success); }
.pos-change.is-due { background: var(--danger-soft); color: var(--danger); }

.pos-more { font-size: var(--fs-sm); }
.pos-more summary { color: var(--text-muted); font-weight: 600; cursor: pointer; }
.pos-more__body { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
.pos-more .form-control { min-height: 40px; padding-block: .5rem; }

.pos-charge { min-height: 58px; font-size: var(--fs-md); border-radius: 14px; }
.pos-charge:disabled { opacity: .45; }
.pos-charge.is-loading { opacity: .8; pointer-events: none; }

.pos-mobile-bar { display: none; }

/* Phones & tablets: the order becomes a full-screen sheet */
@media (max-width: 1023.98px) {
    .pos { padding-bottom: 84px; }
    .pos-order {
        position: fixed;
        inset: 0;
        z-index: 350;
        height: 100dvh;
        border: 0;
        border-radius: 0;
        transform: translateY(100%);
        transition: transform .3s var(--ease);
    }
    .pos.is-order-open .pos-order { transform: none; }
    .pos-order__close { display: grid; }
    .pos-mobile-bar {
        position: fixed;
        inset-inline: var(--space-3);
        bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
        z-index: 300;
        display: flex;
        align-items: center;
        gap: var(--space-3);
        height: 60px;
        padding: 0 var(--space-5) 0 var(--space-3);
        border-radius: 16px;
        background: var(--primary);
        color: #fff;
        font-weight: 600;
        box-shadow: 0 12px 28px -10px rgba(123, 30, 43, .8);
    }
    .pos-mobile-bar strong { margin-inline-start: auto; font-size: var(--fs-md); }
    .pos-mobile-bar__count { display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .2); font-weight: 800; }
    .pos:not(.has-lines) .pos-mobile-bar { opacity: .7; }
}

/* ---- Receipt (screen preview + 80mm print) ---- */
.receipt-body { background: #EDE7DF; padding: var(--space-5) var(--space-3); }
.receipt-toolbar { display: flex; justify-content: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.receipt {
    width: 80mm;
    max-width: 100%;
    margin: 0 auto;
    padding: 6mm 5mm;
    background: #fff;
    color: #000;
    font-family: "Courier New", ui-monospace, monospace;
    font-size: 12px;
    line-height: 1.45;
    box-shadow: var(--shadow-lg);
}
.receipt p { color: #000; }
.receipt__head { text-align: center; padding-bottom: 3mm; border-bottom: 1px dashed #000; }
.receipt__head img { width: 46mm; height: auto; margin: 0 auto 2mm; }
.receipt__meta, .receipt__totals { display: grid; gap: 1px; padding: 3mm 0; }
.receipt__meta div, .receipt__totals div { display: flex; justify-content: space-between; gap: 3mm; }
.receipt__meta dd, .receipt__totals dd { margin: 0; text-align: right; }
.receipt__void { margin: 1mm 0 2mm; padding: 1mm; border: 2px solid #000; text-align: center; font-weight: 700; letter-spacing: .2em; }
.receipt__lines { width: 100%; border-top: 1px dashed #000; border-bottom: 1px dashed #000; }
.receipt__lines th { padding: 1.5mm 0; font-weight: 700; text-align: left; border-bottom: 1px solid #000; }
.receipt__lines td { padding: 1.2mm 0; vertical-align: top; }
.receipt__lines th:nth-child(2), .receipt__lines td:nth-child(2) { width: 9mm; text-align: center; }
.receipt__lines th:last-child, .receipt__lines td:last-child { width: 18mm; text-align: right; }
.receipt__lines small { display: block; font-size: 10px; }
.receipt__grand { margin: 1mm 0; padding: 1.5mm 0; border-top: 1px solid #000; border-bottom: 1px solid #000; font-size: 15px; font-weight: 700; }
.receipt__foot { padding-top: 3mm; border-top: 1px dashed #000; text-align: center; font-size: 11px; }
.receipt__thanks { margin: 1mm 0; font-weight: 700; font-size: 12px; }

/* Named page: only the receipt prints on 80mm paper (reports etc. keep A4) */
@page receipt { size: 80mm auto; margin: 0; }
@media print {
    .receipt-body { page: receipt; }
    .receipt-body { padding: 0; background: #fff; }
    .receipt { width: 80mm; box-shadow: none; padding: 4mm 4mm 8mm; }
}


/* ==========================================================================
   26. Users, roles & permissions
   ========================================================================== */

/* ---- Users table ---- */
.users-table tr.is-muted .user-cell { opacity: .6; }
.user-cell { display: flex; align-items: center; gap: var(--space-3); min-width: 220px; }
.user-cell .admin-avatar { width: 42px; height: 42px; background: var(--primary-soft); color: var(--primary); }
.user-cell__text { display: flex; flex-direction: column; min-width: 0; }
.user-cell__text strong { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.user-cell__text strong a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.user-cell__text strong .badge { padding: 0 .5rem; font-size: 10.5px; }
.user-cell__text > span { overflow: hidden; font-size: var(--fs-xs); color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.user-cell__text > span.show-sm { display: none; }
@media (max-width: 639.98px) {
    .user-cell { min-width: 0; gap: var(--space-2); }
    .user-cell .admin-avatar { width: 36px; height: 36px; }
    .user-cell__text { max-width: 40vw; }
    .user-cell__text > span.show-sm { display: block; font-weight: 600; color: var(--text-soft); }
    .users-table .row-actions { flex-direction: column; }
    .users-table .status-stack { flex-direction: column; align-items: flex-start; gap: 4px; }
}
.users-table .badge svg { width: 12px; height: 12px; }

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm);
    font-weight: 500;
    white-space: nowrap;
}
.role-chip svg { width: 15px; height: 15px; color: var(--text-muted); }
.role-chip--system { font-weight: 600; color: var(--primary); }
.role-chip--system svg { color: var(--primary); }

/* ---- User form ---- */
.avatar-drop .file-drop__thumb { border-radius: 50%; }
.lang-seg { max-width: 280px; }
.role-current { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); }
.role-current svg { width: 18px; height: 18px; color: var(--primary); }

.role-picker { display: grid; gap: var(--space-2); min-width: 0; margin: 0; padding: 0; border: 0; }
@media (min-width: 760px) { .role-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.role-option { position: relative; cursor: pointer; }
.role-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.role-option__box {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px var(--space-3);
    height: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}
.role-option:hover .role-option__box { border-color: var(--border-strong); }
.role-option input:checked + .role-option__box { border-color: var(--primary); background: #FFFAFA; box-shadow: 0 0 0 3px var(--primary-ring); }
.role-option input:focus-visible + .role-option__box { box-shadow: 0 0 0 4px var(--primary-ring); }
.role-option.is-disabled { cursor: not-allowed; }
.role-option.is-disabled .role-option__box { opacity: .5; background: var(--bg); }
.role-option__icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface-alt);
    color: var(--text-muted);
    transition: background-color var(--transition), color var(--transition);
}
.role-option__icon svg { width: 18px; height: 18px; }
.role-option input:checked + .role-option__box .role-option__icon { background: var(--primary); color: #fff; }
.role-option__text { display: flex; flex-direction: column; min-width: 0; }
.role-option__text strong { font-size: var(--fs-sm); }
.role-option__text small { font-size: var(--fs-xs); color: var(--text-muted); }
.role-option__count { margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
.role-picker.is-invalid .role-option__box { border-color: var(--danger); }

.locked-note {
    display: grid;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: 12px;
    background: var(--danger-soft);
    font-size: var(--fs-sm);
    color: var(--danger);
}
.locked-note p { display: flex; gap: var(--space-2); color: inherit; }
.locked-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.locked-note .btn { justify-self: start; }

/* ---- Roles page ---- */
.roles-layout { display: grid; gap: var(--space-5); align-items: start; }
@media (min-width: 1100px) {
    .roles-layout { grid-template-columns: 320px minmax(0, 1fr); }
    .roles-list { position: sticky; top: calc(72px + var(--space-5)); }
}
.role-editor { scroll-margin-top: 90px; }

.role-list { display: grid; gap: 4px; padding: 0 var(--space-3) var(--space-3); }
.role-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid transparent;
    border-radius: 14px;
    transition: background-color var(--transition), border-color var(--transition);
}
a.role-card:hover { background: #FCFAF7; border-color: var(--border); }
.role-card.is-current { background: var(--primary-soft); border-color: rgba(123, 30, 43, .2); }
.role-card__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface-alt);
    color: var(--text-muted);
}
.role-card__icon svg { width: 18px; height: 18px; }
.role-card.is-current .role-card__icon { background: var(--primary); color: #fff; }
.role-card__body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.role-card__body strong { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); font-size: var(--fs-sm); }
.role-card__meta { font-size: var(--fs-xs); color: var(--text-muted); }
.role-card__meta em { font-style: normal; font-weight: 600; color: var(--primary); }
.role-card__bar { display: block; height: 4px; margin-top: 6px; border-radius: 4px; background: var(--surface-alt); overflow: hidden; }
.role-card__bar span { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.role-card.is-current .role-card__bar { background: rgba(255, 255, 255, .7); }

.avatar-stack { display: flex; align-items: center; }
.avatar-stack > span { margin-inline-start: -8px; }
.avatar-stack > span:first-child { margin-inline-start: 0; }
.avatar-stack .admin-avatar { width: 32px; height: 32px; border: 2px solid var(--surface); font-size: 11px; }
.avatar-stack__more {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--surface-alt);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-soft);
}

.role-fields { margin-bottom: var(--space-5); }
@media (min-width: 900px) { .role-fields { grid-template-columns: 1fr 1fr 1.6fr; } }

.perm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.perm-head__title { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-body); font-size: var(--fs-base); font-weight: 600; }
.perm-head__tools { display: flex; gap: var(--space-4); }

.perm-wrap { border: 1px solid var(--border); border-radius: 14px; }
.perm-table { min-width: 640px; }
.perm-table tbody th { padding: var(--space-3) var(--space-4); border-bottom: 0; background: none; font-size: var(--fs-sm); font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text); }
.perm-table thead th:first-child { padding-inline-start: var(--space-4); }
.perm-table tbody tr + tr > * { border-top: 1px solid var(--border); }
.perm-table tbody tr:hover { background: #FCFAF7; }
.perm-table td, .perm-table th { padding-inline: var(--space-3); vertical-align: middle; }
.perm-col { width: 64px; text-align: center !important; }
.perm-col--other { width: 120px; }
.role-editor .admin-form__actions { margin-top: var(--space-5); }
td.perm-col--other { text-align: start !important; }

.perm-module { display: flex; align-items: center; gap: var(--space-3); min-width: 220px; }
.perm-module__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
}
.perm-module__icon svg { width: 17px; height: 17px; }
.perm-module__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.perm-module__text strong { font-weight: 600; }
.perm-module__text small { font-size: var(--fs-xs); color: var(--text-muted); }
.perm-module__all {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity var(--transition), background-color var(--transition), color var(--transition);
}
.perm-module__all svg { width: 14px; height: 14px; }
.perm-table tr:hover .perm-module__all,
.perm-module__all:focus-visible { opacity: 1; }
.perm-module__all:hover { background: var(--primary-soft); color: var(--primary); }
@media (hover: none) { .perm-module__all { opacity: 1; } }

.perm-check { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; vertical-align: middle; }
.perm-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.perm-check__box {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border: 1.5px solid var(--border-strong);
    border-radius: 7px;
    background: var(--surface);
    color: transparent;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}
.perm-check__box svg { width: 15px; height: 15px; stroke-width: 3; }
.perm-check:hover .perm-check__box { border-color: var(--primary); }
.perm-check input:checked + .perm-check__box { border-color: var(--primary); background: var(--primary); color: #fff; }
.perm-check input:focus-visible + .perm-check__box { box-shadow: 0 0 0 4px var(--primary-ring); }
.perm-check input:active + .perm-check__box { transform: scale(.9); }
.perm-check input:disabled + .perm-check__box { opacity: .45; }
.perm-check:has(input:disabled) { cursor: not-allowed; }
.perm-check--labeled { display: flex; }
.perm-check--labeled + .perm-check--labeled { margin-top: 6px; }
.perm-check__label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-soft); }
.perm-none { color: var(--border-strong); }


/* ==========================================================================
   27. Messages, settings, my profile
   ========================================================================== */
.icon-up { transform: rotate(180deg); }

/* ---- Inbox (list + reader) ---- */
.inbox { display: grid; gap: var(--space-5); align-items: start; }
@media (min-width: 1100px) {
    .inbox { grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); }
    .inbox__reader { position: sticky; top: calc(72px + var(--space-5)); }
}
/* Below 1100px: one pane at a time */
@media (max-width: 1099.98px) {
    .inbox.has-open .inbox__list { display: none; }
    .inbox:not(.has-open) .inbox__reader { display: none; }
}

.inbox__tabs { display: flex; gap: var(--space-1); padding: var(--space-4) var(--space-4) 0; }
.inbox__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .45rem .85rem;
    border-radius: var(--radius-pill);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-soft);
    transition: background-color var(--transition), color var(--transition);
}
.inbox__tab span { padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-alt); font-size: 11px; }
.inbox__tab:hover { background: var(--surface-alt); color: var(--primary); }
.inbox__tab[aria-selected="true"] { background: var(--primary); color: #fff; }
.inbox__tab[aria-selected="true"] span { background: rgba(255, 255, 255, .22); }
.inbox__filters { padding: var(--space-3) var(--space-4); }
.inbox__filters .admin-select { flex: 1 1 140px; }

.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    min-height: 52px;
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--border);
    background: #FCFAF7;
}
.bulk-bar__count { font-size: var(--fs-xs); color: var(--text-muted); }
.bulk-bar__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-inline-start: auto; }
.bulk-bar__actions[hidden] { display: none; }
.bulk-bar__delete { color: var(--danger); --btn-bg: var(--danger-soft); }
.bulk-bar__delete svg { width: 15px; height: 15px; }

.msg-rows { display: grid; }
.msg-row { position: relative; display: flex; align-items: flex-start; border-bottom: 1px solid var(--border); transition: background-color var(--transition); }
.msg-row:last-child { border-bottom: 0; }
.msg-row:hover { background: #FCFAF7; }
.msg-row.is-unread { background: #FCF6F6; }
.msg-row.is-open { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.msg-row__check { padding: var(--space-4) 0 var(--space-4) var(--space-4); }
.msg-row__link { display: flex; flex: 1; gap: var(--space-3); min-width: 0; padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3); }
.msg-row__link .admin-avatar { margin-top: 2px; }
.msg-row__body { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: var(--fs-sm); }
.msg-row__top { display: flex; justify-content: space-between; gap: var(--space-2); }
.msg-row__top strong { overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.msg-row__top time { flex-shrink: 0; font-size: 11px; color: var(--text-muted); }
.msg-row__subject { font-size: var(--fs-xs); font-weight: 600; color: var(--primary); }
.msg-row__preview { overflow: hidden; font-size: var(--fs-xs); color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.msg-row.is-unread .msg-row__top strong { font-weight: 700; }
.msg-row.is-unread .msg-row__top strong::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-inline-start: 6px;
    border-radius: 50%;
    background: var(--primary);
    vertical-align: middle;
}

.inbox__reader { min-height: 420px; }
.reader__empty { min-height: 380px; display: grid; place-content: center; }
.reader__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.reader__back { margin-bottom: 0; }
@media (min-width: 1100px) { .reader__back { visibility: hidden; } }
.reader__nav { display: flex; gap: 2px; }
.reader__title { margin-top: var(--space-3); font-size: var(--fs-xl); }
.reader__date { margin-top: var(--space-1); font-size: var(--fs-sm); color: var(--text-muted); }
.reader__contact { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-4); font-size: var(--fs-sm); }
.reader__contact div { display: flex; align-items: center; gap: var(--space-2); }
.reader__contact dt svg { width: 16px; height: 16px; color: var(--text-muted); }
.reader__contact dd { margin: 0; }
.reader__contact a { font-weight: 600; color: var(--primary); overflow-wrap: anywhere; }
.reader__contact a:hover { text-decoration: underline; text-underline-offset: 3px; }
.reader__message {
    margin-top: var(--space-5);
    padding: var(--space-5);
    border-radius: 14px;
    background: var(--bg);
    font-size: var(--fs-base);
    line-height: 1.7;
    overflow-wrap: anywhere;
}
.reader__reply { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.reader__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-6, 2rem);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}
.reader__meta { font-size: var(--fs-xs); color: var(--text-muted); }
.reader__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.reader__delete { color: var(--danger); }
.reader__delete:hover { --btn-bg: var(--danger-soft); }

/* ---- Settings ---- */
.settings-layout { display: grid; gap: var(--space-5); align-items: start; }
@media (min-width: 1100px) { .settings-layout { grid-template-columns: 220px minmax(0, 1fr); } }
.settings-nav ul { display: flex; gap: var(--space-1); overflow-x: auto; padding-bottom: 2px; }
@media (min-width: 1100px) {
    .settings-nav { position: sticky; top: calc(72px + var(--space-5)); }
    .settings-nav ul { flex-direction: column; overflow: visible; }
}
.settings-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: .6rem .85rem;
    border-radius: 12px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-soft);
    white-space: nowrap;
    transition: background-color var(--transition), color var(--transition);
}
.settings-nav a svg { width: 17px; height: 17px; }
.settings-nav a:hover { background: var(--surface); color: var(--primary); }
.settings-nav a.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.settings-nav a.has-error { color: var(--danger); }
.settings-nav a.has-error::after { content: "!"; margin-inline-start: auto; font-weight: 700; }

.settings-form { display: grid; gap: var(--space-5); min-width: 0; }
.settings-card { scroll-margin-top: 90px; }
.settings-card__title { display: flex; align-items: center; gap: var(--space-3); }
.settings-card__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
}
.settings-card__icon svg { width: 19px; height: 19px; }
.settings-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--fs-xs); }
.settings-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    font-size: var(--fs-sm);
    color: var(--text-soft);
}
.settings-note svg { width: 16px; height: 16px; color: var(--primary); }

.input-suffix { position: relative; }
.input-suffix > span {
    position: absolute;
    top: 50%;
    inset-inline-end: var(--space-4);
    transform: translateY(-50%);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
}
.input-suffix > .form-control { padding-inline-end: 3.5rem; font-variant-numeric: tabular-nums; font-weight: 600; }

.rate-preview {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-5);
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: 14px;
    background: var(--bg);
}
.rate-preview__label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.rate-preview__item { display: inline-flex; align-items: baseline; gap: var(--space-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--text-soft); }
.rate-preview__item strong { color: var(--text); }
.rate-preview.is-hidden-lbp .rate-preview__item > span { text-decoration: line-through; opacity: .5; }
.rate-history { margin-top: var(--space-4); font-size: var(--fs-sm); }
.rate-history summary { width: max-content; font-weight: 600; color: var(--primary); cursor: pointer; }
.rate-history .timeline { margin-top: var(--space-3); }

.save-bar {
    position: sticky;
    bottom: var(--space-4);
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(8px);
}
.save-bar__text { margin-inline-end: auto; font-size: var(--fs-sm); color: var(--text-muted); }
.save-bar.is-dirty { border-color: rgba(123, 30, 43, .35); }
.save-bar.is-dirty .save-bar__text { font-weight: 600; color: var(--primary); }
@media (max-width: 639.98px) { .save-bar__text { flex-basis: 100%; } }

/* ---- My profile ---- */
.profile-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
    padding: var(--space-5) var(--space-6, 2rem);
    border-radius: 20px;
    background: linear-gradient(120deg, var(--sidebar-bg) 0%, #3A1A1E 60%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: var(--shadow);
}
.profile-hero .admin-avatar.profile-hero__avatar {
    width: 84px;
    height: 84px;
    border: 3px solid rgba(255, 255, 255, .85);
    background: var(--primary);
    font-size: 1.75rem;
}
.profile-hero__text { flex: 1; min-width: 0; }
.profile-hero .admin-page-title { color: #fff; }
.profile-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-2); font-size: var(--fs-sm); color: rgba(255, 255, 255, .75); }
.profile-hero .role-chip, .profile-hero .role-chip svg { color: #F3C9CE; }
.profile-hero__stat { display: flex; flex-direction: column; padding: var(--space-3) var(--space-4); border-radius: 14px; background: rgba(255, 255, 255, .08); }
.profile-hero__stat span, .profile-hero__stat small { font-size: var(--fs-xs); color: rgba(255, 255, 255, .7); }
.profile-hero__stat strong { font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
@media (max-width: 639.98px) {
    .profile-hero { gap: var(--space-4); padding: var(--space-5); }
    .profile-hero .admin-avatar.profile-hero__avatar { width: 64px; height: 64px; font-size: 1.35rem; }
}
.confirm-email { padding: var(--space-4); border-radius: 14px; background: var(--warning-soft); }
.confirm-email[hidden] { display: none; }

.access-list { display: grid; gap: var(--space-3); }
@media (min-width: 640px) { .access-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.access-list li { display: flex; align-items: center; gap: var(--space-3); }
.access-list__text { display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-sm); }
.access-list__text small { font-size: var(--fs-xs); color: var(--text-muted); }


/* ==========================================================================
   28. Expenses, expense form, reports (+ admin print)
   ========================================================================== */
.text-warning { color: #A26E10; }
.kpi-card__value { white-space: nowrap; }
@media (min-width: 1280px) { .kpi-card__value { font-size: clamp(1.3rem, 1.5vw, 1.75rem); } }
.icon-down { transform: rotate(180deg); }
.kpi-card--link { color: inherit; }
.kpi-card--link:hover { border-color: rgba(123, 30, 43, .3); }
.admin-empty--compact { padding-block: var(--space-5); }
.cat-dot { display: inline-block; width: 10px; height: 10px; flex-shrink: 0; border-radius: 50%; vertical-align: middle; }
.cat-dot--lg { width: 14px; height: 14px; }

/* ---- By category (donut + legend) ---- */
.donut-layout { display: grid; gap: var(--space-5); align-items: center; }
@media (min-width: 640px) { .donut-layout { grid-template-columns: 220px minmax(0, 1fr); } }
.donut-box { position: relative; width: 100%; max-width: 220px; aspect-ratio: 1; margin-inline: auto; }
.donut-box__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.donut-box__center span { font-size: var(--fs-xs); color: var(--text-muted); }
.donut-box__center strong { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.cat-legend { display: grid; gap: 2px; }
.cat-legend a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: 10px;
    font-size: var(--fs-sm);
    transition: background-color var(--transition);
}
.cat-legend a:hover { background: var(--surface-alt); }
.cat-legend__name { display: flex; flex-direction: column; min-width: 0; font-weight: 500; }
.cat-legend__name small { font-size: 11px; font-weight: 600; }
.cat-legend__value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-legend__value small { margin-inline-start: 4px; font-weight: 500; color: var(--text-muted); }

/* ---- Unpaid bills ---- */
.debt-list { display: grid; gap: 4px; }
.debt-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: 12px;
    background: var(--bg);
    transition: background-color var(--transition);
}
a.debt-row:hover { background: var(--surface-alt); }
.debt-row.is-overdue { background: var(--danger-soft); }
.debt-row__icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-muted);
}
.debt-row__icon svg { width: 17px; height: 17px; }
.debt-row.is-overdue .debt-row__icon { color: var(--danger); }
.debt-row__text { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: var(--fs-sm); }
.debt-row__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debt-row__text small { font-size: var(--fs-xs); color: var(--text-muted); }
.debt-row.is-overdue .debt-row__text small { font-weight: 600; color: var(--danger); }
.debt-row__amount { font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.debt-total {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    font-size: var(--fs-sm);
}
.debt-total strong { font-size: var(--fs-md); color: var(--primary); font-variant-numeric: tabular-nums; }

/* ---- Expenses table ---- */
.expenses-table tr.is-overdue { background: #FFF8F7; }
.expense-cell { display: flex; align-items: center; gap: var(--space-3); min-width: 220px; }
.expense-cell__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--surface-alt);
    line-height: 1.1;
}
.expense-cell__date strong { font-size: var(--fs-md); }
.expense-cell__date small { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.expense-cell__text { display: flex; flex-direction: column; min-width: 0; }
.expense-cell__text strong { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.expense-cell__text strong a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.expense-cell__text > span { overflow: hidden; font-size: var(--fs-xs); color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }
.expense-cell__clip { display: inline-grid; color: var(--text-muted); }
.expense-cell__clip svg { width: 14px; height: 14px; }
.expense-cell__clip:hover { color: var(--primary); }
@media (max-width: 639.98px) {
    .expense-cell { min-width: 0; gap: var(--space-2); }
    .expense-cell__text { max-width: 38vw; }
    .expenses-table .row-actions { flex-direction: column; }
}
.cat-tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); white-space: nowrap; }
.cat-tag:hover { color: var(--primary); }
.due-text { font-size: var(--fs-xs); font-weight: 600; color: #A26E10; }
.due-text--overdue { color: var(--danger); }
.due-text--unpaid { color: var(--text-muted); }
.pay-btn { min-height: 32px; padding-inline: .7rem; }
.pay-btn svg { width: 15px; height: 15px; }

/* ---- Pay dialog ---- */
.pay-dialog {
    width: min(480px, calc(100vw - 2rem));
    padding: var(--space-5);
    border: 0;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}
.pay-dialog::backdrop { background: rgba(28, 20, 18, .55); backdrop-filter: blur(2px); }
.pay-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.pay-dialog .seg span { padding-inline: .4rem; font-size: var(--fs-xs); }

/* ---- Expense categories ---- */
.ecat-list { display: grid; gap: 4px; }
@media (min-width: 900px) { .ecat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.ecat__details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.ecat__details[open] { border-color: rgba(123, 30, 43, .3); box-shadow: var(--shadow-sm); }
.ecat__details summary {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    list-style: none;
    cursor: pointer;
}
.ecat__details summary::-webkit-details-marker { display: none; }
.ecat.is-muted summary { opacity: .6; }
.ecat__name { flex: 1; min-width: 0; font-size: var(--fs-sm); }
.ecat__edit { display: grid; color: var(--text-muted); }
.ecat__edit svg { width: 15px; height: 15px; }
.ecat__form { display: grid; gap: var(--space-3); padding: 0 var(--space-4) var(--space-4); }
.ecat__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ecat__delete { color: var(--danger); margin-inline-start: auto; }
.ecat-add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.ecat-add .form-control { flex: 1 1 220px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.swatches label { position: relative; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatches input + span { display: block; width: 24px; height: 24px; border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--border); transition: box-shadow var(--transition); }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--text); }
.swatches input:focus-visible + span { box-shadow: 0 0 0 4px var(--primary-ring); }

/* ---- Expense form ---- */
.amount-row { display: grid; gap: var(--space-3); align-items: start; }
@media (min-width: 640px) { .amount-row { grid-template-columns: 200px minmax(0, 1fr); } }
.amount-input { min-height: 52px; font-size: var(--fs-lg) !important; }
.amount-convert {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-3) var(--space-4);
    border-radius: 12px;
    background: var(--bg);
    font-size: var(--fs-sm);
}
.amount-convert span { font-size: var(--fs-xs); color: var(--text-muted); }
.amount-convert strong { font-size: var(--fs-md); font-variant-numeric: tabular-nums; }
.status-choice { display: grid; gap: var(--space-3); }
@media (min-width: 560px) { .status-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.status-choice__option { position: relative; cursor: pointer; }
.status-choice__option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.status-choice__option > span {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 var(--space-3);
    align-items: center;
    padding: var(--space-4);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    transition: border-color var(--transition), background-color var(--transition), box-shadow var(--transition);
}
.status-choice__option svg { grid-row: span 2; width: 22px; height: 22px; color: var(--text-muted); }
.status-choice__option strong { font-size: var(--fs-sm); }
.status-choice__option small { font-size: var(--fs-xs); color: var(--text-muted); }
.status-choice__option:hover > span { border-color: var(--border-strong); }
.status-choice__option input:checked + span { border-color: var(--primary); background: #FFFAFA; box-shadow: 0 0 0 3px var(--primary-ring); }
.status-choice__option input:checked + span svg { color: var(--primary); }
.status-choice__option input[value="unpaid"]:checked + span { border-color: var(--warning); background: var(--warning-soft); box-shadow: 0 0 0 3px rgba(201, 138, 27, .18); }
.status-choice__option input[value="unpaid"]:checked + span svg { color: var(--warning); }
.status-choice__option input:focus-visible + span { box-shadow: 0 0 0 4px var(--primary-ring); }
.half { max-width: 320px; }
.seg.is-invalid { box-shadow: 0 0 0 1.5px var(--danger); }
.due-quick { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip-btn {
    padding: .3rem .7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--text-soft);
    transition: border-color var(--transition), color var(--transition);
}
.chip-btn:hover { border-color: var(--primary); color: var(--primary); }
[data-paid-fields][hidden], [data-unpaid-fields][hidden] { display: none; }

/* ---- Reports ---- */
.report-group { margin-inline-start: auto; }
.stat-strip--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px)  { .stat-strip--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .stat-strip--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.stat-strip__item--link { color: inherit; transition: border-color var(--transition); }
.stat-strip__item--link:hover { border-color: rgba(123, 30, 43, .3); }
.stat-strip__item small { font-size: 11px; font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--fs-xs); color: var(--text-muted); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend li > span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.chart-legend .chart-legend__line { width: 16px; height: 0; border-top: 2px solid var(--text); border-radius: 0; }

.pl { display: grid; font-size: var(--fs-sm); }
.pl__row { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; }
.pl__row dt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); }
.pl__row dt small { font-size: 11px; color: var(--text-muted); }
.pl__row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pl__row--minus dd { color: var(--text-soft); }
.pl__row--detail { padding-block: 3px; padding-inline-start: var(--space-4); font-size: var(--fs-xs); color: var(--text-soft); }
.pl__row--detail dd { font-weight: 500; }
.pl__row--sub { margin-block: var(--space-2); padding-block: var(--space-3); border-block: 1px solid var(--border); font-weight: 700; }
.pl__row--sub dd { font-weight: 700; color: var(--text); }
.pl__row--total { margin-top: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: 12px; background: var(--primary-soft); font-size: var(--fs-base); font-weight: 700; }
.pl__row--total dd { font-size: var(--fs-lg); font-weight: 700; color: var(--primary); }

.report-table th, .report-table td { padding-inline: var(--space-3); }
.report-table th:first-child, .report-table td:first-child { padding-inline-start: var(--space-5); }
.report-table tbody th, .report-table tfoot th,
.admin-table tbody th[scope="row"] { background: none; font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text); }
.report-table tfoot th { font-weight: 700; }
.report-table tr.is-muted td, .report-table tr.is-muted th { color: var(--text-muted); }
.report-table tfoot th, .report-table tfoot td { border-top: 2px solid var(--border); background: #FCFAF7; font-weight: 700; }
.report-table td, .report-table th { white-space: nowrap; }
.rank {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-inline-end: 6px;
    border-radius: 50%;
    background: var(--surface-alt);
    font-size: 11px;
    font-weight: 700;
}
tr:first-child .rank { background: var(--primary); color: #fff; }
.method-table { width: 100%; font-size: var(--fs-sm); }
.method-table th, .method-table td { padding: var(--space-2) 0; text-align: start; }
.method-table thead th { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.method-table .num { text-align: end; font-variant-numeric: tabular-nums; }
.method-table tbody tr + tr > * { border-top: 1px solid var(--border); }
.report-note { display: flex; gap: var(--space-2); margin-top: var(--space-5); font-size: var(--fs-xs); color: var(--text-muted); }
.report-note svg { width: 15px; height: 15px; flex-shrink: 0; }
.print-only { display: none; }

/* ---- Printing admin pages (reports): content only, on A4 ---- */
@media print {
    @page { margin: 12mm; }
    .admin-body { background: #fff; }
    .admin-sidebar, .admin-topbar, .admin-backdrop, .admin-footer, .skip-link,
    .period-bar, .admin-page-actions, .admin-filters, .pagination, .row-actions, .no-print { display: none !important; }
    .admin, .admin-main { display: block; margin: 0; padding: 0; }
    .admin-content { padding: 0; }
    .print-only { display: block; }
    .report-print-head { margin-bottom: 4mm; font-size: 11px; color: #555; }
    .admin-card, .kpi-card, .stat-strip__item { box-shadow: none !important; break-inside: avoid; }
    .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dash-grid--main, .dash-grid--half { grid-template-columns: 1fr 1fr; }
    .hide-tab, .hide-sm { display: table-cell !important; }
    .table-wrap { overflow: visible; }
    .report-table { font-size: 10px; }
    canvas { max-width: 100%; }
}


/* ==========================================================================
   29. Lock screen, PIN keypad, quick sign-in
   ========================================================================== */

/* ---- Avatar with a lock badge ---- */
.unlock-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    margin: 0 auto var(--space-3);
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.75rem;
    font-weight: 700;
    box-shadow: 0 10px 24px -10px rgba(123, 30, 43, .6);
}
.unlock-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.unlock-avatar__lock {
    position: absolute;
    right: -2px;
    bottom: -2px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: var(--text);
    color: #fff;
}
.unlock-avatar__lock svg { width: 14px; height: 14px; }
.unlock-head { text-align: center; }

/* ---- PIN field + keypad ---- */
.pin-pad { display: grid; gap: var(--space-4); justify-items: center; }
.pin-input {
    width: 100%;
    max-width: 260px;
    height: 56px;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: var(--bg);
    font-size: 1.75rem;
    letter-spacing: .5em;
    text-align: center;
    text-indent: .5em;   /* balance the letter-spacing */
    font-variant-numeric: tabular-nums;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.pin-input::placeholder { color: var(--border-strong); letter-spacing: .35em; }
.pin-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); background: var(--surface); }
/* Keypads read 1-2-3 left to right in every language (Arabic too) */
.pin-keys { display: grid; grid-template-columns: repeat(3, 72px); gap: var(--space-3); direction: ltr; }
.pin-input { direction: ltr; }
.pin-key--back svg { transform: scaleX(-1); }   /* ⌫ points left */
.pin-key {
    display: grid;
    place-items: center;
    height: 60px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition), transform .08s ease, border-color var(--transition);
    touch-action: manipulation;
    user-select: none;
}
.pin-key:hover { border-color: var(--border-strong); background: #FCFAF7; }
.pin-key:active { transform: scale(.94); background: var(--primary-soft); }
.pin-key--muted { background: var(--bg); color: var(--text-muted); box-shadow: none; }
.pin-key svg { width: 20px; height: 20px; }
.unlock-form { gap: var(--space-5); }
.unlock-switch-mode { text-align: center; }
@keyframes pin-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
.is-shaking .pin-input, .is-shaking .form-control { animation: pin-shake .45s; border-color: var(--danger); }

/* ---- Quick sign-in tiles (login + lock page) ---- */
.quick-users { margin-top: var(--space-5); }
.quick-users--login { margin: 0 0 var(--space-2); }
.quick-users__title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px var(--space-2);
    margin-bottom: var(--space-3);
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 600;
}
.quick-users__title small { font-size: var(--fs-xs); font-weight: 400; color: var(--text-muted); }
.quick-users__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--space-2); }
.quick-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-3) var(--space-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.quick-user:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.quick-user__avatar {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
}
.quick-user__avatar img { width: 100%; height: 100%; object-fit: cover; }
.quick-user__name { max-width: 100%; overflow: hidden; font-size: var(--fs-sm); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.quick-user small { font-size: 11px; color: var(--text-muted); }
.quick-users__or {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.quick-users__or::before, .quick-users__or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.unlock-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}
.unlock-foot .link { display: inline-flex; align-items: center; gap: 6px; }
.unlock-foot .link svg { width: 15px; height: 15px; }

/* ---- In-page lock overlay (admin) ---- */
.lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: var(--space-4);
    overflow-y: auto;
    background: rgba(28, 20, 18, .72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.lock-overlay[hidden] { display: none; }
body.is-locked { overflow: hidden; }
.lock-card {
    width: min(400px, 100%);
    padding: var(--space-6) var(--space-5);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: lock-in .25s ease;
}
@keyframes lock-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.lock-card__title { font-size: var(--fs-xl); }
.lock-card__text { margin: var(--space-1) 0 var(--space-4); font-size: var(--fs-sm); color: var(--text-muted); }
.lock-card .alert { margin-bottom: var(--space-4); text-align: start; }
.lock-card__form { display: grid; gap: var(--space-4); text-align: start; }
.lock-card__links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-5); margin-top: var(--space-4); }
.lock-card__links .link { display: inline-flex; align-items: center; gap: 6px; }
.lock-card__links svg { width: 15px; height: 15px; }
@media (max-height: 700px) {
    .pin-key { height: 50px; }
    .unlock-avatar { width: 64px; height: 64px; font-size: 1.35rem; }
}

/* ---- My profile: PIN card ---- */
.pin-status {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    border-radius: 12px;
    background: var(--bg);
    font-size: var(--fs-sm);
}
.pin-status svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.pin-status--ready { background: var(--success-soft); color: var(--success); }
.pin-status--set { background: var(--warning-soft); color: #946210; }
.pin-field { font-size: var(--fs-lg); letter-spacing: .35em; }
.pin-card__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.pin-card__remove { color: var(--danger); }
.pin-card__forget { margin-top: var(--space-3); }
.pin-card__forget .link { font-size: var(--fs-xs); color: var(--text-muted); text-align: start; }
.item-form__side .pin-card .form-grid--2 { grid-template-columns: 1fr 1fr; }
