/* AzhiPlus tweaks layered on top of the Cuba (Pixelstrap) template (recolored charcoal + amber).
   Admin pages use Cuba's own classes (card / table / form-control / btn). This file only
   adds the brand wordmark, the header language switch, the cart stepper, shared CSS vars
   (also consumed by storefront.css), and small login helpers. */

:root {
    /* ReminderKrd brand — warm cream + gold + dark coffee (mockup 2026-08-29). */
    --brand: #6b4a2b;
    --brand-dark: #43301f;
    --brand-soft: #f1e9d8;
    --accent: #c9a24b;
    --accent-dark: #a8842f;
    --accent-2: #e07b4c;      /* burnt orange — badges, links, chart highlight */
    --ink: #3b2c1c;
    --bg: #f4eedd;            /* cream page ground */
    --card: #fffdf6;          /* off-white card surface */
    --admin-border: #eadfc8;
    --danger: #c0392b;
}

/* Warm rounded type everywhere (Kurdish/Arabic-first; falls back to system fonts offline). */
body, .page-wrapper, .form-control, .form-select, .btn, input, textarea, select, button {
    font-family: 'Vazirmatn', Rubik, system-ui, -apple-system, sans-serif;
}

/* Cream ground + off-white cards across the whole app. */
body, .page-wrapper, .page-wrapper .page-body-wrapper, .page-wrapper .page-body-wrapper .page-body { background: var(--bg) !important; }
/* html too: on phone over-scroll (and below a short page) the WebView shows the html background —
   left white, it reads as a broken white footer under the page. */
html { background: var(--bg); }
.card {
    background: var(--card);
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(70, 50, 20, .05);
}
.btn-primary {
    background: var(--brand) !important; border-color: var(--brand) !important;
    border-radius: 14px;
}
.btn-primary:hover, .btn-primary:active { background: var(--brand-dark) !important; border-color: var(--brand-dark) !important; }
.btn-outline-secondary { border-radius: 14px; }

/* ---- Mobile shell scroll feel ----
   Kill the Android 12+ overscroll "stretch"/rubber-band glow inside the WebView (and prevent
   scroll-chaining), so dragging past the top/bottom/sides doesn't warp the page. Chromium WebView
   honours overscroll-behavior. Applied to the document scroller and inner horizontal sliders. */
html, body { overscroll-behavior: none !important; overscroll-behavior-y: none !important; height: 100%; }
.store-hero-slider, .azhi-slider, [data-slider] { overscroll-behavior: contain; }

/* ---- Brand wordmark (header + sidebar logo) ---- */
.azhi-logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--brand);
}
.azhi-logo b { color: var(--accent); font-weight: 700; }

/* Brand: logo icon + "AzhiPlus" wordmark, shown together in the header/sidebar. */
.azhi-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
/* Mobile hamburger that opens the sidebar drawer — hidden on desktop, shown ≤991px (see media query). */
.azhi-mnav-btn { display: none; }
.azhi-logo-img { height: 38px; width: auto; border-radius: 8px; display: inline-block; vertical-align: middle; }
.azhi-logo-img-icon { height: 34px; }
.store-logo-img { height: 40px; width: auto; border-radius: 8px; display: block; }

/* ---- Header language switcher ---- */
.azhi-lang { display: flex; gap: 4px; align-items: center; }
.azhi-lang-link {
    display: inline-flex; align-items: center; gap: .35rem; padding: 3px 7px; border-radius: 6px;
    border: 1px solid transparent; opacity: .55; transition: opacity .15s, border-color .15s, background .15s;
    font-size: .82rem; text-decoration: none; color: inherit;
}
.azhi-lang-link:hover { opacity: 1; background: var(--brand-soft); }
.azhi-lang-link.active { opacity: 1; border-color: var(--brand); }
.azhi-lang-name { line-height: 1; white-space: nowrap; }
@media (max-width: 767px) { .azhi-lang-name { display: none; } .azhi-lang-link { padding: 3px; } }

/* =====================================================================
   Sidebar bridge — make the Cuba sidebar look/behave like the template
   WITHOUT simplebar.
   Cuba's per-item + collapse(.close_icon)/hover rules are all scoped to its
   simplebar DOM chain (.sidebar-links .simplebar-wrapper … .simplebar-content > li).
   We render a plain <ul.sidebar-links#simple-bar> (simplebar mutates the DOM and
   would be wiped by Blazor enhanced-navigation morphing), so none of those rules
   match. These rules reproduce them targeting `.sidebar-links > li` directly, so
   the native collapse-to-icon-rail + hover-expand + section dividers work.
   Prefix matches Cuba's specificity so we win the cascade (azhi.css loads last).
   ===================================================================== */
.azhi-logo-icon { font-size: 24px; }

/* Font Awesome icons sized like Cuba's svg icons */
.sidebar-links .sidebar-list .sidebar-link i.fa-solid {
    width: 18px;
    text-align: center;
    margin-inline-end: 14px;
    font-size: 16px;
    vertical-align: middle;
}
.sidebar-links .sidebar-list .sidebar-link.active i.fa-solid,
.sidebar-links .sidebar-list .sidebar-link.active span { color: var(--brand); }
.profile-nav .profile-media i.fa-circle-user { color: var(--brand); }

/* ---- Native scrollbar look for the menu (Cuba normally uses simplebar) ---- */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cfd4da transparent;
}
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links::-webkit-scrollbar { width: 6px; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links::-webkit-scrollbar-thumb { background: #cfd4da; border-radius: 6px; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links::-webkit-scrollbar-track { background: transparent; }

/* ---- Per-item styling (mirrors Cuba .simplebar-content > li) ---- */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li {
    display: block; position: relative; width: 100%;
}
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li > a.sidebar-link {
    display: flex; align-items: center;
    color: #222; padding: 12px 20px; position: relative;
    transition: all .3s ease; text-decoration: none;
    border-radius: 10px; margin: 1px 12px;
}
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li > a.sidebar-link span {
    color: rgba(54,54,74,.8); letter-spacing: .5px;
}
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li > a.sidebar-link:hover {
    background-color: rgba(31, 41, 55,.07);
}
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li > a.sidebar-link:hover i.fa-solid,
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li > a.sidebar-link:hover span { color: var(--brand); }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li > a.sidebar-link.active {
    background-color: rgba(31, 41, 55,.1);
}
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li > a.sidebar-link.active i.fa-solid,
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li > a.sidebar-link.active span { color: var(--brand); }

/* Section group titles + divider line above each group */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li.sidebar-main-title {
    margin-top: 10px; padding: 22px 0 6px; padding-inline-start: 24px; /* logical → indents from the right in RTL */
    text-align: start;
}
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li.sidebar-main-title:before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: calc(100% - 40px); height: 1px; background: #ecf3fa;
}
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li.sidebar-main-title h6 {
    margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .6px;
    text-transform: uppercase; color: var(--brand);
}
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .sidebar-main .sidebar-links > li.back-btn { display: none; }

/* ---- Collapsed icon-rail (.close_icon) — mirrors Cuba's close_icon rules ---- */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon { width: auto; transition: all .3s ease; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon .logo-wrapper { display: none; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon .logo-icon-wrapper { display: block; text-align: center; padding: 22px 0; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon .sidebar-main .sidebar-links > li { margin: 0; max-width: 86px; transition: all .3s ease; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon .sidebar-main .sidebar-links > li > a.sidebar-link { justify-content: center; padding: 12px 14px; margin: 1px 8px; transition: all .3s ease; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon .sidebar-main .sidebar-links > li > a.sidebar-link span { display: none; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon .sidebar-main .sidebar-links > li > a.sidebar-link i.fa-solid { margin-inline-end: 0; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon .sidebar-main-title { display: none !important; }

/* ---- Hover-expand the collapsed rail (overlays the page, Cuba behavior) ---- */
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon:hover { width: 265px; transition: all .3s ease; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon:hover .logo-wrapper { display: block; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon:hover .logo-icon-wrapper { display: none; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon:hover .sidebar-main .sidebar-links > li { margin: initial; max-width: unset; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon:hover .sidebar-main .sidebar-links > li > a.sidebar-link { justify-content: flex-start; padding: 12px 20px; margin: 1px 12px; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon:hover .sidebar-main .sidebar-links > li > a.sidebar-link span { display: inline-block; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon:hover .sidebar-main .sidebar-links > li > a.sidebar-link i.fa-solid { margin-inline-end: 14px; }
.page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon:hover .sidebar-main-title { display: block !important; }

/* RTL: collapsed rail sits on the right; flip the icon logo alignment */
html[dir=rtl] .page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon .logo-icon-wrapper { text-align: center; }
/* RTL: brand (logo + AzhiPlus wordmark) should sit on the RIGHT of the sidebar header. */
html[dir=rtl] .page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .logo-wrapper { text-align: right; }

/* ---- Login helpers (Cuba provides .login-card/.login-main/.theme-form) ---- */
.login-langs { display: flex; gap: 6px; margin: 0 0 18px; }
.login-langs a {
    font-size: 13px; text-decoration: none; color: #52526c;
    padding: 4px 10px; border: 1px solid var(--admin-border); border-radius: 8px;
}
.login-langs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.login-error {
    background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca;
    border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}

/* ---- Mobile (≤991px) admin sidebar = off-canvas drawer ----
   Replaces the desktop icon-rail/hover behaviour, which gets stuck open on touch screens. The
   sidebar slides in from the start edge over a backdrop; JS toggles .azhi-mnav-open + .show. */
.azhi-sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1085;
    opacity: 0; visibility: hidden; transition: opacity .28s ease, visibility .28s ease;
}
.azhi-sidebar-backdrop.show { opacity: 1; visibility: visible; }

@media (max-width: 991px) {
    .page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper {
        /* Explicit PHYSICAL left/right (not logical inset) — Cuba's base sets `left:0`, and a
           logical inset-inline-start doesn't override it in RTL, which left the drawer mid-screen. */
        position: fixed !important; top: 0 !important; bottom: 0 !important; left: 0 !important; right: auto !important;
        width: 260px !important; max-width: 82vw; z-index: 1090; overflow-y: auto; background: #fff;
        transform: translateX(-100%) !important; transition: transform .28s ease;
        box-shadow: 0 0 30px rgba(0,0,0,.2); margin: 0 !important;
    }
    /* RTL: dock to the physical RIGHT edge and slide off to the right when hidden. */
    html[dir=rtl] .page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper {
        left: auto !important; right: 0 !important; transform: translateX(100%) !important;
    }
    .page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.azhi-mnav-open { transform: translateX(0) !important; }
    /* RTL open: must out-specify the html[dir=rtl] hidden rule above (which has the extra `html`
       selector), otherwise the drawer stays translated off-screen right even when opened. */
    html[dir=rtl] .page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.azhi-mnav-open { transform: translateX(0) !important; }
    /* Hide Cuba's built-in header toggle on mobile — the azhi-mnav-btn hamburger replaces it (no double button). */
    .page-header .toggle-sidebar { display: none !important; }
    /* Content spans full width on mobile (sidebar is an overlay, not in flow). */
    .page-wrapper.compact-wrapper .page-body-wrapper .page-body { margin-left: 0 !important; margin-right: 0 !important; }
    /* Force full menu (defeat any leftover icon-rail collapse on small screens). */
    .page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper.close_icon { width: 260px; }
    .page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .logo-wrapper { display: block; }
    .page-wrapper.compact-wrapper .page-body-wrapper div.sidebar-wrapper .logo-icon-wrapper { display: none; }
    /* Show the mobile hamburger toggle. */
    .azhi-mnav-btn {
        display: inline-flex !important; align-items: center; justify-content: center;
        width: 42px; height: 42px; border: 0; background: var(--brand-soft); color: var(--brand);
        border-radius: 10px; font-size: 18px; cursor: pointer; margin-inline-end: 10px;
    }
}

/* ---- Cart quantity stepper (auto-submitting −/+) ---- */
.qty-stepper {
    display: inline-flex; align-items: center;
    border: 1px solid var(--admin-border); border-radius: 10px; overflow: hidden; background: #fff;
}
.qty-stepper .qty-btn {
    width: 34px; height: 34px; border: 0; background: var(--brand-soft); color: var(--brand-dark);
    font-size: 18px; font-weight: 700; line-height: 1; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; transition: background .15s;
    user-select: none;
}
.qty-stepper .qty-btn:hover { background: var(--brand); color: #fff; }
.qty-stepper .qty-value {
    min-width: 44px; text-align: center; font-weight: 600; color: var(--ink); padding: 0 6px; user-select: none;
}

/* ---- Small helpers used by converted admin pages ---- */
.admin-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--admin-border); }
.admin-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #f5f6f9; padding: 2px 6px; border-radius: 6px; }

/* Sortable table headers + search bar (azhi-ui.js) */
.azhi-sortable { user-select: none; }
.azhi-sortable::after { content: " \2195"; opacity: .3; font-size: .8em; }
.azhi-sortable[data-dir="asc"]::after { content: " \2191"; opacity: .9; }
.azhi-sortable[data-dir="desc"]::after { content: " \2193"; opacity: .9; }
.azhi-tablesearch input { max-width: 280px; }

/* ---- In-app notifications: header bell + toasts (build plan §10) ---- */
#azhi-notify-bell { cursor: pointer; }
#azhi-notify-bell .notification-box { padding: 6px 10px; }
#azhi-notify-bell #azhi-notify-badge {
    position: absolute; top: -2px; inset-inline-end: 0; font-size: 10px; line-height: 1;
    padding: 3px 5px; background: var(--accent, #f59e0b); color: #fff;
}
.notification-dropdown { min-width: 320px; max-width: 360px; padding-bottom: 6px; }
.azhi-notify-scroll { max-height: 360px; overflow-y: auto; }
.azhi-notify-item { padding: 10px 16px; border-top: 1px solid #eef0f4; }
.azhi-notify-item a { color: inherit; }
.azhi-notify-item.azhi-notify-unread { background: var(--brand-soft, #e6f4f2); }
.azhi-notify-item .fw-600 { font-weight: 600; }

.azhi-toast-host {
    position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 1080;
    display: flex; flex-direction: column; gap: 10px; max-width: 340px;
}
.azhi-toast {
    background: #fff; border-inline-start: 4px solid var(--brand, #1f2937);
    box-shadow: 0 6px 24px rgba(0,0,0,.16); border-radius: 8px; padding: 12px 14px;
    opacity: 0; transform: translateY(12px); transition: opacity .35s, transform .35s;
}
.azhi-toast.show { opacity: 1; transform: translateY(0); }
.azhi-toast-title { font-weight: 700; color: var(--ink, #1f2937); margin-bottom: 2px; }
.azhi-toast-body { font-size: 13px; color: #6b7280; }

/* ---- Print: report pages print clean (chrome hidden; just title + table) ---- */
@media print {
    .sidebar-wrapper, .page-header, .footer, .page-title, .azhi-tablesearch { display: none !important; }
    .page-body, .page-body-wrapper, .page-wrapper, .container-fluid { margin: 0 !important; padding: 0 !important; width: 100% !important; }
    .card { border: none !important; box-shadow: none !important; }
    body { background: #fff !important; }
    a[href]:after { content: ""; } /* don't append URLs after links */
    .table { font-size: 12px; }
}

/* ---- ReminderKrd: clear the fixed Cuba header so page content isn't tucked under it ---- */
.page-wrapper .page-body-wrapper .page-body {
    margin-top: 76px;
    min-height: calc(100vh - 130px);
}
/* Footer pinned to the viewport bottom on desktop: the wrapper is a full-height column and the
   footer takes the leftover space, instead of Cuba's white bar floating mid-page after short
   content. (The fixed sidebar is out of flow, so the column is just page-body + footer.) */
.page-wrapper .page-body-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.page-wrapper .page-body-wrapper .page-body { flex: 1 1 auto; }
.page-wrapper .page-body-wrapper .footer {
    margin-top: auto;
    background: var(--bg) !important; box-shadow: none !important; color: #8a7a62;
}
.page-wrapper .page-body-wrapper .page-body > .container-fluid { padding-top: 16px; }
@media (max-width: 991px) {
    /* Header is in normal flow on phones (see the sticky-header rule), so no offset is needed —
       a fixed offset was exactly what clipped titles on devices with a larger font scale.
       !important because Cuba's own compact-wrapper rule out-specifies this one. */
    .page-wrapper.compact-wrapper .page-body-wrapper .page-body { margin-top: 0 !important; }
}
/* Sidebar drawer sits above content on mobile; header stays on top. */
.page-header { z-index: 8; }

/* ===== Calendar (month-view feature) ===== */
.cal-month .cal-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-month .cal-head { font-size: .72rem; color: #8a94a6; text-align: center; padding-bottom: 8px; font-weight: 700; }
.cal-cell {
    min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    padding-top: 8px; border-radius: 12px; cursor: pointer; transition: background .15s; position: relative;
}
.cal-cell:hover { background: var(--brand-soft); }
.cal-cell > span { font-size: 1.05rem; }
.cal-cell.cal-today > span:first-child {
    background: var(--brand); color: #fff; width: 34px; height: 34px; line-height: 34px;
    border-radius: 10px; text-align: center;
}
.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-dark); margin-top: 4px; }

.cal-mini { border: 1px solid var(--admin-border); border-radius: 12px; padding: 8px; cursor: pointer; transition: border-color .15s; }
.cal-mini:hover { border-color: var(--brand); }
.cal-mini-cur { border-color: var(--brand); }
.cal-mini > .fw-bold { color: var(--brand); }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; font-size: .58rem; text-align: center; }
.cal-mini-grid > span { padding: 1px 0; }
.cal-mini-h { color: #aab; }
.cal-mini-today { background: var(--brand); color: #fff; border-radius: 4px; }

.cal-week-day { text-align: center; padding: 8px 2px; border-radius: 10px; cursor: pointer; }
.cal-week-day:hover { background: var(--brand-soft); }
.cal-week-day.cal-today .fw-bold { color: var(--brand); }
.cal-week-day.cal-sel { background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand) inset; }

/* ===== Color picker swatches + colored calendar dots ===== */
.color-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #ccc; cursor: pointer; padding: 0; }
.color-swatch-sel { box-shadow: 0 0 0 2px var(--brand); transform: scale(1.12); }
.cal-dots { display: flex; gap: 3px; margin-top: 4px; justify-content: center; }
.cal-dots .cal-dot { margin: 0; }

/* ===== Full-bleed, app-style forms (feel like a mobile app, not a web form) ===== */
.app-form { display: flex; justify-content: center; }
.app-form-inner { width: 100%; max-width: 660px; }
.app-form .form-control, .app-form .form-select { border-radius: 12px; }
@media (max-width: 767px) {
    .app-form-inner { max-width: 100%; }
    .app-form .form-control, .app-form .form-select { font-size: 1.03rem; padding: .65rem .9rem; }
    .app-form h3 { font-size: 1.4rem; }
}

/* ===== Weather icon picker ===== */
.weather-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.weather-swatch {
    width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--admin-border);
    background: #fff; font-size: 1.15rem; color: #7a8291; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all .12s;
}
.weather-swatch { border-radius: 14px; background: var(--card); }
.weather-swatch:hover { color: var(--brand); border-color: var(--accent); }
.weather-swatch-sel { border-color: var(--accent); color: var(--brand-dark); background: #ecce8a; box-shadow: none; }

/* ===== Tabbed add screen — text-only rounded pills (mockup) ===== */
.add-tabs { display: flex; gap: 10px; margin-bottom: 18px; justify-content: flex-start; }
.add-tab {
    flex: 0 1 auto; text-align: center; padding: 10px 22px; border-radius: 999px;
    border: 1px solid var(--admin-border);
    background: var(--card); cursor: pointer; color: #8a7a62; font-weight: 600;
}
.add-tab i { display: none; }
.add-tab-active { border-color: var(--brand-dark); background: var(--brand-dark); color: #fff; }

/* ===== Fill the viewport height — pages feel like full app screens, not cards at the top ===== */
.page-wrapper .page-body-wrapper .page-body { display: flex; flex-direction: column; }
.page-wrapper .page-body-wrapper .page-body > .container-fluid { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.app-form { flex: 1 1 auto; }

/* Calendar fills all available height; month rows stretch to fill */
.cal-fill { flex: 1 1 auto; display: flex; flex-direction: column; }
.cal-fill > .card-body { flex: 1 1 auto; display: flex; flex-direction: column; }
.cal-fill .cal-month { flex: 1 1 auto; display: flex; flex-direction: column; }
.cal-fill .cal-month .cal-row:not(.cal-head) { flex: 1 1 auto; }
.cal-fill .cal-cell { justify-content: flex-start; }

/* Calendar-type pills (4 systems) at the top — rounded-full, dark-coffee when selected */
.cal-types { display: flex; gap: 8px; margin-bottom: 14px; }
.cal-type { flex: 1; min-width: 0; text-align: center; padding: 9px 4px; border-radius: 999px; border: 1px solid var(--admin-border); background: var(--card); cursor: pointer; color: #8a7a62; font-weight: 600; line-height: 1.15; }
.cal-type-name { font-size: .8rem; font-weight: 600; }
.cal-type-date { font-size: .6rem; opacity: .85; margin-top: 2px; }
.cal-type-active { border-color: var(--brand-dark); background: var(--brand-dark); color: #fff; }

/* ===== Bottom tab bar — native mobile navigation (phones only) ===== */
.mobile-tabbar { display: none; }
@media (max-width: 991px) {
    /* min-height, NOT height: with box-sizing:border-box a fixed height minus a non-zero
       env(safe-area-inset-bottom) leaves a content box shorter than the tabs, and align-items:center
       then overflows them upward — the border-top ended up slicing straight through all five icons.
       min-height + padding lets the bar grow for the inset instead of squeezing its own content. */
    .mobile-tabbar {
        display: flex; position: fixed; bottom: 0; inset-inline: 0;
        min-height: 64px; padding-top: 8px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        background: var(--bg); border-top: 0; z-index: 30;
        justify-content: space-around; align-items: center;
        box-shadow: none;
    }
    .mtab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
        color: #a3937a; text-decoration: none; font-size: .68rem; }
    .mtab i { font-size: 1.15rem; }
    .mtab.active { color: var(--brand-dark); font-weight: 700; }
    /* The FAB deliberately floats above the bar, so the border-top passes behind it. The white ring
       (first box-shadow) is painted over that border, giving a clean notch instead of a line that
       looks like it runs through the button. */
    /* align-self:flex-start pins it to the content-box top so the raise is exactly the margin, rather
       than half of it — centering an item with a negative margin feeds back into its own position. */
    .mtab-add { align-self: flex-start; }
    .mtab-add i { background: var(--accent); color: #fff; width: 56px; height: 56px; border-radius: 50%;
        display: flex; align-items: center; justify-content: center; margin-top: -34px;
        box-shadow: 0 0 0 6px var(--bg), 0 6px 16px rgba(120, 85, 30, .3); font-size: 1.5rem; }
    .mtab-add.active i { background: var(--accent-dark); }

    /* The document scrolls on phones — NOT a nested fixed-height pane. With windowSoftInputMode=
       adjustResize the WebView viewport shrinks when the keyboard opens; a calc(100dvh - …) pane
       then re-measures and its scrollTop gets clamped, which is why tapping a field bounced the page
       and left the field off-screen. Letting the document scroll also lets the WebView do its own
       scroll-focused-input-into-view. */
    .page-wrapper.compact-wrapper .page-body-wrapper .page-body {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        /* Must clear the tab bar PLUS the FAB that rises 34px above it (64+8+34 ≈ 106px) — at 96px
           the last item of a scrolled page ended up underneath the floating + button. */
        padding-bottom: calc(128px + env(safe-area-inset-bottom)) !important;
    }
    /* The calendar is the one exception: its Week/Day grids scroll internally and need a bounded
       parent, so it keeps the capped pane. It has no text inputs, so the keyboard never resizes it. */
    .page-wrapper.compact-wrapper .page-body-wrapper .page-body:has(.cal-fill) {
        /* 84px header margin + ~80px tab bar; 148px left the grid's last row under the bar */
        height: calc(100dvh - 168px) !important;
        max-height: calc(100dvh - 168px) !important;
        overflow-y: auto !important; -webkit-overflow-scrolling: touch;
    }
    .footer { display: none; }
    /* tighten the top header on phones so it feels like an app bar */
    .page-wrapper.compact-wrapper .page-header .header-wrapper { padding: 8px 12px; }
}

/* ===== Calendar day name-labels (like the native app) ===== */
.cal-labels { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 0 3px; margin-top: 3px; }
.cal-label {
    font-size: .58rem; line-height: 1.25; color: #fff; border-radius: 4px; padding: 0 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.cal-more { font-size: .55rem; color: #8a94a6; padding-inline-start: 2px; }
@media (max-width: 991px) { .cal-label { font-size: .5rem; } }

/* ===== Keep calendar cells uniform: short labels, fixed strip, clipped overflow ===== */
.cal-cell { overflow: hidden; }
.cal-labels { max-height: 30px; overflow: hidden; flex-wrap: wrap; }
.cal-label { display: inline-block; max-width: 100%; }
/* subtle hover so a day never looks like a boxed card vs its neighbours */
.cal-cell:hover { background: rgba(107,74,43,.06); }

/* Don't fill the whole (tall, full-height) cell on hover — keeps the grid visually uniform */
.cal-cell:hover { background: transparent; }
.cal-cell:active { background: rgba(107,74,43,.06); border-radius: 12px; }

/* ===== Hourly time-grid (Week + Day views) ===== */
.wk-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.tg-hour { flex: 0 0 46px; width: 46px; font-size: .66rem; color: #8a94a6; padding: 2px 4px; }
/* Day grid */
.tg-row { display: flex; border-top: 1px solid #f0ede8; min-height: 44px; }
.tg-slot { flex: 1; padding: 2px 4px; min-width: 0; }
.tg-event { display: block; font-size: .72rem; color: #fff; border-radius: 6px; padding: 2px 8px; margin-bottom: 2px;
    text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-time { opacity: .85; font-size: .66rem; }
.tg-allday { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid #eee; margin-bottom: 4px; }
.tg-alllabel { font-size: .68rem; color: #8a94a6; margin-inline-end: 6px; }
.tg-chip { font-size: .66rem; color: #fff; border-radius: 6px; padding: 1px 8px; text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tg-now { background: rgba(220,53,69,.05); }
/* Week grid */
.wk-head, .wk-row { display: grid; grid-template-columns: 46px repeat(7, 1fr); }
.wk-head { border-bottom: 2px solid var(--admin-border); }
.wk-hcell { text-align: center; padding: 4px 0; cursor: pointer; }
.wk-dow { font-size: .58rem; color: #8a94a6; }
.wk-dnum { font-weight: 700; }
.wk-today .wk-dnum { background: var(--brand); color: #fff; border-radius: 8px; width: 26px; height: 26px; line-height: 26px; margin: 0 auto; }
.wk-row { border-top: 1px solid #f0ede8; min-height: 38px; }
.wk-cell { border-inline-start: 1px solid #f4f1ec; padding: 1px 2px; min-width: 0; }
.wk-allday { min-height: auto; }
.wk-cell .tg-event, .wk-cell .tg-chip { font-size: .54rem; padding: 0 3px; }

/* ===== Calendar view tabs (Day/Week/Month/Year) at the TOP — segmented ===== */
.cal-viewtabs { display: flex; gap: 6px; }
.cal-viewtab { flex: 1; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--admin-border);
    background: #fff; cursor: pointer; font-size: .82rem; color: #6c757d; }
.cal-viewtab-active { border-color: var(--brand); background: var(--brand); color: #fff; }

/* ===== Bound Week/Day so their internal scroll never runs under the bottom nav bar ===== */
.cal-fill .wk, .cal-fill .tg-day { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
/* the app's fixed bottom nav must fully cover anything behind it */
.mobile-tabbar { background: var(--bg); }

/* On phones the header is STICKY, not fixed. Fixed needs a hard-coded content offset, and the
   header's real height varies with the device font scale — on larger scales page titles ended up
   clipped underneath it. Sticky participates in layout (nothing can ever start covered) yet still
   pins to the top while scrolling. */
@media (max-width: 991px) {
    .page-wrapper.compact-wrapper .page-header {
        position: sticky !important; top: 0; inset-inline: auto; z-index: 20;
    }
    /* Cuba puts overflow:hidden on the wrapper, which turns the sticky header back into a static
       one (sticky pins to the nearest clipping ancestor, and this one never scrolls). The mobile
       drawer it was clipping is position:fixed — off-viewport fixed elements create no scrollbars —
       and the body already clips horizontal overflow, so releasing it is safe. */
    .page-wrapper.compact-wrapper { overflow: visible !important; }
    /* …but the profile dropdown was only ever "hidden" by that clip. Hide it for real, and reveal
       on hover/tap (focus-within covers touch, where the li gets focus via its tabindex). */
    .nav-menus .onhover-show-div {
        visibility: hidden; opacity: 0; pointer-events: none; transition: opacity .15s;
    }
    .nav-menus .onhover-dropdown:hover .onhover-show-div,
    .nav-menus .onhover-dropdown:focus-within .onhover-show-div,
    .nav-menus .onhover-dropdown.active .onhover-show-div {
        visibility: visible; opacity: 1; pointer-events: auto;
    }
}

/* ===== Notification bell popup: never run off-screen (esp. RTL / narrow phones) ===== */
/* Logical props keep it correct in both LTR and RTL. Desktop keeps the anchored dropdown,
   clamped so a 320px panel can't spill past the viewport edge. */
.notif-pop { width: 320px; max-width: calc(100vw - 24px); }
@media (max-width: 991px) {
    /* On phones, pin it within the viewport instead of anchoring to the bell — inset-inline on both
       sides makes it span the screen width minus a small margin, so no half of it goes off-screen. */
    .notif-pop {
        position: fixed !important;
        inset-inline: 10px !important;
        inset-block-start: 60px !important;
        width: auto !important;
        max-width: none !important;
    }
    .notif-pop > div[style*="max-height"] { max-height: 65dvh !important; }
}

/* ===== Profile dropdown: tap-to-open on touch + never off-screen (RTL-safe) ===== */
/* Cuba shows .onhover-show-div on :hover only; cuba-ui.js toggles .azhi-show on tap for touch. */
.onhover-show-div.azhi-show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}
.profile-dropdown { width: 220px; max-width: calc(100vw - 24px); }
@media (max-width: 991px) {
    /* Pin within the viewport rather than anchoring to the avatar, so it can't spill off-screen. */
    .profile-nav .profile-dropdown.onhover-show-div {
        position: fixed !important;
        inset-inline-end: 10px !important;
        inset-inline-start: auto !important;
        inset-block-start: 60px !important;
        width: 220px !important;
        max-width: calc(100vw - 20px) !important;
    }
}

/* ===== Sidebar header: keep the long Kurdish wordmark tidy beside the logo (no overlap/overflow) =====
   The header top-bar hides the wordmark on phones (d-none d-md-inline); the sidebar drawer shows the
   full name, where the 22px brand size wrapped over 3 lines and collided with the logo. Scope a smaller
   size + clean flex row to the sidebar only. */
/* Sidebar header laid out as a direction-aware flex row, so it mirrors correctly for BOTH English
   (LTR) and Arabic/Kurdish (RTL): the logo+wordmark group sits on the leading edge (left in EN, right
   in AR/KU) and the collapse arrow on the trailing edge — no overlap. Smaller font keeps the long
   Kurdish name from colliding with the logo. */
/* Kept as a simple BLOCK — Cuba's text-align governs the side (do NOT make it a flex container, that
   broke alignment). Trim the oversized 30px side padding to ~16px so the header lines up with the nav
   items instead of sitting inboard on the right. */
.sidebar-wrapper .logo-wrapper { padding-inline: 16px !important; }
/* THE actual bug: Cuba ships `.logo-wrapper a{transform:translate(-64px)}` (a leftover from its
   collapse animation) which shoved the whole logo+name group 64px LEFT — off the drawer edge in RTL.
   Cancel it so text-align can right-align the group normally. */
.sidebar-wrapper .logo-wrapper .azhi-brand { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; transform: none !important; }
/* Let the long name wrap instead of forcing the whole group wider than the drawer (which overflowed
   off the left edge in RTL). min-width:0 lets the text flex-item shrink; the logo stays fixed. */
.sidebar-wrapper .logo-wrapper .azhi-logo { min-width: 0; }
/* RTL: mirror English exactly (no row-reverse — that mis-positioned the inline-flex box). Cuba's
   text-align:right pins the whole logo+name group to the right edge; the name is right-aligned to the
   left of the right-pinned logo, reading naturally from the right. */
html[dir=rtl] .sidebar-wrapper .logo-wrapper .azhi-logo { text-align: right; }
.sidebar-wrapper .logo-wrapper .azhi-logo-img { height: 40px; flex: 0 0 auto; }
.sidebar-wrapper .logo-wrapper .azhi-logo {
    font-size: 14px; line-height: 1.25; font-weight: 700; white-space: normal; word-break: normal;
}
/* Hide Cuba's collapse arrow on phones — it's the desktop icon-rail toggle, not needed in the drawer,
   and it overlapped the RTL wordmark. */
@media (max-width: 991px) { .sidebar-wrapper .logo-wrapper .back-btn { display: none !important; } }

/* ===== Grouped-card form sections (mockup: one cream sheet, boxed rounded inputs) — /add ===== */
.app-card { background: var(--card); border: 1px solid var(--admin-border); border-radius: 24px;
    padding: 8px 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(70,50,20,.05); }
.app-field { padding: 12px 0; }
.app-field > .form-label { font-size: .88rem; color: #6b5a41; font-weight: 700; margin-bottom: 8px; }
/* Boxed inputs inside the sheet, like the mockup: soft rounded outline on a near-white fill. */
.app-card .form-control, .app-card .form-select {
    border: 1px solid var(--admin-border) !important; border-radius: 16px !important;
    background: #fffefa !important; padding: .7rem 1rem !important;
    box-shadow: none !important; font-size: 1.02rem; }
.app-card .form-control:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(201,162,75,.18) !important; }
.app-card .form-control::placeholder { color: #b3a68d; }
.app-card textarea.form-control { min-height: 5em; resize: vertical; }
.app-card .app-title { font-size: 1.1rem; font-weight: 600; }

/* ===== First-open daily card popup (build-plan §E.2) ===== */
/* Ships with hidden, so it never flashes before js/daily-popup.js decides. */
.krd-daily-backdrop[hidden] { display: none; }
.krd-daily-backdrop {
    position: fixed; inset: 0; z-index: 1080;
    background: rgba(35, 24, 14, .55);
    display: flex; align-items: center; justify-content: center;
    padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
    animation: krd-daily-fade .18s ease-out;
}
.krd-daily-sheet {
    background: #fff; border-radius: 18px; padding: 22px 20px;
    width: 100%; max-width: 420px; max-height: 100%; overflow-y: auto;
    box-shadow: 0 18px 48px rgba(0,0,0,.32); text-align: center;
}
.krd-daily-kind { color: var(--brand); font-size: .8rem; font-weight: 600; margin-bottom: 10px; }
.krd-daily-text { font-size: 1.12rem; line-height: 1.75; margin: 0; white-space: pre-line; }
.krd-daily-sheet .blockquote-footer { font-size: .82rem; }
.krd-daily-sheet img { max-height: 34vh; object-fit: cover; width: 100%; }
/* Stop the page behind the modal scrolling under the finger. */
body.krd-noscroll { overflow: hidden; }
@keyframes krd-daily-fade { from { opacity: 0; } to { opacity: 1; } }

/* ===== Keep the fixed tab bar off the soft keyboard ===== */
/* With adjustResize the viewport shrinks when the keyboard opens, so a bottom-fixed bar re-pins
   directly over the field being edited. js/mobile-ui.js sets .krd-typing while a field has focus. */
@media (max-width: 991px) {
    body.krd-typing .mobile-tabbar { display: none; }
    /* The bar is gone, so the reserved gap at the end of the document can shrink with it —
       otherwise there's a dead 96px band under the last field while typing. */
    body.krd-typing .page-wrapper.compact-wrapper .page-body-wrapper .page-body {
        padding-bottom: 24px !important;
    }
}

/* ===== AppSelect — replaces the native <select> ===== */
/* Android's WebView draws <select> as a stock radio-button AlertDialog: unstyleable, LTR-only, and
   visually a decade old. These are ordinary elements, so they inherit the app's type, colours and
   direction (logical properties keep it correct in RTL). */
.app-select { position: relative; }

.app-select-trigger {
    width: 100%; display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--admin-border); border-radius: 10px;
    padding: 10px 14px; font: inherit; color: var(--ink); text-align: start; cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.app-select-trigger:disabled { opacity: .55; cursor: default; }
.app-select-trigger:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(107,74,43,.15); }
.app-select-value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-select-caret { flex: 0 0 auto; font-size: .75rem; color: #8a94a6; transition: transform .18s; }
.app-select.is-open .app-select-caret { transform: rotate(180deg); }

/* Inside the app-card sheet the trigger gets the same boxed rounded outline as the inputs. */
.app-card .app-select-trigger {
    border: 1px solid var(--admin-border); border-radius: 16px;
    background: #fffefa; padding: .7rem 1rem; font-size: 1.02rem;
}

.app-select-backdrop { display: none; }
.app-select-menu { display: none; }

/* --- Desktop: an anchored menu --- */
@media (min-width: 992px) {
    .app-select.is-open .app-select-menu {
        display: block; position: absolute; z-index: 1090;
        inset-inline-start: 0; inset-block-start: calc(100% + 6px); min-width: 100%;
        background: #fff; border: 1px solid var(--admin-border); border-radius: 12px;
        box-shadow: 0 12px 32px rgba(0,0,0,.14); overflow: hidden;
        max-height: 320px; overflow-y: auto;
    }
}

/* --- Phones: a bottom sheet, which is the native pattern users expect --- */
@media (max-width: 991px) {
    .app-select.is-open .app-select-backdrop {
        display: block; position: fixed; inset: 0; z-index: 1085; background: rgba(35,24,14,.5);
        animation: krd-daily-fade .16s ease-out;
    }
    .app-select.is-open .app-select-menu {
        display: flex; flex-direction: column; position: fixed; z-index: 1086;
        inset-inline: 0; inset-block-end: 0;
        background: #fff; border-radius: 18px 18px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
        max-height: 72vh; box-shadow: 0 -10px 34px rgba(0,0,0,.24);
        animation: krd-sheet-up .2s cubic-bezier(.22,.9,.3,1);
    }
    /* Grab handle — signals "drag/tap away to dismiss" the way a native sheet does. */
    .app-select.is-open .app-select-menu::before {
        content: ""; width: 38px; height: 4px; border-radius: 2px; background: #d9d2c6;
        margin: 10px auto 4px;
    }
}

.app-select-title {
    padding: 12px 18px 8px; font-size: .8rem; font-weight: 600; color: #8a94a6;
    border-bottom: 1px solid var(--admin-border);
}
.app-select-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.app-select-option {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; background: transparent; border: 0; border-bottom: 1px solid #f4f1ec;
    font: inherit; font-size: 1rem; color: var(--ink); text-align: start; cursor: pointer;
}
.app-select-option:last-child { border-bottom: 0; }
.app-select-option:active { background: rgba(107,74,43,.07); }
.app-select-option.is-selected { color: var(--brand); font-weight: 600; background: rgba(107,74,43,.05); }
.app-select-option-label { flex: 1 1 auto; min-width: 0; }
.app-select-tick { flex: 0 0 auto; color: var(--brand); }

@keyframes krd-sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ===== Typeable + pickable field (time picker) ===== */
.app-picker-field { display: flex; align-items: center; gap: 6px; }
.app-picker-input {
    flex: 1 1 auto; min-width: 0; background: #fff; color: var(--ink); font: inherit;
    border: 1px solid var(--admin-border); border-radius: 10px; padding: 10px 14px;
}
.app-picker-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(107,74,43,.15); }
.app-card .app-picker-input {
    border: 1px solid var(--admin-border); border-radius: 16px;
    background: #fffefa; padding: .7rem 1rem; font-size: 1.02rem; box-shadow: none;
}
.app-picker-btn {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--admin-border); background: var(--brand-soft); color: var(--brand);
}
.app-picker-btn:active { background: var(--brand); color: #fff; }

.app-time-cols { display: flex; gap: 0; min-height: 0; flex: 1 1 auto; }
.app-time-col { flex: 1 1 0; overflow-y: auto; -webkit-overflow-scrolling: touch; max-height: 46vh;
    border-inline-end: 1px solid var(--admin-border); scroll-snap-type: y proximity; }
.app-time-col:last-child { border-inline-end: 0; }
.app-time-col-ampm { flex: 0 0 84px; }
.app-time-colhead {
    position: sticky; top: 0; z-index: 1; background: #fff; text-align: center;
    font-size: .68rem; color: #8a94a6; padding: 6px 0; border-bottom: 1px solid var(--admin-border);
}
.app-time-cell {
    display: block; width: 100%; padding: 11px 0; text-align: center; scroll-snap-align: center;
    background: transparent; border: 0; font: inherit; font-size: 1.02rem; color: var(--ink); cursor: pointer;
}
.app-time-cell:active { background: rgba(107,74,43,.08); }
.app-time-cell.is-selected { background: var(--brand); color: #fff; font-weight: 600; border-radius: 8px; }
.app-picker-done { margin: 10px 14px 14px; }
@media (min-width: 992px) { .app-time-col { max-height: 240px; } }

/* ---- DatePicker (month grid in the selected calendar system) --------------------------------- */
.app-date-menu { padding-bottom: 0; }
.app-date-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 10px 6px; gap: 8px;
}
.app-date-title { font-weight: 600; font-size: 1.02rem; text-align: center; flex: 1 1 auto; }
.app-date-nav {
    flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 10px;
    background: rgba(107,74,43,.07); color: var(--brand); font-size: .85rem;
}
.app-date-nav:active { background: var(--brand); color: #fff; }
[dir="rtl"] .app-date-nav i { transform: scaleX(-1); }

.app-date-dow, .app-date-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 0 10px;
}
.app-date-dow { margin-bottom: 2px; }
.app-date-dow > div {
    text-align: center; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase;
    color: #8a94a6; padding: 4px 0;
}
.app-date-cell {
    aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 10px; background: transparent; color: inherit;
    font-size: .95rem; font-variant-numeric: tabular-nums; padding: 0;
}
.app-date-cell.is-blank { pointer-events: none; }
.app-date-cell:active { background: rgba(107,74,43,.10); }
/* Today is an outline, the selection is a fill — so "today" stays readable when it IS the selection. */
.app-date-cell.is-today { box-shadow: inset 0 0 0 1.5px var(--brand); color: var(--brand); }
.app-date-cell.is-selected { background: var(--brand); color: #fff; font-weight: 600; box-shadow: none; }
.app-date-foot {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 14px 14px;
}
@media (min-width: 992px) { .app-date-menu { width: 320px; } }

/* ---- VoiceRecorder --------------------------------------------------------------------------- */
.voice-rec { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.voice-rec-live { display: inline-flex; align-items: center; gap: 7px; font-size: .88rem; color: #c0392b; }
.voice-rec-dot {
    width: 9px; height: 9px; border-radius: 50%; background: #c0392b;
    animation: krd-pulse 1.1s ease-in-out infinite;
}
.voice-rec-done { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: #2e7d5b; }
@keyframes krd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .voice-rec-dot { animation: none; } }

/* Bell rows are buttons so a tap can navigate, close the popup and mark read in one go. */
.notif-row { display: block; }
.notif-row:active { background: rgba(107,74,43,.06); }

/* =====================================================================
   Cream/gold restyle (mockup 2026-08-29): app bar, home screen, media
   tiles, admin dashboard.
   ===================================================================== */

/* ---- App bar: cream, borderless, round white icon buttons, centered brand ---- */
.page-wrapper .page-header { background: var(--bg); box-shadow: none; }
.page-header .header-wrapper { background: var(--bg); }
.page-header .azhi-logo-img { border: 2px solid #33261a; border-radius: 12px; }
.page-header .azhi-logo { color: var(--ink); }

.nav-menus .btn-light {
    background: #fff !important; border: 0 !important; border-radius: 50% !important;
    width: 44px; height: 44px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(70, 50, 20, .1); font-size: 1.05rem;
}
.nav-menus .badge.bg-danger { background: var(--accent-2) !important; }

@media (max-width: 991px) {
    .page-header .header-wrapper { position: relative; }
    /* display + z-index: Cuba's responsive.css hides the header logo on phones; the mockup centers it.
       Explicit left+right with !important — Cuba's RTL sheet pins .logo-wrapper to a physical edge. */
    /* The absolute brand must resolve against the full-width header row, not Cuba's relative col. */
    .page-header .header-logo-wrapper { position: static !important; }
    .page-header .logo-wrapper {
        display: block !important; width: max-content;
        position: absolute !important; left: 50% !important; right: auto !important;
        top: 50% !important; transform: translate(-50%, -50%) !important; z-index: 1; margin: 0 !important;
    }
    .page-header .azhi-logo { display: inline !important; font-size: 1.3rem; font-weight: 800; }
    .azhi-mnav-btn {
        background: #fff !important; color: var(--ink) !important; border-radius: 50% !important;
        box-shadow: 0 1px 4px rgba(70, 50, 20, .1);
    }
    .profile-nav .profile-media {
        background: #fff; width: 44px; height: 44px; border-radius: 50%;
        align-items: center; justify-content: center;
        box-shadow: 0 1px 4px rgba(70, 50, 20, .1);
    }
    .profile-nav .profile-media > .flex-grow-1 { display: none !important; }
    .profile-nav .profile-media i.fa-circle-user { color: #2f6fd0; }
}

/* Language pills inside the mobile drawer (header hides them on phones). */
.azhi-lang-side { padding: 10px 16px 4px; gap: 6px; }
.azhi-lang-side .azhi-lang-link { border-color: var(--admin-border); opacity: .8; padding: 5px 10px; }

/* ---- Home: greeting ---- */
.krd-greet { font-size: 1.35rem; color: var(--ink); margin: 4px 2px 16px; font-weight: 500; }
.krd-greet strong { font-weight: 800; }

/* ---- Home: daily quote card (dark coffee, centered) ---- */
.krd-quote {
    background: linear-gradient(155deg, #63462f, #382515);
    border-radius: 28px; padding: 26px 22px 30px;
    color: #f5e9d3; text-align: center;
    box-shadow: 0 10px 24px rgba(80, 55, 25, .18);
}
.krd-quote-chip {
    display: inline-block; background: rgba(245, 233, 211, .16); color: #f0dfbe;
    border-radius: 999px; padding: 6px 16px; font-size: .8rem; font-weight: 600; margin-bottom: 14px;
}
.krd-quote-text { font-size: 1.15rem; line-height: 1.9; margin: 0; padding: 0; border: 0 !important; text-align: center; white-space: pre-line; }
.krd-quote-author { margin-top: 10px; font-size: .85rem; color: #d9c39a; }
.krd-quote img { border-radius: 16px; max-height: 220px; object-fit: cover; }

/* ---- Home: calendar-system date chips (default system = gold) ---- */
.krd-cal-row { display: flex; gap: 10px; }
.krd-cal-chip {
    flex: 1 1 0; min-width: 0; background: var(--card); border: 1px solid var(--admin-border);
    border-radius: 18px; padding: 14px 6px; text-align: center;
    box-shadow: 0 1px 3px rgba(70, 50, 20, .05);
}
.krd-cal-label { font-size: .78rem; color: #8a7a62; margin-bottom: 6px; }
.krd-cal-date { font-weight: 700; color: var(--ink); font-size: .95rem; line-height: 1.4; }
.krd-cal-chip-active { background: var(--accent); border-color: var(--accent); }
.krd-cal-chip-active .krd-cal-label, .krd-cal-chip-active .krd-cal-date { color: #3a2b16; }

/* ---- Home: section head + "all" link ---- */
.krd-section-title { font-weight: 800; color: var(--ink); }
.krd-all-link { color: var(--accent-2); font-weight: 700; text-decoration: none; }
.krd-all-link::after { content: "←"; margin-inline-start: 6px; }
html[dir=ltr] .krd-all-link::after { content: "→"; }
.krd-all-link:hover { color: #c4602f; }

/* ---- Home: recent memory cards ---- */
.krd-mem-list { display: flex; flex-direction: column; gap: 12px; }
.krd-mem {
    display: flex; align-items: center; gap: 14px;
    background: var(--card); border: 1px solid var(--admin-border); border-radius: 20px;
    padding: 14px 16px; text-decoration: none; color: inherit;
    box-shadow: 0 1px 3px rgba(70, 50, 20, .05);
}
.krd-mem:hover, .krd-mem:active { background: var(--brand-soft); color: inherit; }
.krd-mem-icon {
    flex: 0 0 auto; width: 52px; height: 52px; border-radius: 16px;
    background: linear-gradient(160deg, #e5c87c, #c9a24b);
    display: flex; align-items: center; justify-content: center; font-size: 1.45rem;
}
.krd-mem-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.krd-mem-title { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.krd-mem-meta { font-size: .8rem; color: #9c8b70; unicode-bidi: plaintext; }
.krd-mem-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; }

/* ---- Add: dashed photo/voice upload tiles ---- */
.krd-media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.krd-media-tile {
    border: 2px dashed var(--accent); border-radius: 16px;
    padding: 16px 12px; text-align: center; background: #fbf4e2; min-width: 0;
}
.krd-media-emoji { font-size: 1.6rem; margin-bottom: 8px; }
.krd-media-tile .form-control {
    background: transparent !important; border: 0 !important;
    padding: 0 !important; font-size: .85rem;
}
.krd-media-tile .voice-rec { justify-content: center; }

/* ---- Admin dashboard (stat cards / Free↔Pro bar / monthly chart) ---- */
.krd-admin-title { font-weight: 800; color: var(--ink); }
.krd-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 768px) { .krd-stat-grid { grid-template-columns: repeat(4, 1fr); } }
.krd-stat-card {
    background: var(--card); border: 1px solid var(--admin-border); border-radius: 22px;
    padding: 18px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    box-shadow: 0 1px 3px rgba(70, 50, 20, .05);
}
.krd-stat-emoji {
    align-self: flex-end; width: 48px; height: 48px; border-radius: 14px;
    background: #ecd18d; display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.krd-stat-value { font-size: 1.7rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.krd-stat-label { font-size: .85rem; color: #9c8b70; }

.krd-ratio-card, .krd-chart-card {
    background: var(--card); border: 1px solid var(--admin-border); border-radius: 22px;
    padding: 18px 20px; box-shadow: 0 1px 3px rgba(70, 50, 20, .05);
}
.krd-ratio-title { font-weight: 800; color: var(--ink); }
.krd-ratio-arrows { color: #9c8b70; font-weight: 400; }
.krd-ratio-pct { font-size: .85rem; color: #9c8b70; }
.krd-ratio-track { height: 10px; border-radius: 999px; background: #ece2cb; overflow: hidden; }
.krd-ratio-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
html[dir=rtl] .krd-ratio-fill { background: linear-gradient(-90deg, var(--accent-2), var(--accent)); }
.krd-ratio-fill-active, html[dir=rtl] .krd-ratio-fill-active { background: #7c9473; }

/* Every page heading speaks the same voice as the home sections — bold, ink, app-scale.
   Styled at the element level so the ~20 existing <h3 class="mb-*"> titles don't each need edits. */
.page-body h3, .page-body .krd-section-title { font-weight: 800; color: var(--ink); }
.page-body h3 { font-size: 1.25rem; }
.page-body .krd-section-title { font-size: 1.15rem; }

/* Empty states — one cream style everywhere (replaces bootstrap's blue alert-info) */
.krd-empty {
    background: var(--card); border: 2px dashed var(--admin-border); border-radius: 20px;
    padding: 28px 18px; text-align: center; color: #8a7a62; font-weight: 600;
}
.krd-empty-emoji { display: block; font-size: 1.9rem; margin-bottom: 8px; }

/* Bootstrap state alerts, re-voiced in the theme (sage success, warm warning) */
.page-body .alert-success { background: #eef3e9; color: #4d6a4a; border: 0; border-radius: 14px; }
.page-body .alert-warning { background: #f7ecd8; color: #8a6d3b; border: 0; border-radius: 14px; }
.page-body .alert-danger { background: #f7e3de; color: var(--danger); border: 0; border-radius: 14px; }

/* Outline buttons in brand brown, not bootstrap blue */
.btn-outline-primary { color: var(--brand); border-color: var(--brand); border-radius: 999px; }
.btn-outline-primary:hover, .btn-outline-primary:active {
    background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important;
}

/* A flush list inside a rounded card must clip to the card's corners (prayer times table) */
.card > .list-group { border-radius: inherit; overflow: hidden; }

/* Bell badge: keep it on the button's inner corner — at the old start-100 offset it hung half
   outside the circle, and with the bell at the screen edge (LTR) half the badge was off-screen. */
.nav-menus .btn-light .badge.rounded-pill {
    left: auto !important; right: 0 !important; top: 0 !important;
    transform: translate(25%, -25%) !important; background: var(--accent-2) !important;
}
html[dir=rtl] .nav-menus .btn-light .badge.rounded-pill {
    right: auto !important; left: 0 !important; transform: translate(-25%, -25%) !important;
}
