html, body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: #F3F4EF;
}

/* ── App background — layered brand washes + faint grid texture ─────────
   One background for EVERY authenticated page: a soft olive wash top-right,
   a soft neutral glow bottom-left, and a barely-there grid that fades out
   toward the edges. Fixed attachment so it stays still while content
   scrolls (disabled on phones where fixed backgrounds jank). */
.ez-app-bg {
    background-color: #F3F4EF;
    background-image:
        /* film grain — kills gradient banding, adds premium texture (~3.5% alpha) */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
        /* faint engineering dot grid */
        radial-gradient(rgba(62, 74, 52, 0.04) 1px, transparent 1.4px),
        /* ambient shade band blending the dark chrome into the page */
        linear-gradient(180deg, rgba(44, 53, 37, 0.075), rgba(44, 53, 37, 0.02) 160px, transparent 300px),
        /* olive wash — top right */
        radial-gradient(1300px 620px at 108% -14%, rgba(107, 122, 82, 0.17), transparent 62%),
        /* cool sage counterpoint — top left */
        radial-gradient(1000px 560px at -10% 8%, rgba(168, 176, 138, 0.13), transparent 55%),
        /* blue accent glow — bottom left */
        radial-gradient(1000px 560px at -8% 114%, rgba(30, 58, 110, 0.09), transparent 55%),
        /* blue accent hint — bottom center */
        radial-gradient(820px 480px at 58% 124%, rgba(30, 58, 110, 0.08), transparent 60%),
        /* vertical tone ramp */
        linear-gradient(180deg, #F8F9F4 0%, #F2F3ED 55%, #ECEEE5 100%);
    background-size: 160px 160px, 24px 24px, auto, auto, auto, auto, auto, auto;
    background-attachment: fixed;
}

/* Content cards float gently on the textured ground (pages only — the
   selector is scoped to the page container so popovers/menus keep their
   own elevation). */
.ez-page-container .mud-paper {
    box-shadow: 0 1px 2px rgba(31, 41, 55, 0.04), 0 10px 28px rgba(44, 53, 37, 0.06);
}

/* Brand-tinted text selection. */
::selection { background: rgba(30, 58, 110, 0.22); }

/* Inline keyboard-shortcut hint shown on action buttons (small, faded pill
   that borrows the button's own text colour so it works on filled + outlined). */
.ez-kbd {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .3px;
    line-height: 1.3;
    opacity: .68;
    margin-inline-start: 7px;
    padding: 1px 5px;
    border: 1px solid currentColor;
    border-radius: 5px;
    white-space: nowrap;
}

/* Soft entrance for page content on every navigation. */
.ez-page-container {
    animation: ez-page-in .28s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes ez-page-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Slim, branded scrollbars app-wide. */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #C9CEBD;
    border-radius: 999px;
    border: 2px solid #F3F4EF;
}
::-webkit-scrollbar-thumb:hover { background: #6B7A52; }

/* Login / Select-Company backdrop — same visual language as the boot
   splash: deep olive gradient, soft blue vignette glows, drifting grid. */
.ez-login-bg {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 12% -10%, rgba(30, 58, 110, .30), transparent 60%),
        radial-gradient(1000px 700px at 112% 118%, rgba(30, 58, 110, .22), transparent 55%),
        linear-gradient(160deg, #2C3525 0%, #3E4A34 45%, #55613F 100%);
}
.ez-login-bg::before {
    content: "";
    position: absolute;
    inset: -20%;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent);
            mask-image: radial-gradient(closest-side, #000 55%, transparent);
    animation: ez-drift 26s linear infinite;
    pointer-events: none;
}
.ez-login-bg::after {
    content: "";
    position: absolute;
    width: 340px; height: 340px;
    top: -120px; right: -90px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(30, 58, 110, .35), rgba(30, 58, 110, .12) 55%, transparent 75%);
    filter: blur(2px);
    pointer-events: none;
}

.ez-login-card {
    border-radius: 16px !important;
}

.ez-login-brand {
    width: 74px; height: 74px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E3A6E 0%, #15294F 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}

.ez-login-firm {
    text-align: center;
    font-weight: 800;
    font-size: 1.25rem;
    color: #1F2937;
}

.ez-login-foot {
    text-align: center;
    color: rgba(255,255,255,.85);
    font-size: .85rem;
    padding: 18px 0 26px;
}

/* Voucher grid — dense, Focus-like */
.ez-grid-table th {
    background: #6B7A52 !important;
    color: #fff !important;
    font-weight: 700 !important;
    white-space: nowrap;
}

/* Horizontal breathing room around row-action buttons. */
.ez-row-btn { margin-left: 4px !important; margin-right: 4px !important; }

/* ── Date / date-range picker header ───────────────────────────────────
   The picker toolbar renders the selected day-dates in a huge font; with
   long RTL/Arabic day names ("الأربعاء, 07 يناير") it overflows and clips.
   Shrink it, let it wrap, and let the toolbar grow to fit. */
.mud-picker-toolbar {
    height: auto !important;
    min-height: 0 !important;
    padding: 8px 14px !important;
    white-space: normal !important;
}
/* Catch EVERY text style the toolbar might use (the range dates render large). */
.mud-picker-toolbar .mud-typography,
.mud-picker-toolbar .mud-button-root {
    font-size: .82rem !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
    white-space: normal !important;
    word-break: break-word;
}
/* Year line a touch smaller/lighter. */
.mud-picker-toolbar .mud-typography-subtitle1,
.mud-picker-toolbar .mud-button-year .mud-typography {
    font-size: .72rem !important;
    opacity: .9;
}
/* Never cap the calendar dropdown to the input width, so a two-month
   (DisplayMonths=2) picker can render both months side by side. */
.mud-picker-content,
.mud-picker-popover-paper { max-width: none !important; }

.ez-net-band {
    background: #3E4A34;
    color: #fff;
    border-radius: 10px;
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

/* ── Print layouts (ALEZZ_PO / PO_Expn_A4) ─────────────────────────── */
.print-sheet {
    background: #fff;
    color: #000;
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 40px;
    font-family: 'Times New Roman', Georgia, serif;
}

.print-company {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: .3px;
}

.print-meta {
    display: flex;
    justify-content: space-between;
    font-size: .82rem;
    margin-top: 8px;
}

.print-doc-title {
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 1px;
    margin: 14px 0 10px;
}

.print-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 40px;
    font-size: .95rem;
    margin: 10px 0 16px;
}

.print-fields .lbl { font-weight: 700; display: inline-block; min-width: 90px; }

table.print-items {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

table.print-items th, table.print-items td {
    border: 1px solid #333;
    padding: 4px 6px;
}

table.print-items th {
    background: #4B5563;
    color: #fff;
    text-align: left;
}

table.print-items td.num { text-align: right; }

.print-totals {
    margin-top: 12px;
    margin-left: auto;
    width: 260px;
    border: 1px solid #333;
    padding: 8px 14px;
    font-size: .95rem;
}

.print-totals .row { display: flex; justify-content: space-between; padding: 2px 0; }
.print-totals .net { font-size: 1.2rem; font-weight: 800; }

.print-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 70px;
    font-size: .8rem;
    font-weight: 700;
}

/* Horizontal scroll shell for the print item tables on narrow screens. */
.print-table-wrap { overflow-x: auto; }
.print-table-wrap table.print-items { min-width: 560px; }

/* Lookup field (opens the searchable picker dialog). */
.ez-lookup-field { min-width: 0; }
.ez-lookup-clear {
    position: absolute;
    right: 34px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: #E5E7EB;
    color: #4B5563;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.ez-lookup-clear:hover { background: #1E3A6E; color: #fff; }

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    /* Strip the textured page ambience so vouchers print clean white. */
    .ez-app-bg { background: #fff !important; }
    .print-sheet { padding: 0; max-width: none; }
    .print-table-wrap { overflow-x: visible; }
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .ez-page-container { padding-left: 10px !important; padding-right: 10px !important; }
    /* Fixed backgrounds repaint on every scroll frame on mobile — let it scroll. */
    .ez-app-bg { background-attachment: scroll; }
}

@media (max-width: 700px) {
    .ez-net-band {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .print-sheet { padding: 16px 12px; }
    .print-fields { grid-template-columns: 1fr; gap: 4px; }
    .print-meta { flex-direction: column; gap: 8px; }
    .print-meta > div { max-width: 100% !important; text-align: left !important; }
    .print-company { font-size: 1.1rem; }
    .print-signatures { flex-wrap: wrap; gap: 14px 22px; margin-top: 44px; }
    .ez-login-card { margin: 0 8px; }
}

/* Comfortable touch targets on coarse pointers (phones/tablets). */
@media (pointer: coarse) {
    .mud-table-row td { padding-top: 8px; padding-bottom: 8px; }
    .mud-button-root { min-height: 40px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   LOADING SYSTEM — boot/auth splash, top route-progress bar, inline loader,
   reconnection overlay.  Palette: olive #3E4A34 / dark-blue accent #1E3A6E / #15294F
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Boot / auth splash (shown instantly, hidden when the app is ready) ── */
.ez-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(30, 58, 110, .28), transparent 60%),
        radial-gradient(1000px 700px at 110% 120%, rgba(30, 58, 110, .22), transparent 55%),
        linear-gradient(160deg, #2C3525 0%, #3E4A34 45%, #55613F 100%);
    opacity: 1;
    transition: opacity .55s ease, visibility .55s ease;
    overflow: hidden;
}
/* Soft drifting grid texture behind the mark. */
.ez-splash::before {
    content: "";
    position: absolute;
    inset: -20%;
    background-image:
        linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent);
            mask-image: radial-gradient(closest-side, #000 60%, transparent);
    animation: ez-drift 22s linear infinite;
}
.ez-splash-hide { opacity: 0; visibility: hidden; pointer-events: none; }

.ez-splash-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: ez-rise .6s cubic-bezier(.16, 1, .3, 1) both;
}

.ez-splash-orb {
    position: relative;
    width: 104px;
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}
/* Inner gradient disc holding the mark. */
.ez-splash-orb .disc {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    /* Light disc + dark mark: the black accent reads as an inverted monochrome
       badge on the dark olive splash (a black disc would vanish here). */
    background: linear-gradient(135deg, #FFFFFF 0%, #E6E6E6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #15294F;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .45), inset 0 2px 8px rgba(255, 255, 255, .55);
    animation: ez-breathe 2.4s ease-in-out infinite;
}
.ez-splash-orb .disc svg { width: 40px; height: 40px; }
/* Rotating conic ring (the "spinner"). */
.ez-splash-orb .ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 62%, rgba(255, 255, 255, .35) 82%, #FFFFFF 92%, transparent 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    animation: ez-spin 1.1s linear infinite;
}

.ez-splash-title {
    color: #fff;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: .4px;
}
.ez-splash-sub {
    color: #E8E8E8;
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

/* Slim indeterminate bar under the wordmark. */
.ez-splash-bar {
    margin-top: 20px;
    width: 200px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    overflow: hidden;
}
.ez-splash-bar > span {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55) 30%, #FFFFFF 50%, rgba(255, 255, 255, .55) 70%, transparent);
    animation: ez-indeterminate 1.25s cubic-bezier(.65, .05, .36, 1) infinite;
}

/* "Powered by MajidTek" line under the loader bar. */
.ez-splash-by {
    margin-top: 20px;
    font-size: .74rem;
    letter-spacing: .5px;
    color: rgba(255, 255, 255, .55);
}
.ez-splash-by b { color: #E8E8E8; font-weight: 800; letter-spacing: .8px; }

@keyframes ez-spin { to { transform: rotate(360deg); } }
@keyframes ez-breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 14px 40px rgba(0, 0, 0, .45), inset 0 2px 8px rgba(255, 255, 255, .35); }
    50% { transform: scale(1.06); box-shadow: 0 18px 52px rgba(0, 0, 0, .55), inset 0 2px 8px rgba(255, 255, 255, .45); }
}
@keyframes ez-indeterminate {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}
@keyframes ez-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ez-drift { from { transform: translate(0, 0); } to { transform: translate(46px, 46px); } }

/* ── Top route-progress bar (NProgress-style trickle) ─────────────────── */
.ez-topbar {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    z-index: 100000;
    /* Overlays the dark olive app bar → a bright neutral line stays visible. */
    background: linear-gradient(90deg, #FFFFFF, #E6E6E6 60%, #FFFFFF);
    box-shadow: 0 0 10px rgba(255, 255, 255, .75), 0 0 4px rgba(255, 255, 255, .6);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: width .28s ease, opacity .35s ease;
    pointer-events: none;
}
.ez-topbar.on { opacity: 1; }
/* Bright leading "comet" edge. */
.ez-topbar::after {
    content: "";
    position: absolute;
    right: 0; top: 0;
    height: 100%;
    width: 90px;
    border-radius: 999px;
    box-shadow: 0 0 14px 4px rgba(255, 255, 255, .9);
    opacity: .9;
}

/* ═══════════════════════ Global command-palette search ════════════════ */
/* App-bar trigger pill. */
.ez-search-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 10px 0 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.20);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    font-size: .85rem;
    transition: background .15s ease, border-color .15s ease;
    min-width: 0;
}
.ez-search-pill:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.5); }
.ez-search-pill .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ez-search-pill kbd {
    font-family: inherit; font-size: .68rem; font-weight: 700;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px; padding: 1px 6px; color: #fff;
}

/* Dialog shell — palette look. */
.ez-cmd-dialog .mud-dialog { border-radius: 16px; overflow: hidden; }
.ez-cmd-dialog .mud-dialog-title { padding: 0; }
.ez-cmd-dialog .mud-dialog-content { padding: 0; max-height: 68vh; overflow: hidden; }

.ez-cmd-search {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #EEF0EA;
}
.ez-cmd-search-ico { color: #6B7A52; flex-shrink: 0; }
.ez-cmd-input { flex: 1; }
.ez-cmd-input input { font-size: 1.05rem !important; }
.ez-cmd-spin { color: #1E3A6E; }
.ez-cmd-esc {
    font-family: inherit; font-size: .68rem; font-weight: 700; color: #9CA3AF;
    background: #F1F2EC; border: 1px solid #E5E7EB; border-radius: 6px; padding: 2px 7px;
}

.ez-cmd-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.ez-cmd-empty {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 46px 20px; color: #9CA3AF; text-align: center; font-size: .9rem;
}
.ez-cmd-group {
    font-size: .68rem; font-weight: 800; letter-spacing: .6px; text-transform: uppercase;
    color: #96A07E; padding: 12px 12px 4px;
}
.ez-cmd-row {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: 10px; cursor: pointer;
    border-left: 3px solid transparent;
}
.ez-cmd-row.sel { background: #F4F6EE; border-left-color: #1E3A6E; }
.ez-cmd-ico {
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.ez-cmd-text { min-width: 0; flex: 1; }
.ez-cmd-title { font-size: .9rem; font-weight: 600; color: #1F2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ez-cmd-sub { font-size: .76rem; color: #8A94A6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ez-cmd-enter { color: #C0C6B4; opacity: 0; flex-shrink: 0; font-size: 18px !important; }
.ez-cmd-row.sel .ez-cmd-enter { opacity: 1; color: #1E3A6E; }

.ez-cmd-foot {
    display: flex; gap: 18px; align-items: center;
    padding: 9px 16px; border-top: 1px solid #EEF0EA;
    font-size: .72rem; color: #9CA3AF; background: #FBFCF9;
}
.ez-cmd-foot kbd {
    font-family: inherit; font-weight: 700; color: #6B7280;
    background: #F1F2EC; border: 1px solid #E5E7EB; border-radius: 5px;
    padding: 1px 6px; margin-right: 3px;
}

/* ── Brand the MudTable "Loading" indicator app-wide ──────────────────
   Every list / report / lookup table uses MudTable's built-in Loading bar.
   Swap that thin linear bar for the same conic-gradient ring used elsewhere,
   so the modern loader appears on every page with no per-page markup. */
.mud-table-loading-progress {
    position: relative !important;
    height: 116px;
}
.mud-table-loading-progress .mud-progress-linear { visibility: hidden; }
/* Clean, crisp table spinner — a light track with a spinning dark-blue arc,
   plus a "Loading…" caption. Lighter than the full truck orb, which reads
   cluttered inside a dense data grid. */
.mud-table-loading-progress::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    margin: -32px 0 0 -22px;
    border-radius: 50%;
    border: 4px solid #E4E7DE;
    border-top-color: #1E3A6E;
    animation: ez-spin .8s linear infinite;
}
.mud-table-loading-progress::after {
    content: "Loading…";
    position: absolute;
    left: 50%;
    top: 50%;
    margin-top: 24px;
    transform: translateX(-50%);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .3px;
    color: #1E3A6E;
    white-space: nowrap;
}

/* ── Full-section page loader — centres the branded loader in the content
   area while a page fetches its initial data (e.g. voucher edit pages). ── */
.ez-page-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

/* ── Reusable inline branded loader (in-page data loads) ──────────────── */
.ez-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 40px 16px;
    color: #6B7280;
}
/* Branded "orb" loader — same mark as the boot splash (truck disc + spinning
   conic ring), so every in-page load matches the app's main loader. */
.ez-orb {
    position: relative;
    width: 78px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ez-orb .disc {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E3A6E 0%, #15294F 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 10px 26px rgba(30, 58, 110, .30), inset 0 2px 6px rgba(255, 255, 255, .22);
}
.ez-orb .disc svg { width: 32px; height: 32px; }
.ez-orb .ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 60%, rgba(30, 58, 110, .30) 80%, #1E3A6E 92%, transparent 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    animation: ez-spin 1s linear infinite;
}
.ez-loader-text { font-size: .95rem; font-weight: 700; letter-spacing: .3px; color: #1E3A6E; }
/* Small variant for tight spots. */
.ez-loader-sm .ez-orb { width: 46px; height: 46px; }
.ez-loader-sm .ez-orb .disc { width: 34px; height: 34px; }
.ez-loader-sm .ez-orb .disc svg { width: 19px; height: 19px; }
.ez-loader-sm { padding: 14px; gap: 8px; }
.ez-loader-sm .ez-loader-text { font-size: .82rem; }

/* ── Blazor reconnection / error overlay (modern restyle) ─────────────── */
#components-reconnect-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(20, 25, 16, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #1F2937;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}
/* Blazor toggles these classes on the modal element. */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected { display: flex; }

.ez-reconnect-card {
    background: #fff;
    border-radius: 16px;
    padding: 26px 30px;
    max-width: 360px;
    width: calc(100% - 40px);
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    border-top: 4px solid #1E3A6E;
}
.ez-reconnect-card .ez-orb { margin: 0 auto 14px; }
.ez-reconnect-title { font-weight: 800; font-size: 1.1rem; color: #3E4A34; }
.ez-reconnect-text { font-size: .88rem; color: #6B7280; margin-top: 6px; }
/* Swap message wording between "reconnecting" and "failed" states. */
.ez-reconnect-failedmsg { display: none; }
#components-reconnect-modal.components-reconnect-failed .ez-reconnect-tryingmsg,
#components-reconnect-modal.components-reconnect-rejected .ez-reconnect-tryingmsg { display: none; }
#components-reconnect-modal.components-reconnect-failed .ez-reconnect-failedmsg,
#components-reconnect-modal.components-reconnect-rejected .ez-reconnect-failedmsg { display: block; }
#components-reconnect-modal.components-reconnect-failed .ez-orb .ring,
#components-reconnect-modal.components-reconnect-rejected .ez-orb .ring { animation: none; }
#components-reconnect-modal.components-reconnect-failed .ez-orb,
#components-reconnect-modal.components-reconnect-rejected .ez-orb { opacity: .5; }

.ez-reconnect-retry {
    margin-top: 16px;
    background: linear-gradient(135deg, #1E3A6E, #15294F) !important;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(30, 58, 110, .35);
}
.ez-reconnect-retry:hover { filter: brightness(1.05); }

/* ── Reduced-motion: keep it calm ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ez-splash::before,
    .ez-splash-orb .ring,
    .ez-splash-orb .disc,
    .ez-splash-bar > span,
    .ez-login-bg::before,
    .ez-page-container,
    .ez-orb .ring,
    .mud-table-loading-progress::after { animation: none; }
    .ez-splash-bar > span { width: 100%; opacity: .8; }
}

/* ── Shared month-calendar grid (PO calendar + Email calendar dialogs) ── */
.ez-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ez-cal-dow { text-align: center; font-size: .72rem; font-weight: 700; color: #6B7280; padding: 4px 0; }
.ez-cal-cell { min-height: 92px; border: 1px solid #E5E7EB; border-radius: 8px; padding: 4px; background: #FFFFFF; cursor: pointer; overflow: hidden; }
.ez-cal-cell:hover { border-color: #3E4A34; }
.ez-cal-out { background: #F4F5F0; opacity: .55; }
.ez-cal-today { border: 2px solid #1E3A6E; }
.ez-cal-selected { box-shadow: 0 0 0 2px #3E4A34 inset; }
.ez-cal-daynum { font-size: .8rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.ez-cal-count { background: #1E3A6E; color: #fff; border-radius: 999px; font-size: .65rem; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.ez-cal-chip { margin: 1px 0 !important; max-width: 100%; }
.ez-cal-more { font-size: .68rem; color: #6B7280; padding-left: 2px; }
@media (max-width: 600px) {
    .ez-cal-cell { min-height: 44px; }
    .ez-cal-chips { display: none; }
}
