/* ==========================================================================
   Mexus app — admin theme
   Shares its tokens with the mexus.io marketing site so the product and the
   website feel like one brand. Loaded after Bootstrap and the Syncfusion
   bootstrap5.3 theme so it can re-skin both.
   ========================================================================== */

:root {
    --navy-950: #07111f;
    --navy-900: #0d1b2e;
    --navy-800: #142640;
    --navy-700: #1d3456;
    --navy-600: #2a4670;

    --ink: #0f1d33;
    --body: #3d4b61;
    --muted: #64738a;
    --faint: #94a3b8;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --bg: #ffffff;
    --bg-soft: #f4f7fb;
    --bg-app: #f2f5fa;

    --green: #15803d;
    --green-hover: #116b33;
    --green-bright: #46b065;
    --green-tint: #e8f6ed;

    --leave-blue: #1976d2;
    --leave-red: #ef5350;
    --leave-amber: #f5a524;
    --leave-green: #2fb35a;

    --amber-tint: #fff4e0;
    --amber-ink: #9a5b00;
    --red-tint: #fdecec;
    --red-ink: #b42318;
    --blue-tint: #e8f1fc;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(15, 29, 51, .06), 0 1px 3px rgba(15, 29, 51, .05);
    --shadow: 0 10px 30px -12px rgba(15, 29, 51, .18), 0 2px 6px rgba(15, 29, 51, .05);
    --shadow-lg: 0 30px 60px -20px rgba(15, 29, 51, .28);

    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;

    --sidebar-w: 248px;
    --sidebar-w-collapsed: 76px;
    --topbar-h: 64px;

    /* Bootstrap */
    --bs-body-font-family: var(--font);
    --bs-body-color: var(--body);
    --bs-body-bg: var(--bg-app);
    --bs-border-color: var(--line);
    --bs-primary: var(--green);
    --bs-primary-rgb: 21, 128, 61;
    --bs-link-color: var(--green);
    --bs-link-color-rgb: 21, 128, 61;
    --bs-link-hover-color: var(--green-hover);
    --bs-link-hover-color-rgb: 17, 107, 51;
    --bs-border-radius: 10px;
    --bs-border-radius-lg: var(--radius);
    --bs-emphasis-color: var(--ink);

    /* Syncfusion bootstrap5.3 theme */
    --color-sf-primary: rgba(21, 128, 61, 1);
    --color-sf-primary-light: #8fd3a6;
    --color-sf-primary-lighter: var(--green-tint);
    --color-sf-primary-dark: var(--green-hover);
    --color-sf-primary-darker: #0b4d24;
    --color-sf-primary-shadow: 21, 128, 61;
    --color-sf-primary-bg-color-hover: var(--green-hover);
    --color-sf-primary-border-color-hover: var(--green-hover);
    --color-sf-primary-bg-color-pressed: #0f5f2d;
    --color-sf-primary-border-color-pressed: #0f5f2d;
    --color-sf-primary-bg-color-disabled: rgba(21, 128, 61, .5);
    --color-sf-content-bg-color-selected: var(--green);
    --color-sf-flyout-bg-color-pressed: var(--green);
    --color-sf-border-focus: #8fd3a6;
    --color-sf-border-selected: #8fd3a6;
    --color-sf-content-text-color: var(--ink);
    --color-sf-border: var(--line);
    --color-sf-border-light: var(--line);
    --color-sf-success: rgba(21, 128, 61, 1);
    --color-sf-danger: rgba(220, 38, 38, 1);
    --color-sf-danger-bg-color-hover: #b91c1c;
    --color-sf-danger-border-color-hover: #b91c1c;
}

/* Base ------------------------------------------------------------------- */

html, body {
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
    background: var(--bg-app);
    color: var(--body);
    font-size: .95rem;
    line-height: 1.55;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--ink);
    letter-spacing: -.015em;
    font-weight: 650;
}

h1:focus { outline: none; }

a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-hover); }

:focus-visible {
    outline: 3px solid var(--leave-blue);
    outline-offset: 2px;
}

::selection { background: var(--green-tint); color: var(--ink); }

.text-muted { color: var(--muted) !important; }
.min-w-0 { min-width: 0; }
.text-transform-none { text-transform: none; letter-spacing: 0; font-weight: 500; }
.text-ink { color: var(--ink) !important; }
.fw-650 { font-weight: 650 !important; }
.small-caps {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Bootstrap components --------------------------------------------------- */

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: 10px;
    --bs-btn-padding-x: 1rem;
    --bs-btn-padding-y: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.btn-lg { --bs-btn-border-radius: 12px; --bs-btn-padding-y: .7rem; --bs-btn-font-size: 1rem; }
.btn-sm { --bs-btn-border-radius: 8px; --bs-btn-padding-x: .7rem; --bs-btn-padding-y: .3rem; }

.btn-primary, .btn-success {
    --bs-btn-bg: var(--green);
    --bs-btn-border-color: var(--green);
    --bs-btn-hover-bg: var(--green-hover);
    --bs-btn-hover-border-color: var(--green-hover);
    --bs-btn-active-bg: #0f5f2d;
    --bs-btn-active-border-color: #0f5f2d;
    --bs-btn-disabled-bg: var(--green);
    --bs-btn-disabled-border-color: var(--green);
    --bs-btn-focus-shadow-rgb: 21, 128, 61;
    box-shadow: 0 1px 2px rgba(21, 128, 61, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.btn-dark, .btn-navy {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--navy-900);
    --bs-btn-border-color: var(--navy-900);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--navy-700);
    --bs-btn-hover-border-color: var(--navy-700);
    --bs-btn-active-bg: var(--navy-800);
}

.btn-outline-secondary, .btn-light, .btn-ghost {
    --bs-btn-color: var(--body);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--bg-soft);
    --bs-btn-hover-border-color: var(--line-strong);
    --bs-btn-active-color: var(--ink);
    --bs-btn-active-bg: var(--line);
    --bs-btn-active-border-color: var(--line-strong);
}

.btn-outline-success {
    --bs-btn-color: var(--green);
    --bs-btn-border-color: var(--green);
    --bs-btn-hover-bg: var(--green);
    --bs-btn-hover-border-color: var(--green);
}

.btn-danger {
    --bs-btn-bg: #dc2626;
    --bs-btn-border-color: #dc2626;
    --bs-btn-hover-bg: #b91c1c;
    --bs-btn-hover-border-color: #b91c1c;
}

.btn-soft-danger {
    --bs-btn-color: var(--red-ink);
    --bs-btn-bg: var(--red-tint);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #dc2626;
    --bs-btn-hover-border-color: #dc2626;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
}

.form-control, .form-select {
    border-color: var(--line-strong);
    border-radius: 10px;
    color: var(--ink);
    padding: .6rem .85rem;
    transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: var(--faint); }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--green-bright);
    box-shadow: 0 0 0 4px rgba(70, 176, 101, .18);
}
.form-floating > .form-control,
.form-floating > .form-select { height: calc(3.4rem + 2px); min-height: calc(3.4rem + 2px); }
.form-floating > label { color: var(--muted); }
.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder { color: transparent; }

.form-label, label.form-label, .field-label {
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: .35rem;
}

.form-check-input { border-color: var(--line-strong); }
.form-check-input:checked { background-color: var(--green); border-color: var(--green); }
.darker-border-checkbox.form-check-input { border-color: #929292; }

.valid.modified:not([type=checkbox]) { outline: none; border-color: var(--green-bright); }
.invalid { outline: none; border-color: #dc2626 !important; }
.validation-message, .text-danger.validation-message {
    color: #dc2626;
    font-size: .8rem;
    font-weight: 500;
    margin-top: .3rem;
    list-style: none;
}
ul.validation-errors {
    list-style: none;
    padding: .75rem 1rem;
    margin: 0 0 1rem;
    background: var(--red-tint);
    border-radius: 10px;
    font-size: .85rem;
}

.alert {
    --bs-alert-border-radius: 12px;
    border: 0;
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    font-size: .9rem;
}
.alert-info { --bs-alert-bg: var(--blue-tint); --bs-alert-color: #0b4a8b; }
.alert-success { --bs-alert-bg: var(--green-tint); --bs-alert-color: #0f5f2d; }
.alert-warning { --bs-alert-bg: var(--amber-tint); --bs-alert-color: var(--amber-ink); }
.alert-danger { --bs-alert-bg: var(--red-tint); --bs-alert-color: var(--red-ink); }

.badge { font-weight: 650; border-radius: 999px; padding: .35em .7em; }

.table {
    --bs-table-color: var(--body);
    --bs-table-border-color: var(--line);
    margin-bottom: 0;
}
.table > thead th {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--bg-soft);
    border-bottom-width: 1px;
    padding: .75rem 1rem;
    white-space: nowrap;
}
.table > tbody td { padding: .8rem 1rem; vertical-align: middle; }
.table > tbody tr:last-child td { border-bottom: 0; }

.progress { --bs-progress-bg: var(--line); --bs-progress-border-radius: 99px; height: 8px; }
.progress-sm { height: 6px; }

.modal-content { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header, .modal-footer { border-color: var(--line); padding: 1.1rem 1.4rem; }
.modal-body { padding: 1.4rem; }
.modal-title { font-weight: 650; }
.modal-backdrop.show { opacity: .45; background: var(--navy-950); }

.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: .4rem;
}
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; }
.dropdown-item:active { background: var(--green); }

/* Cards: every page is built from these, so they carry most of the look -- */

.card {
    --bs-card-border-color: var(--line);
    --bs-card-border-radius: var(--radius);
    --bs-card-inner-border-radius: calc(var(--radius) - 1px);
    --bs-card-cap-bg: transparent;
    --bs-card-spacer-x: 1.4rem;
    --bs-card-spacer-y: 1.25rem;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    background: #fff;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.4rem;
    border-bottom: 1px solid var(--line);
    background: transparent;
    min-height: 64px;
}
.card-header > .card-title,
.card-title {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 650;
    color: var(--ink);
    margin: 0;
    flex: 1;
    letter-spacing: -.01em;
}
.card-header .card-title .d-flex { width: 100%; }
.card-sub { color: var(--muted); font-size: .85rem; font-weight: 400; margin-top: 2px; }
.card-body { padding: 1.25rem 1.4rem; }
.card-body > .e-grid:only-child,
.card-flush > .card-body { padding: 0; }

/* App shell ------------------------------------------------------------- */

.app {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    background:
        radial-gradient(120% 60% at 0% 0%, rgba(70, 176, 101, .12), transparent 60%),
        var(--navy-900);
    color: #c8d3e3;
    transition: width .22s ease, transform .22s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--topbar-h);
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}
.sidebar-brand .brand-logo { height: 30px; width: auto; }
.sidebar-brand .brand-mark { width: 34px; height: 34px; display: none; border-radius: 9px; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 12px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.nav-group-label {
    display: block;
    padding: 18px 12px 8px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #6f809b;
    white-space: nowrap;
}
.nav-group-label:first-child { padding-top: 4px; }

.side-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 10px;
    color: #c8d3e3;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .15s, color .15s;
}
.side-link i {
    font-size: 1.1rem;
    width: 22px;
    flex-shrink: 0;
    text-align: center;
    color: #8fa1bd;
    transition: color .15s;
}
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link:hover i { color: #fff; }
.side-link.active {
    background: rgba(70, 176, 101, .16);
    color: #fff;
    font-weight: 600;
}
.side-link.active i { color: var(--green-bright); }
.side-link.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--green-bright);
}
.side-link .side-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.side-link .side-count {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 99px;
    background: var(--leave-amber);
    color: var(--navy-950);
    font-size: .7rem;
    font-weight: 800;
}
.side-link .side-tag {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .08);
    color: #8fa1bd;
}

.sidebar-foot {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    flex-shrink: 0;
}

.upgrade-card {
    padding: 14px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(70, 176, 101, .22), rgba(25, 118, 210, .16));
    border: 1px solid rgba(255, 255, 255, .08);
    color: #e2e8f0;
    font-size: .8rem;
    white-space: normal;
}
.upgrade-card strong { display: block; color: #fff; font-size: .88rem; margin-bottom: 2px; }
.upgrade-card a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    color: var(--green-bright);
    font-weight: 700;
    text-decoration: none;
}

.collapse-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #8fa1bd;
    font-size: .85rem;
    font-weight: 500;
    white-space: nowrap;
}
.collapse-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.collapse-btn i { font-size: 1.1rem; width: 22px; transition: transform .22s; }

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-w);
    transition: margin-left .22s ease;
}

/* Collapsed rail (desktop) */
.app.is-collapsed .app-sidebar { width: var(--sidebar-w-collapsed); }
.app.is-collapsed .app-main { margin-left: var(--sidebar-w-collapsed); }
.app.is-collapsed .sidebar-brand { justify-content: center; padding: 0; }
.app.is-collapsed .brand-logo { display: none; }
.app.is-collapsed .brand-mark { display: block; }
.app.is-collapsed .side-label,
.app.is-collapsed .side-tag,
.app.is-collapsed .upgrade-card,
.app.is-collapsed .collapse-btn span { display: none; }
.app.is-collapsed .nav-group-label {
    height: 1px;
    padding: 0;
    margin: 14px 10px;
    background: rgba(255, 255, 255, .08);
    font-size: 0;
}
.app.is-collapsed .side-link,
.app.is-collapsed .collapse-btn { justify-content: center; padding: 11px 0; }
.app.is-collapsed .side-link .side-count {
    position: absolute;
    top: 3px;
    right: 8px;
    min-width: 16px;
    height: 16px;
    font-size: .6rem;
    padding: 0 4px;
}
.app.is-collapsed .collapse-btn i { transform: rotate(180deg); }
.app.is-collapsed .sidebar-nav { overflow: visible; }

/* Rail tooltips */
.app.is-collapsed .side-link[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--navy-950);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow);
    pointer-events: none;
    z-index: 5;
}

.sidebar-backdrop { display: none; }

/* Topbar */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--topbar-h);
    padding: 0 28px;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}

.topbar-burger { display: inline-grid; }

.topbar-context { min-width: 0; }
.topbar-context .hello { font-weight: 650; color: var(--ink); line-height: 1.2; }
.topbar-context .today { font-size: .8rem; color: var(--muted); }

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--body);
    font-size: 1.15rem;
    text-decoration: none;
    transition: background-color .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); border-color: var(--line); }
.icon-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    border-radius: 99px;
    background: #ef4444;
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    border: 2px solid #fff;
}

.topbar-cta { white-space: nowrap; }

.user-menu { position: relative; }
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    transition: box-shadow .15s, border-color .15s;
}
.user-chip:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.user-chip .who { text-align: left; line-height: 1.15; }
.user-chip .who strong { display: block; font-size: .85rem; }
.user-chip .who small { color: var(--muted); font-size: .72rem; }
.user-chip > i { color: var(--muted); font-size: .8rem; }

.menu-scrim { position: fixed; inset: 0; z-index: 1; }

.user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 2;
    width: 280px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    animation: pop .14s ease-out;
}
.user-dropdown .ud-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 14px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}
.user-dropdown .ud-head strong { display: block; color: var(--ink); line-height: 1.25; }
.user-dropdown .ud-head small { color: var(--muted); word-break: break-all; }
.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--body);
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
}
.user-dropdown a:hover { background: var(--bg-soft); color: var(--ink); }
.user-dropdown a i { color: var(--muted); font-size: 1rem; }
.user-dropdown a.danger { color: var(--red-ink); }
.user-dropdown a.danger i { color: var(--red-ink); }
.user-dropdown hr { margin: 6px 0; border-color: var(--line); opacity: 1; }

@keyframes pop {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to { opacity: 1; transform: none; }
}

.app-content {
    flex: 1;
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 28px 28px 8px;
}
.app-content.is-wide { max-width: none; }

.app-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 18px 28px 24px;
    color: var(--faint);
    font-size: .8rem;
}
.app-footer nav { display: flex; gap: 18px; }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--ink); }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: var(--shadow-lg); }
    .app-main { margin-left: 0 !important; }
    .app.is-mobile-open .app-sidebar { transform: none; }
    .app.is-mobile-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        background: rgba(7, 17, 31, .5);
        animation: fade .2s ease;
    }
    /* never show the collapsed rail on small screens */
    .app .brand-logo { display: block !important; }
    .app .brand-mark { display: none !important; }
    .app .side-label, .app .side-tag, .app .upgrade-card { display: revert !important; }
    .app .side-link { justify-content: flex-start !important; padding: 9px 12px !important; }
    .app .nav-group-label { height: auto !important; margin: 0 !important; padding: 18px 12px 8px !important; background: none !important; font-size: .68rem !important; }
    .collapse-btn { display: none !important; }
    .app-topbar { padding: 0 16px; }
    .app-content { padding: 20px 16px 8px; }
    .app-footer { padding: 16px; }
}

@media (max-width: 575.98px) {
    .user-chip .who, .user-chip > i { display: none; }
    .user-chip { padding: 3px; }
    .topbar-context .today { display: none; }
    .topbar-cta span { display: none; }
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Page header ------------------------------------------------------------ */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}
.page-head .kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--green);
}
.page-head h1 {
    font-size: 1.65rem;
    margin: 0;
    line-height: 1.2;
}
.page-head p {
    margin: 6px 0 0;
    color: var(--muted);
    max-width: 62ch;
}
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Stat tiles */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.stat-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--c, var(--green)) 12%, #fff);
    color: var(--c, var(--green));
    font-size: 1.25rem;
}
.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
    letter-spacing: -.02em;
}
.stat-label { font-size: .8rem; color: var(--muted); }

/* Avatars, pills, chips --------------------------------------------------- */

.avatar {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: var(--s, 36px);
    height: var(--s, 36px);
    border-radius: 50%;
    background: var(--c, var(--leave-blue));
    color: #fff;
    font-size: calc(var(--s, 36px) * .36);
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1;
    user-select: none;
}
.avatar-ring { box-shadow: 0 0 0 2px #fff; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px #fff; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar-stack .avatar.more { background: var(--line); color: var(--body); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--bg-soft);
    color: var(--body);
}
.pill-pending { background: var(--amber-tint); color: var(--amber-ink); }
.pill-approved { background: var(--green-tint); color: var(--green); }
.pill-declined { background: var(--red-tint); color: var(--red-ink); }
.pill-info { background: var(--blue-tint); color: #0b4a8b; }
.pill-navy { background: var(--navy-900); color: #fff; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}
.chip i, .swatch {
    display: inline-block;
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--c, var(--leave-blue));
}
.swatch-lg { width: 44px; height: 14px; border-radius: 99px; }

/* Balance bar (from the mexus.io approval mock) */
.bar {
    display: flex;
    height: 8px;
    border-radius: 99px;
    background: var(--line);
    overflow: hidden;
}
.bar span { background: var(--leave-blue); transition: width .3s ease; }
.bar .bar-new {
    background: repeating-linear-gradient(-45deg, var(--leave-blue) 0 4px, #64a8ea 4px 8px);
}
.bar.is-over .bar-new {
    background: repeating-linear-gradient(-45deg, #dc2626 0 4px, #f87171 4px 8px);
}
.bar-lg { height: 10px; }

/* Empty state */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 56px 20px;
    color: var(--muted);
}
.empty-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 20px;
    background: var(--green-tint);
    color: var(--green);
    font-size: 1.7rem;
}
.empty h3 { font-size: 1.1rem; margin-bottom: 4px; }
.empty p { max-width: 42ch; margin: 0 auto 16px; }

/* Leave request card (the mexus.io "how it works" approval mock) --------- */

.req-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    align-items: start;
}

.req-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    color: var(--ink);
    font-size: .92rem;
    transition: transform .2s ease, box-shadow .2s ease;
    animation: rise .35s ease both;
}
.req-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.req-card.is-leaving { animation: leave .3s ease forwards; }

.req-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.req-head .who { min-width: 0; }
.req-head strong { display: block; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-head small { color: var(--muted); }
.req-head .pill { margin-left: auto; }

.req-rows { margin: 0; padding: 10px 0; }
.req-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.req-rows dt { color: var(--muted); font-weight: 400; }
.req-rows dd {
    margin: 0;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-align: right;
}
.req-rows dd i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex-shrink: 0; }

.req-note {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-left: 3px solid var(--line-strong);
    background: var(--bg-soft);
    border-radius: 0 10px 10px 0;
    color: var(--body);
    font-size: .85rem;
    font-style: italic;
}

.req-balance { padding: 14px 16px; background: var(--bg-soft); border-radius: var(--radius); }
.req-balance-label {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: 8px;
}
.req-balance-label span:last-child { color: var(--ink); font-weight: 650; }
.req-balance-label.is-over span:last-child { color: var(--red-ink); }

.req-clash {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--amber-tint);
    color: var(--amber-ink);
    font-size: .8rem;
    font-weight: 500;
}
.req-clash .avatar-stack .avatar { --s: 24px; box-shadow: 0 0 0 2px var(--amber-tint); }
.req-clash.is-clear { background: var(--green-tint); color: var(--green); }

.req-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}
.req-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .9rem;
    border: 0;
    transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.req-btn:active { transform: scale(.98); }
.req-btn:disabled { opacity: .55; cursor: not-allowed; }
.req-btn-muted { background: #fff; border: 1.5px solid var(--line-strong); color: var(--body); }
.req-btn-muted:hover { border-color: #f1a7a7; color: var(--red-ink); background: var(--red-tint); }
.req-btn-primary { background: var(--green); color: #fff; }
.req-btn-primary:hover { background: var(--green-hover); }
.req-btn i { font-size: 1.05rem; }

.req-toast {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100% - 24px);
    margin: 14px auto 0;
    padding: 9px 16px;
    background: var(--navy-900);
    color: #e2e8f0;
    border-radius: 999px;
    font-size: .78rem;
    box-shadow: var(--shadow);
}
.req-toast i { color: var(--green-bright); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes leave { to { opacity: 0; transform: scale(.96); } }

/* Leave list (My leave) */
.leave-list { list-style: none; margin: 0; padding: 0; }
.leave-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 1.4rem;
    border-bottom: 1px solid var(--line);
}
.leave-item:last-child { border-bottom: 0; }
.date-block {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 52px;
    height: 56px;
    border-radius: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    line-height: 1;
}
.date-block small { font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green); }
.date-block strong { font-size: 1.3rem; color: var(--ink); font-family: var(--font-display); }
.leave-item .li-main { flex: 1; min-width: 0; }
.leave-item .li-main strong { display: block; color: var(--ink); font-weight: 600; }
.leave-item .li-main span { color: var(--muted); font-size: .85rem; }
.leave-item .li-days { text-align: right; white-space: nowrap; }
.leave-item .li-days strong { display: block; color: var(--ink); font-size: 1.05rem; }
.leave-item .li-days small { color: var(--muted); }

.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 1.4rem;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--line);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.section-label .count {
    padding: 1px 7px;
    border-radius: 99px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
}

/* Allowance hero (My leave / Request leave) */
.allowance-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: var(--radius-lg);
    color: #e2e8f0;
    background:
        radial-gradient(90% 120% at 100% 0%, rgba(70, 176, 101, .35), transparent 60%),
        radial-gradient(70% 90% at 0% 100%, rgba(25, 118, 210, .3), transparent 60%),
        var(--navy-900);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.allowance-card .small-caps { color: #9fb0c9; }
.allowance-card .big {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 6px 0 14px;
    font-family: var(--font-display);
    color: #fff;
}
.allowance-card .big strong { font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.allowance-card .big span { color: #9fb0c9; }
.allowance-card .bar { background: rgba(255, 255, 255, .14); }
.allowance-card .bar span { background: var(--green-bright); }
.allowance-card .bar .bar-new { background: repeating-linear-gradient(-45deg, var(--green-bright) 0 4px, #8fd3a6 4px 8px); }
.allowance-card .meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: .8rem;
    color: #9fb0c9;
}
.allowance-card .meta strong { color: #fff; }

/* Request form */
.half-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
}
.half-toggle button {
    padding: 7px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
}
.half-toggle button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.step-num {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--green-tint);
    color: var(--green);
    font-size: .75rem;
    font-weight: 800;
}

.dev-box {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .78rem;
    color: var(--muted);
}
.dev-box p { margin: 0; }

/* Profile drawer ---------------------------------------------------------- */

.drawer-scrim {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(7, 17, 31, .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    width: min(440px, 100vw);
    background: var(--bg-app);
    box-shadow: var(--shadow-lg);
    transform: translateX(105%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.drawer.open { transform: none; }

.drawer-hero {
    position: relative;
    padding: 20px 22px 22px;
    color: #e2e8f0;
    background:
        radial-gradient(90% 120% at 100% 0%, rgba(70, 176, 101, .3), transparent 60%),
        var(--navy-900);
    flex-shrink: 0;
}
.drawer-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.drawer-top .small-caps { color: #9fb0c9; }
.drawer-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
}
.drawer-close:hover { background: rgba(255, 255, 255, .16); }
.drawer-id { display: flex; align-items: center; gap: 14px; }
.drawer-id .avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.drawer-id h3 { color: #fff; font-size: 1.25rem; margin: 0 0 2px; }
.drawer-id a { color: #9fb0c9; font-size: .85rem; text-decoration: none; word-break: break-all; }
.drawer-id a:hover { color: #fff; }
.drawer-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.drawer-tags .pill { background: rgba(255, 255, 255, .1); color: #e2e8f0; }
.drawer-tags .pill.pill-accent { background: var(--green-bright); color: var(--navy-950); }

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 18px 28px;
}

.drawer-section {
    margin-bottom: 14px;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.drawer-section h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 12px;
}

.allowance-ring { display: flex; align-items: center; gap: 18px; }
.ring { position: relative; width: 108px; height: 108px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .used { stroke: var(--leave-blue); transition: stroke-dasharray .6s ease; }
.ring .pending { stroke: var(--leave-amber); }
.ring-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    line-height: 1.05;
}
.ring-label strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); }
.ring-label small { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.ring-legend { flex: 1; display: grid; gap: 7px; font-size: .84rem; }
.ring-legend > div { display: flex; align-items: center; gap: 8px; }
.ring-legend .swatch { width: 9px; height: 9px; }
.ring-legend span:last-child { margin-left: auto; font-weight: 650; color: var(--ink); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stat { padding: 10px; border-radius: 12px; background: var(--bg-soft); text-align: center; }
.mini-stat strong { display: block; font-size: 1.15rem; color: var(--ink); font-family: var(--font-display); }
.mini-stat small { font-size: .72rem; color: var(--muted); }

.seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: var(--bg-soft);
}
.seg button {
    flex: 1;
    padding: 6px 4px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 650;
    white-space: nowrap;
}
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button em { font-style: normal; color: var(--faint); margin-left: 3px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
}
.timeline li:last-child { border-bottom: 0; }
.timeline .date-block { width: 44px; height: 46px; border-radius: 10px; }
.timeline .date-block strong { font-size: 1.05rem; }
.timeline .t-main { flex: 1; min-width: 0; font-size: .85rem; }
.timeline .t-main strong { display: flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }
.timeline .t-main span { color: var(--muted); font-size: .78rem; }
.timeline .t-days { font-size: .8rem; font-weight: 650; color: var(--ink); white-space: nowrap; }
.timeline-empty { padding: 18px 0 8px; text-align: center; color: var(--faint); font-size: .85rem; }

.people { display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; align-items: center; gap: 10px; font-size: .86rem; color: var(--ink); font-weight: 500; }
.person small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }

.kv { display: grid; gap: 8px; margin: 0; font-size: .85rem; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; }
.kv dt { color: var(--muted); font-weight: 400; }
.kv dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }

/* Team calendar ------------------------------------------------------------ */

.cal-shell {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.cal-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(180deg, #fff, var(--bg-soft));
}
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.cal-legend .chip { padding: 4px 10px; font-size: .75rem; }
.cal-legend .chip.is-pending i {
    background: repeating-linear-gradient(-45deg, #94a3b8 0 3px, #cbd5e1 3px 6px);
}

.out-today {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    font-size: .8rem;
    color: var(--muted);
    white-space: nowrap;
}
.out-today strong { color: var(--ink); }
.out-today .avatar-stack .avatar { --s: 26px; }
.out-today .none {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--green-tint);
    color: var(--green);
}

.cal-shell .e-schedule {
    border: 0 !important;
    font-family: var(--font) !important;
}

.cal-shell .e-schedule .e-schedule-toolbar-container .e-toolbar,
.cal-shell .e-schedule .e-schedule-toolbar {
    background: #fff !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    box-shadow: none !important;
    min-height: 56px;
}
.cal-shell .e-schedule .e-schedule-toolbar .e-toolbar-items { background: #fff !important; min-height: 56px; }
.cal-shell .e-schedule .e-schedule-toolbar .e-toolbar-item .e-tbar-btn {
    border-radius: 10px !important;
    background: transparent !important;
    color: var(--ink) !important;
}
.cal-shell .e-schedule .e-schedule-toolbar .e-toolbar-item .e-tbar-btn:hover { background: var(--bg-soft) !important; }
.cal-shell .e-schedule .e-schedule-toolbar .e-date-range .e-tbar-btn-text {
    font-family: var(--font-display);
    font-size: 1.05rem !important;
    font-weight: 650 !important;
    color: var(--ink) !important;
}
.cal-shell .e-schedule .e-schedule-toolbar .e-today .e-tbar-btn {
    border: 1px solid var(--line-strong) !important;
    padding: 0 14px !important;
    font-weight: 600;
}

/* grid lines */
.cal-shell .e-schedule .e-timeline-view .e-work-cells,
.cal-shell .e-schedule .e-timeline-view .e-resource-cells,
.cal-shell .e-schedule .e-timeline-view .e-header-cells,
.cal-shell .e-schedule .e-timeline-view .e-time-cells-wrap table td,
.cal-shell .e-schedule .e-timeline-view .e-date-header-wrap table td {
    border-color: #edf1f6 !important;
}
.cal-shell .e-schedule .e-timeline-view .e-work-cells { background: #fff; }
.cal-shell:not(.rota-board) .e-schedule .e-timeline-view .e-work-cells:not(.e-work-hours) {
    background: repeating-linear-gradient(-45deg, #f7f9fc 0 6px, #f1f4f9 6px 12px);
}
.cal-shell .e-schedule .e-timeline-view .e-work-cells:hover { background: var(--green-tint) !important; }
.cal-shell .e-schedule .e-timeline-view .e-work-cells.e-selected-cell { background: #d9f0e1 !important; }

/* column headers */
.cal-shell .e-schedule .e-timeline-view .e-date-header-wrap,
.cal-shell .e-schedule .e-timeline-view .e-resource-left-td { background: var(--bg-soft) !important; }
.cal-shell .e-schedule .e-timeline-view .e-date-header-wrap .e-header-cells,
.cal-shell .e-schedule .e-timeline-view .e-date-header-wrap .e-time-slots {
    background: var(--bg-soft) !important;
    color: var(--muted) !important;
    font-size: .72rem !important;
    font-weight: 600 !important;
}
.cal-shell .e-schedule .e-timeline-view .e-header-cells .date-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
    padding: 4px 0;
}
.cal-shell .e-schedule .e-timeline-view .e-header-cells .date-text small {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--faint);
}
.cal-shell .e-schedule .e-timeline-view .e-header-cells .date-text strong {
    font-size: .95rem;
    color: var(--ink);
    font-weight: 650;
}
.cal-shell .e-schedule .e-timeline-view .e-header-cells.e-current-day .date-text strong {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
}
.cal-shell .e-schedule .e-timeline-view .e-header-cells.e-current-day .date-text small { color: var(--green); }
.cal-shell .e-schedule .e-timeline-view .time-text { font-size: .62rem; color: var(--faint); letter-spacing: .04em; }

/* current time indicator */
.cal-shell .e-schedule .e-timeline-view .e-current-timeline { border-left: 2px solid var(--green) !important; }
.cal-shell .e-schedule .e-timeline-view .e-previous-timeline { border-color: var(--green) !important; }

/* column sizing: 4 weeks of AM/PM slots */
.cal-shell:not(.rota-board) .e-schedule .e-timeline-view .e-date-header-wrap table col,
.cal-shell:not(.rota-board) .e-schedule .e-timeline-view .e-content-wrap table col { width: 38px; }
.cal-shell:not(.rota-board) .e-schedule .e-timeline-view .e-appointment { height: 90% !important; }

/* resource column */
.cal-shell .e-schedule .e-timeline-view .e-resource-left-td { width: 290px; }
.cal-shell .e-schedule.e-device .e-timeline-view .e-resource-left-td { width: 150px; }
.cal-shell .e-schedule.e-device .res-cell .res-name small,
.cal-shell .e-schedule.e-device .res-cell .res-open { display: none; }
.cal-shell .e-schedule .e-timeline-view .e-resource-cells { padding: 0 !important; background: #fff; }
.cal-shell .e-schedule .e-timeline-view .e-resource-cells .e-blazor-template,
.cal-shell .e-schedule .e-resource-cells .e-resource-text { height: 100%; width: 100%; }
.cal-shell .res-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 0 10px 0 14px;
    min-width: 0;
}
.cal-shell .res-cell .res-name { flex: 1; min-width: 0; line-height: 1.2; }
.cal-shell .res-cell .res-name strong {
    display: block;
    font-size: .86rem;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-shell .res-cell .res-name small {
    display: block;
    font-size: .72rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-shell .res-cell .res-open {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--muted);
    opacity: .0;
    transition: opacity .15s, background-color .15s, color .15s;
}
.cal-shell .e-resource-cells:hover .res-open,
.cal-shell .res-cell .res-open:focus-visible { opacity: 1; }
.cal-shell .res-cell .res-open:hover { background: var(--green); border-color: var(--green); color: #fff; }
.cal-shell .res-cell.is-filler { opacity: .35; }
.cal-shell .res-cell.is-filler .filler-bar { height: 8px; width: 60%; border-radius: 99px; background: var(--line); }

.cal-shell .res-head { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; }
.cal-shell .res-head .res-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.cal-shell .res-head .sort-btn {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
}
.cal-shell .res-head .sort-btn:hover, .cal-shell .res-head .sort-btn.on { background: #fff; color: var(--green); }
.cal-shell .res-head .e-input-group { border-radius: 10px !important; background: #fff !important; }

/* events */
.cal-shell .e-schedule .e-timeline-view .e-appointment {
    border: 0 !important;
    border-radius: 9px !important;
    box-shadow: 0 1px 2px rgba(15, 29, 51, .18), inset 0 0 0 1px rgba(255, 255, 255, .2);
    font-size: .75rem;
    line-height: 1.25;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s;
}
.cal-shell .e-schedule .e-timeline-view .e-appointment:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -6px rgba(15, 29, 51, .45);
    filter: saturate(1.1);
}
.cal-shell .e-schedule .e-timeline-view .e-appointment.e-appointment-border,
.cal-shell .e-schedule .e-timeline-view .e-appointment:focus { box-shadow: 0 0 0 2px var(--navy-900) !important; }
.cal-shell .e-schedule .e-timeline-view .e-appointment .e-appointment-details { padding: 4px 8px; }
.cal-shell .ev { display: flex; flex-direction: column; gap: 1px; color: #fff; overflow: hidden; }
.cal-shell .ev strong { font-weight: 700; font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-shell .ev span { font-size: .68rem; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-shell .e-appointment.is-pending {
    background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .22) 0 6px, transparent 6px 12px) !important;
}

/* quick info popup */
.e-quick-popup-wrapper {
    border: 0 !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden;
    font-family: var(--font) !important;
}
.e-quick-popup-wrapper .e-event-popup .e-popup-header,
.e-quick-popup-wrapper .e-cell-popup .e-popup-header { border-radius: 0 !important; }
.qi-head { padding: 16px 18px 14px; color: #fff; }
.qi-head.is-new { color: var(--ink); background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.qi-head .qi-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; }
.qi-head .qi-sub { font-size: .78rem; opacity: .85; margin-top: 2px; }
.qi-body { padding: 14px 18px 4px; }
.qi-body .kv { font-size: .82rem; }
.qi-actions { display: grid; gap: 8px; padding: 12px 18px 16px; }
.qi-actions.two { grid-template-columns: 1fr 1fr; }
.qi-quick {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
    text-align: left;
    transition: background-color .15s, border-color .15s;
}
.qi-quick:hover:not(:disabled) { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, #fff); }
.qi-quick:disabled { opacity: .5; }
.qi-quick i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.qi-quick small { margin-left: auto; color: var(--muted); font-weight: 500; }

/* editor */
.leave-editor { display: grid; gap: 14px; padding-top: 4px; }
.leave-editor .row-2 { display: grid; grid-template-columns: 1fr 140px; gap: 8px; }

/* Rota ------------------------------------------------------------------- */

.rota {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}
.rota-board { min-width: 0; }
.rota-board .e-schedule .e-timeline-view .e-resource-left-td { width: 190px; }
.rota-board .e-schedule .e-timeline-view .e-date-header-wrap table col,
.rota-board .e-schedule .e-timeline-view .e-content-wrap table col { width: 72px; }

.shift-slot { display: flex; flex-direction: column; align-items: center; font-size: .72rem; font-weight: 700; color: var(--ink); line-height: 1.15; }
.shift-slot small { font-size: .62rem; font-weight: 500; color: var(--faint); }
.shift-slot.early { color: #0b4a8b; }
.shift-slot.late { color: #5b21b6; }

.rota-board .e-appointment.rota-shift {
    border: 0 !important;
    border-left: 4px solid var(--shift-c) !important;
    border-radius: 8px !important;
    background: var(--shift-bg) !important;
    color: var(--ink) !important;
    box-shadow: none !important;
}
.rota-board .e-appointment.rota-shift.is-early { --shift-c: var(--leave-blue); --shift-bg: #e3effc; }
.rota-board .e-appointment.rota-shift.is-late { --shift-c: #7c3aed; --shift-bg: #efe7fd; }
.rota-board .e-appointment.rota-shift.rota-cover { outline: 1px dashed var(--shift-c); outline-offset: -1px; }
.rota-board .e-appointment.rota-leave {
    background: repeating-linear-gradient(-45deg, #fff4e0 0 6px, #ffecc7 6px 12px) !important;
    color: var(--amber-ink) !important;
    border: 1px solid #f5d9a3 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}
.shift-ev { display: flex; align-items: center; gap: 6px; height: 100%; line-height: 1.1; overflow: hidden; white-space: nowrap; }
.shift-ev strong { font-size: .7rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.shift-ev .avatar { font-size: .45rem; }
.rota-board .e-schedule .e-timeline-view .e-appointment.rota-shift .e-appointment-details,
.rota-board .e-schedule .e-timeline-view .e-appointment.rota-leave .e-appointment-details { padding: 3px 4px !important; }
.rota-board .shift-ev { gap: 4px; }
.shift-ev small { font-size: .64rem; color: var(--muted); }
.shift-ev.is-leave { color: var(--amber-ink); }
.shift-ev.is-leave > i { font-size: .85rem; }

/* department header rows */
.rota-board .e-schedule .e-timeline-view .e-resource-cells.e-parent-node,
.rota-board .e-schedule .e-timeline-view .e-work-cells.e-resource-group-cells { background: var(--bg-soft) !important; }
.rota-board .res-cell.res-dept { gap: 8px; padding-left: 10px; }
.rota-board .res-cell.res-dept strong { font-size: .8rem; color: var(--ink); white-space: nowrap; }
.rota-board .res-cell.res-dept small { margin-left: auto; font-size: .68rem; color: var(--muted); white-space: nowrap; }
.rota-board .res-cell.res-dept .swatch { width: 10px; height: 10px; }

.rota-staff {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(100vh - var(--topbar-h) - 32px);
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.rota-staff-head { display: flex; align-items: baseline; justify-content: space-between; }
.rota-staff-head h3 { font-size: 1rem; margin: 0; }
.rota-filters { display: flex; flex-wrap: wrap; gap: 5px; }
.rota-filters .chip { padding: 3px 9px; font-size: .72rem; cursor: pointer; }
.rota-filters .chip.on { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }

.rota-picked {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--green-tint);
    color: var(--green);
    font-size: .8rem;
}

.rota-list { list-style: none; margin: 0 -6px; padding: 0 6px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.rota-person {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px 9px 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: grab;
    user-select: none;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rota-person:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); transform: translateX(-2px); }
.rota-person:active { cursor: grabbing; }
.rota-person.picked { border-color: var(--green-bright); box-shadow: 0 0 0 3px rgba(70, 176, 101, .18); }
.rota-person .grip { color: var(--faint); font-size: 1rem; }
.rota-person strong { display: block; font-size: .84rem; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rota-person small { display: block; font-size: .72rem; color: var(--muted); }
.rota-person .pill { font-size: .6rem; padding: .1rem .45rem; }
.rota-load { text-align: right; line-height: 1.1; white-space: nowrap; }
.rota-load strong { font-size: .85rem; }
.rota-load small { font-size: .65rem; }

@media (max-width: 1199.98px) {
    .rota { grid-template-columns: 1fr; }
    .rota-staff { position: static; max-height: 420px; order: -1; }
}

@media print {
    .app-sidebar, .app-topbar, .app-footer, .page-head, .cal-bar { display: none !important; }
    .app-main { margin: 0 !important; }
}

/* Auth pages ------------------------------------------------------------- */

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
    background: #fff;
}

.auth-aside {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 56px;
    color: #c8d3e3;
    background:
        radial-gradient(60% 50% at 85% 10%, rgba(70, 176, 101, .28), transparent 70%),
        radial-gradient(50% 45% at 10% 95%, rgba(25, 118, 210, .3), transparent 70%),
        var(--navy-900);
}
.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    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: 44px 44px;
    mask-image: radial-gradient(80% 70% at 50% 50%, #000, transparent);
    pointer-events: none;
}
.auth-aside > * { position: relative; }
.auth-aside .brand img { height: 36px; width: auto; }
.auth-pitch h2 { color: #fff; font-size: clamp(1.6rem, 2.4vw, 2.3rem); line-height: 1.15; margin-bottom: 12px; max-width: 18ch; }
.auth-pitch p { max-width: 44ch; color: #9fb0c9; margin: 0; }
.auth-aside .req-card { max-width: 400px; margin: 36px 0 30px; animation: none; transform: rotate(-1.5deg); }
.auth-aside .req-card:hover { transform: rotate(0); }
.auth-aside .req-card .req-toast { position: absolute; left: 50%; bottom: -20px; transform: translateX(-50%); margin: 0; }
.auth-foot { display: flex; gap: 18px; font-size: .8rem; color: #6f809b; }
.auth-foot a { color: #9fb0c9; text-decoration: none; }
.auth-foot a:hover { color: #fff; }

.auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 24px;
}
.auth-panel { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-panel .mobile-brand { display: none; margin-bottom: 28px; }
.auth-panel .mobile-brand img { height: 32px; width: auto; }
.auth-panel h1 { font-size: 1.85rem; margin-bottom: 6px; }
.auth-panel .lead { color: var(--muted); font-size: 1rem; margin-bottom: 28px; }
.auth-panel .form-floating { margin-bottom: 14px; }
.auth-panel .btn-lg { width: 100%; margin-top: 6px; }
.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 4px 0 18px;
    font-size: .88rem;
}
.auth-row label { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--body); font-weight: 500; }
.auth-alt {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .9rem;
    text-align: center;
}
.auth-alt a { font-weight: 600; text-decoration: none; }
.auth-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: .82rem; }
.auth-links a { color: var(--muted); text-decoration: none; }
.auth-links a:hover { color: var(--ink); }

.auth-icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    border-radius: 18px;
    background: var(--green-tint);
    color: var(--green);
    font-size: 1.6rem;
}
.auth-icon.is-danger { background: var(--red-tint); color: var(--red-ink); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

@media (max-width: 991.98px) {
    .auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .auth-panel .mobile-brand { display: block; }
}
@media (max-width: 420px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* Departments */
.dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}
.dept-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: left;
    transition: box-shadow .2s, transform .2s;
}
.dept-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.dept-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.dept-actions { display: flex; gap: 2px; opacity: .55; transition: opacity .15s; }
.dept-card:hover .dept-actions { opacity: 1; }
.dept-actions .icon-btn { width: 34px; height: 34px; font-size: .95rem; }
.dept-card h3 { font-size: 1.05rem; margin: 0 0 14px; }
.dept-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; min-height: 28px; }
.dept-new {
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 150px;
    border: 1.5px dashed var(--line-strong);
    background: transparent;
    box-shadow: none;
    color: var(--muted);
    font-weight: 600;
}
.dept-new i { font-size: 1.4rem; }
.dept-new:hover { border-color: var(--green-bright); color: var(--green); background: var(--green-tint); }

/* Staff table helpers */
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-cell strong { display: block; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.person-cell small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.yes-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: .95rem; }
.yes-no.yes { background: var(--green-tint); color: var(--green); }
.yes-no.no { background: var(--bg-soft); color: var(--faint); }
.usage-chip { display: inline-flex; align-items: center; gap: 8px; }
.usage-chip .bar { width: 80px; height: 6px; }

/* Settings / misc --------------------------------------------------------- */

.settings-nav {
    position: sticky;
    top: calc(var(--topbar-h) + 20px);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.settings-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--body);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
}
.settings-nav a:hover { background: #fff; color: var(--ink); }
.settings-nav a i { color: var(--muted); }

.plan-card {
    position: relative;
    overflow: hidden;
    height: 100%;
    padding: 22px;
    border-radius: var(--radius-lg);
    color: #c8d3e3;
    background:
        radial-gradient(80% 100% at 100% 0%, rgba(70, 176, 101, .35), transparent 60%),
        var(--navy-900);
    box-shadow: var(--shadow);
}
.plan-card.is-card {
    background:
        radial-gradient(80% 100% at 0% 100%, rgba(25, 118, 210, .45), transparent 60%),
        linear-gradient(135deg, var(--navy-800), var(--navy-950));
}
.plan-card h2 { color: #fff; font-size: 1.6rem; margin: 10px 0 24px; letter-spacing: -.01em; }
.plan-card .plan-meta { display: flex; justify-content: space-between; gap: 12px; }
.plan-card .plan-meta strong { display: block; color: #fff; font-size: 1.02rem; }
.plan-card .plan-meta small { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: #9fb0c9; }
.plan-card .small-caps { color: #9fb0c9; }

.danger-zone { border-color: #f5c2c2; }
.danger-zone .card-header { background: #fff8f8; }

.big-thanks {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    margin: 8px auto 20px;
    border-radius: 26px;
    background: var(--green-tint);
    color: var(--green);
    font-size: 2.4rem;
}

.vh-75 { min-height: 60vh; }

/* Dashboard --------------------------------------------------------------- */

.dash-seg { margin: 0; background: #fff; border: 1px solid var(--line); }
.dash-seg button { flex: 0 0 auto; padding: 6px 12px; }
.dash-seg button.on { background: var(--navy-900); color: #fff; }
.dash-filter { width: auto; min-width: 180px; }

.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.kpi {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none;
    transition: box-shadow .15s, border-color .15s;
}
a.kpi:hover { color: inherit; border-color: var(--line-strong); box-shadow: var(--shadow); }
.kpi-head { display: flex; align-items: center; gap: 10px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.kpi-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--c, var(--green)) 12%, #fff);
    color: var(--c, var(--green));
    font-size: 1rem;
}
.kpi-value {
    font-family: var(--font-display);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
    letter-spacing: -.02em;
}
.kpi-value small { margin-left: 5px; font-size: .9rem; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: auto; font-size: .78rem; color: var(--muted); }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 99px; font-weight: 650; }
.kpi-delta.is-bad { background: var(--red-tint); color: var(--red-ink); }
.kpi-delta.is-good { background: var(--green-tint); color: var(--green); }
.kpi-delta.is-flat { background: var(--bg-soft); color: var(--muted); }

.stat-total { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.stat-total small { margin-left: 4px; font-size: .78rem; font-weight: 600; color: var(--muted); }

.dash-empty { padding: 32px 12px; text-align: center; color: var(--muted); font-size: .88rem; }
.dash-empty i { display: block; margin-bottom: 8px; font-size: 1.6rem; color: var(--line-strong); }
.list-more { padding: 10px 1.4rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 18px; font-size: .8rem; color: var(--body); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Column charts: hand-built so they share the app's tokens */
.trend { --gutter: 34px; }
.trend-plot { position: relative; height: 230px; margin-left: var(--gutter); border-bottom: 1px solid var(--line-strong); }
.trend-tick { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.trend-tick span {
    position: absolute;
    right: calc(100% + 8px);
    top: 0;
    transform: translateY(-50%);
    font-size: .7rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.trend-cols { position: absolute; inset: 0; display: flex; }
.trend-x { display: flex; margin-left: var(--gutter); padding-top: 8px; }
.trend-x span { flex: 1; text-align: center; font-size: .72rem; color: var(--muted); }
.trend-x span.is-current { color: var(--ink); font-weight: 700; }

.chart-col { position: relative; flex: 1; display: flex; justify-content: center; align-items: flex-end; }
.chart-col::before {
    content: "";
    position: absolute;
    inset: 0 2px;
    border-radius: 8px 8px 0 0;
    background: var(--bg-soft);
    opacity: 0;
    transition: opacity .15s;
}
.chart-col:hover::before { opacity: 1; }
.chart-stack {
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
    width: min(24px, 62%);
    border-radius: 4px 4px 0 0;
    overflow: hidden;
}
.chart-stack i { display: block; flex-basis: 0; min-height: 2px; background: var(--c); }
.chart-cap {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -4px);
    font-size: .72rem;
    font-weight: 650;
    color: var(--ink);
    white-space: nowrap;
}
.chart-tip {
    position: absolute;
    left: 50%;
    z-index: 5;
    min-width: 180px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--navy-900);
    color: #cbd5e1;
    font-size: .76rem;
    box-shadow: var(--shadow-lg);
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s;
}
.chart-col.tip-start .chart-tip { left: 0; transform: none; }
.chart-col.tip-end .chart-tip { left: auto; right: 0; transform: none; }
.chart-col:hover .chart-tip { opacity: 1; }
.chart-tip strong { display: block; margin-bottom: 6px; color: #fff; font-size: .8rem; }
.chart-tip div { display: flex; align-items: center; gap: 7px; line-height: 1.7; }
.chart-tip div span:last-child { margin-left: auto; padding-left: 14px; font-weight: 650; color: #fff; }
.chart-tip .total { margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .12); }
.chart-tip .swatch { box-shadow: 0 0 0 1px rgba(255, 255, 255, .3); }

.dow-plot { position: relative; display: flex; height: 160px; margin-top: 24px; border-bottom: 1px solid var(--line-strong); }
.dow-x { margin-left: 0; }
.dow-note { display: flex; gap: 8px; margin: 18px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg-soft); font-size: .82rem; color: var(--body); }
.dow-note i { color: var(--muted); }
.dow-note strong { color: var(--ink); }

/* Horizontal bars */
.hbars { display: grid; gap: 16px; }
.hbar-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .86rem; font-weight: 600; color: var(--ink); }
.hbar-top .val { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.hbar-top .val small { margin-left: 6px; font-weight: 500; color: var(--muted); }
.hbar-track { height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.hbar-track span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--c, var(--leave-blue)); }

/* Lists and tables */
.off-list { list-style: none; margin: 0; padding: 0; }
.off-list li { display: flex; align-items: center; gap: 12px; padding: 11px 1.4rem; border-bottom: 1px solid var(--line); }
.off-list li:last-child { border-bottom: 0; }
.off-list .who { flex: 1; min-width: 0; }
.off-list .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; font-weight: 600; color: var(--ink); }
.off-list .who span { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.off-list .days { min-width: 44px; text-align: right; white-space: nowrap; font-size: .72rem; color: var(--muted); }
.off-list .days strong { display: block; font-size: .95rem; color: var(--ink); }

.dash-table { margin: 0; font-size: .86rem; }
.dash-table th.num, .dash-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rate-cell { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.rate-cell .hbar-track { width: 80px; }
.rate-cell span:last-child { min-width: 42px; }

/* Leave allowance */
.allow-big { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 14px; }
.allow-big strong { font-family: var(--font-display); font-size: 2.2rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; color: var(--ink); }
.allow-big span { color: var(--muted); }
.allow-bar { gap: 2px; margin-bottom: 16px; }
.allow-kv dt { display: flex; align-items: center; gap: 8px; }
.allow-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.allow-row:last-child { border-bottom: 0; }
.allow-row .who { flex: 1; min-width: 0; }
.allow-row .who > div:first-child strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; font-weight: 600; color: var(--ink); }
.allow-row .left { margin-left: auto; white-space: nowrap; font-size: .78rem; color: var(--muted); }
.allow-row .left strong { color: var(--ink); }
.allow-track { position: relative; margin: 7px 0 4px; }
.allow-row-bar { height: 8px; margin: 0; }
.allow-track .marker { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--ink); }
.allow-key { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--muted); }
.allow-key i { width: 2px; height: 12px; border-radius: 1px; background: var(--ink); }
.allow-when { display: block; font-size: .74rem; color: var(--muted); }

@media (max-width: 575.98px) {
    .dash-seg { width: 100%; }
    .dash-seg button { flex: 1; padding: 6px 4px; }
    .dash-filter { width: 100%; }
    .trend-x span:nth-child(even) { visibility: hidden; }
    .rate-cell .hbar-track { display: none; }
}

.page-loader {
    display: grid;
    place-items: center;
    min-height: 55vh;
}
.page-loader .dots { display: flex; gap: 8px; }
.page-loader .dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
    animation: bounce 1s infinite ease-in-out;
}
.page-loader .dots span:nth-child(2) { animation-delay: .15s; background: var(--leave-blue); }
.page-loader .dots span:nth-child(3) { animation-delay: .3s; background: var(--leave-amber); }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(.6); opacity: .5; }
    40% { transform: scale(1); opacity: 1; }
}

.status-page { max-width: 520px; margin: 8vh auto; text-align: center; }
.status-page .auth-icon { margin: 0 auto 20px; }

/* Syncfusion re-skin ------------------------------------------------------ */

.e-control, .e-css, .e-grid, .e-btn, .e-input-group, .e-dialog, .e-schedule, .e-tab, .e-toolbar {
    font-family: var(--font) !important;
}

.e-btn {
    border-radius: 10px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    box-shadow: none !important;
}
.e-btn.e-flat { border-radius: 8px !important; }

/* inputs */
.e-input-group:not(.e-float-icon-left):not(.e-float-input),
.e-input-group.e-control-wrapper:not(.e-float-icon-left):not(.e-float-input),
.e-float-input.e-input-group, .e-float-input.e-control-wrapper.e-input-group {
    border-radius: 10px !important;
    border-color: var(--line-strong) !important;
}
.e-input-group.e-input-focus:not(.e-success):not(.e-warning):not(.e-error),
.e-input-group.e-control-wrapper.e-input-focus:not(.e-success):not(.e-warning):not(.e-error) {
    border-color: var(--green-bright) !important;
    box-shadow: 0 0 0 4px rgba(70, 176, 101, .18) !important;
}
.e-input-group input.e-input, .e-input-group.e-control-wrapper input.e-input { min-height: 40px !important; }
.e-input-group textarea.e-input, .e-input-group.e-control-wrapper textarea.e-input { padding: 8px 12px !important; }

/* dialogs */
.e-dialog {
    border: 0 !important;
    border-radius: 20px !important;
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden;
}
.e-dialog .e-dlg-header-content {
    padding: 18px 22px !important;
    border-bottom: 1px solid var(--line) !important;
    background: #fff !important;
}
.e-dialog .e-dlg-header, .e-dialog .e-dlg-header * {
    font-family: var(--font-display) !important;
    font-size: 1.1rem !important;
    font-weight: 650 !important;
    color: var(--ink) !important;
}
.e-dialog .e-dlg-content { padding: 20px 22px !important; color: var(--body) !important; font-size: .93rem !important; }
.e-dialog .e-footer-content {
    padding: 14px 22px !important;
    border-top: 1px solid var(--line) !important;
    background: var(--bg-soft) !important;
}
.e-dialog .e-footer-content .e-btn { min-width: 96px; }
.e-dlg-overlay { background: var(--navy-950) !important; opacity: .45 !important; }
.e-dialog .modal-footer { padding: 14px 0 0; border: 0; }

/* confirm buttons coloured through the page's BtnClass */
.e-dialog .e-footer-content .e-btn.bg-success,
.e-dialog .e-footer-content .e-btn.btn-success { background: var(--green) !important; border-color: var(--green) !important; color: #fff !important; }
.e-dialog .e-footer-content .e-btn.bg-danger,
.e-dialog .e-footer-content .e-btn.btn-danger { background: #dc2626 !important; border-color: #dc2626 !important; color: #fff !important; }

/* grids */
.e-grid {
    border: 0 !important;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: .88rem !important;
}
.card-body .e-grid { border: 1px solid var(--line) !important; border-radius: 12px; overflow: hidden; }
.e-grid .e-gridheader { border-color: var(--line) !important; }
.e-grid .e-gridheader,
.e-grid .e-headercell,
.e-grid .e-detailheadercell,
.e-grid .e-grouptopleftcell { background: var(--bg-soft) !important; }
.e-grid .e-headercell .e-headercelldiv,
.e-grid .e-headercell .e-headertext {
    font-size: .72rem !important;
    font-weight: 700 !important;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted) !important;
}
.e-grid .e-rowcell {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
    color: var(--body) !important;
    border-color: var(--line) !important;
}
.e-grid .e-row:hover .e-rowcell { background: #f8fafc !important; }
.e-grid .e-content { background: #fff; }
.e-grid .e-gridpager, .e-pager {
    border-color: var(--line) !important;
    background: #fff !important;
    font-size: .82rem !important;
}
.e-pager .e-currentitem, .e-pager .e-currentitem:hover {
    background: var(--green) !important;
    color: #fff !important;
    border-radius: 8px !important;
}
.e-pager .e-numericitem { border-radius: 8px !important; }
.e-grid .e-toolbar, .e-grid .e-toolbar .e-toolbar-items {
    background: #fff !important;
    border: 0 !important;
}
.e-grid .e-toolbar { border-bottom: 1px solid var(--line) !important; padding: 4px 6px; }
.e-grid .e-toolbar .e-search { border-radius: 10px !important; }
.e-grid .e-unboundcelldiv .e-btn.e-flat { color: var(--muted) !important; }
.e-grid .e-unboundcelldiv .e-btn.e-flat:hover { background: var(--bg-soft) !important; color: var(--ink) !important; }
.e-grid .e-emptyrow td { color: var(--muted); padding: 32px !important; text-align: center; }

/* tabs, accordion, lists */
.e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text,
.e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-icon { color: var(--green) !important; }
.e-tab .e-tab-header .e-indicator { background: var(--green) !important; }
.e-accordion { border-radius: 12px !important; overflow: hidden; border-color: var(--line) !important; }

/* stepper */
.e-stepper .e-step-selected .e-step, .e-stepper .e-step-completed .e-step { background: var(--green) !important; border-color: var(--green) !important; }
.e-stepper .e-stepper-progressbar > .e-progressbar-value { background: var(--green) !important; }

/* messages */
.e-message { border-radius: 12px !important; border: 0 !important; }

/* date picker popup */
.e-datepicker.e-popup-wrapper, .e-popup.e-ddl { border-radius: 14px !important; box-shadow: var(--shadow-lg) !important; border: 1px solid var(--line) !important; overflow: hidden; }
.e-calendar .e-content td.e-selected span.e-day { background: var(--green) !important; color: #fff !important; }
.e-calendar .e-content td.e-today span.e-day { border-color: var(--green) !important; color: var(--green); }
.e-calendar .e-content td.e-today.e-selected span.e-day { color: #fff; }
.e-calendar { font-family: var(--font) !important; }

/* Toastr, restyled like the mexus.io toast pill --------------------------- */

#toast-container > div {
    width: 340px;
    padding: 14px 16px 14px 50px;
    border-radius: 14px;
    background-color: var(--navy-900);
    background-position: 16px center;
    box-shadow: var(--shadow-lg);
    opacity: 1;
    font-family: var(--font);
    font-size: .88rem;
}
#toast-container > div:hover { box-shadow: var(--shadow-lg); }
#toast-container > .toast-success { background-color: var(--navy-900); }
#toast-container > .toast-error { background-color: #7f1d1d; }
#toast-container .toast-title { font-weight: 700; margin-bottom: 2px; }
#toast-container .toast-progress { background: var(--green-bright); opacity: .9; height: 3px; }
#toast-container > .toast-error .toast-progress { background: #fca5a5; }
.toast-top-right { top: calc(var(--topbar-h) + 12px); right: 16px; }

/* Blazor plumbing ---------------------------------------------------------- */

#blazor-error-ui {
    color-scheme: light only;
    display: none;
    position: fixed;
    left: 50%;
    bottom: 16px;
    z-index: 2000;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 32px));
    padding: 12px 44px 12px 18px;
    border-radius: 14px;
    background: var(--navy-900);
    color: #fff;
    box-shadow: var(--shadow-lg);
    font-size: .9rem;
}
#blazor-error-ui a { color: var(--green-bright); }
#blazor-error-ui .dismiss { position: absolute; right: 14px; top: 10px; cursor: pointer; }

.blazor-error-boundary {
    padding: 1rem 1rem 1rem 1.2rem;
    border-radius: 12px;
    background: var(--red-tint);
    color: var(--red-ink);
}
.blazor-error-boundary::after { content: "An error has occurred."; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
