/* ---- Typeface: Manrope (Latin) + Tajawal (Arabic), self-hosted --------------
   Both are SIL Open Font License. The font files live in public/vendor/fonts. */
@font-face {
    font-family: 'Manrope';
    src: url('/vendor/fonts/manrope/Manrope-latin-ext.woff2') format('woff2');
    font-weight: 200 800;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Manrope';
    src: url('/vendor/fonts/manrope/Manrope-latin.woff2') format('woff2');
    font-weight: 200 800;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Tajawal';
    src: url('/vendor/fonts/tajawal/Tajawal-400-arabic.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Tajawal';
    src: url('/vendor/fonts/tajawal/Tajawal-500-arabic.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Tajawal';
    src: url('/vendor/fonts/tajawal/Tajawal-700-arabic.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Tajawal';
    src: url('/vendor/fonts/tajawal/Tajawal-800-arabic.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root[data-new-look] { --bs-font-sans-serif: 'Manrope', 'Tajawal', 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, sans-serif; }
:root[data-new-look][dir="rtl"] { --bs-font-sans-serif: 'Tajawal', 'Manrope', 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif; }
:root[data-new-look] { --font-num: var(--bs-font-sans-serif); }
:root[data-new-look] .font-mono,
:root[data-new-look] .text-mono,
:root[data-new-look] code,
:root[data-new-look] kbd,
:root[data-new-look] samp {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}
:root[data-new-look] body { font-feature-settings: 'cv11' 1; -webkit-font-smoothing: antialiased; }

/*
 * "Modern" look for ordinary pages (cards, forms, tables, buttons, badges).
 * Opt-in: everything is scoped under `.ui-modern`, which a page adds around
 * its content when the new look is switched on, so no other page changes.
 * Colours come only from the existing theme tokens (brand, surface, ink,
 * status), so every palette, dark mode and Arabic (RTL) keep working.
 */

.ui-modern {
    --ui-radius: 16px;
    --ui-radius-sm: 12px;
    --ui-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
    max-width: 1680px;
    margin-inline: auto;
}
:root[data-bs-theme="dark"] .ui-modern {
    --ui-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

.ui-demo-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-block-end: 1rem;
    padding: 0.5rem 0.9rem;
    border: 1px dashed var(--border-subtle);
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--ink-secondary);
}
.ui-demo-note a { font-weight: 600; }
.ui-page-sub { margin: 0.15rem 0 0; font-size: 0.8125rem; color: var(--ink-secondary); }

/* ---- Cards ------------------------------------------------------------ */
.ui-modern .card {
    border: 1px solid var(--border-subtle);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
    overflow: hidden;
}

/* ---- Forms ------------------------------------------------------------ */
.ui-modern .form-label { font-weight: 600; color: var(--ink-primary); }
.ui-modern .form-control,
.ui-modern .form-select {
    min-height: 2.75rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--ui-radius-sm);
    background-color: var(--surface-card);
    font-size: 0.9rem;
}
.ui-modern .form-control:focus,
.ui-modern .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 16%, transparent);
}
.ui-modern .form-control.is-invalid,
.ui-modern .form-select.is-invalid { border-color: var(--status-danger); }
.ui-modern .form-control.is-invalid:focus,
.ui-modern .form-select.is-invalid:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--status-danger) 16%, transparent); }

/* ---- Buttons ---------------------------------------------------------- */
.ui-modern .btn {
    --bs-btn-border-radius: var(--ui-radius-sm);
    --bs-btn-font-weight: 600;
    --bs-btn-font-size: 0.875rem;
    --bs-btn-padding-x: 1.1rem;
    --bs-btn-padding-y: 0.55rem;
    box-shadow: none;
}
.ui-modern .btn-sm {
    --bs-btn-padding-x: 0.8rem;
    --bs-btn-padding-y: 0.35rem;
    --bs-btn-font-size: 0.8125rem;
}
.ui-modern .btn:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.ui-modern .btn-outline-primary,
.ui-modern .btn-outline-secondary {
    --bs-btn-border-color: var(--border-subtle);
    --bs-btn-color: var(--ink-primary);
    --bs-btn-bg: var(--surface-card);
    --bs-btn-hover-bg: color-mix(in srgb, var(--brand-primary) 8%, var(--surface-card));
    --bs-btn-hover-color: var(--brand-primary);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border-subtle));
}

/* ---- Tables ----------------------------------------------------------- */
.ui-modern .table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}
.ui-modern .table > thead > tr > th {
    padding: 0.85rem 1rem;
    background: color-mix(in srgb, var(--ink-secondary) 8%, var(--surface-card));
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-secondary);
    white-space: nowrap;
}
.ui-modern .table > thead > tr > th a { color: inherit; }
.ui-modern .table > thead > tr > th a:hover { color: var(--brand-primary); }
.ui-modern .table > tbody > tr > td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.875rem;
}
.ui-modern .table > tbody > tr:last-child > td { border-bottom: 0; }
.ui-modern .table-hover > tbody > tr:hover > td {
    background: color-mix(in srgb, var(--brand-primary) 5%, var(--surface-card));
}

/* ---- Status badges become soft uppercase pills ------------------------ */
.ui-modern .badge {
    padding: 0.35em 0.7em;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.ui-modern .badge.text-bg-success   { color: var(--status-success) !important; background-color: color-mix(in srgb, var(--status-success) 14%, var(--surface-card)) !important; }
.ui-modern .badge.text-bg-warning   { color: var(--status-warning) !important; background-color: color-mix(in srgb, var(--status-warning) 16%, var(--surface-card)) !important; }
.ui-modern .badge.text-bg-danger    { color: var(--status-danger) !important;  background-color: color-mix(in srgb, var(--status-danger) 14%, var(--surface-card)) !important; }
.ui-modern .badge.text-bg-info      { color: var(--status-info) !important;    background-color: color-mix(in srgb, var(--status-info) 14%, var(--surface-card)) !important; }
.ui-modern .badge.text-bg-secondary,
.ui-modern .badge.text-bg-primary   { color: var(--ink-secondary) !important;  background-color: color-mix(in srgb, var(--ink-secondary) 13%, var(--surface-card)) !important; }

/* ---- Employee picture next to the name -------------------------------- */
.ui-modern .employee-avatar-sm,
.ui-modern .employee-avatar-sm-initials {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.82rem;
    box-shadow: 0 0 0 2px var(--surface-card), 0 0 0 3px var(--border-subtle);
}

/* ---- Pagination ------------------------------------------------------- */
.ui-modern .pagination { gap: 0.3rem; }
.ui-modern .page-link {
    border: 1px solid var(--border-subtle);
    border-radius: 10px !important;
    color: var(--ink-primary);
    min-width: 2.25rem;
    text-align: center;
}
.ui-modern .page-item.active .page-link {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

.ui-modern .empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--ink-secondary); }
.ui-modern .alert { border-radius: var(--ui-radius-sm); }

.ui-modern .table td.text-end { white-space: nowrap; }
.ui-modern .table td.text-end .btn + .btn { margin-inline-start: 0.35rem; }

/* ---- Forms made of section cards -------------------------------------- */
.ui-modern .card-title {
    margin-block-end: 1.1rem;
    padding-block-end: 0.8rem;
    border-block-end: 1px solid var(--border-subtle);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-primary);
}
.ui-modern .card-body { padding: 1.4rem 1.5rem; }
.ui-modern .form-text { font-size: 0.78rem; color: var(--ink-secondary); }
.ui-modern .invalid-feedback { font-size: 0.8rem; }
.ui-modern textarea.form-control { min-height: 5.5rem; }
.ui-modern input[type="file"].form-control { padding-block: 0.6rem; }

/* Save / Cancel stay in view at the bottom of long forms */
.ui-modern form > .d-flex.gap-2:last-child {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 0.5rem;
    padding: 0.9rem 1.1rem;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow);
}

/* ---- Employee profile (show page) ------------------------------------- */
.ui-modern .ui-profile .employee-avatar-lg {
    box-shadow: 0 0 0 3px var(--surface-card), 0 0 0 5px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}
.ui-modern .ui-profile > .card.stat-card {
    border-block-start: 4px solid var(--brand-primary);
}
.ui-modern .ui-profile dl.row {
    row-gap: 0;
}
.ui-modern .ui-profile dl.row > dt,
.ui-modern .ui-profile dl.row > dd {
    margin: 0;
    padding-block: 0.6rem;
    border-block-end: 1px solid var(--border-subtle);
}
.ui-modern .ui-profile dl.row > dt {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-secondary);
}
.ui-modern .ui-profile dl.row > dd:last-of-type {
    border-block-end: 0;
}
.ui-modern .ui-profile dl.row > dt:nth-last-of-type(1) {
    border-block-end: 0;
}
@media (max-width: 575.98px) {
    .ui-modern .ui-profile dl.row > dt { border-block-end: 0; padding-block-end: 0; }
}

/* ---- Profile header as a shaded hero (same family as the dashboard hero) -- */
.ui-modern .ui-profile > .card.stat-card {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    background:
        radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--brand-accent) 30%, transparent) 0%, transparent 55%),
        linear-gradient(135deg, var(--brand-primary-darker), color-mix(in srgb, var(--brand-primary) 72%, var(--brand-primary-darker)));
    color: #fff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
}
.ui-modern .ui-profile > .card.stat-card::before,
.ui-modern .ui-profile > .card.stat-card::after { display: none; }
.ui-modern .ui-profile > .card.stat-card .card-body { padding: 1.75rem 2rem; }
.ui-modern .ui-profile > .card.stat-card h1,
.ui-modern .ui-profile > .card.stat-card .font-mono { color: #fff; }
.ui-modern .ui-profile > .card.stat-card .text-secondary { color: rgba(255, 255, 255, 0.78) !important; }
.ui-modern .ui-profile > .card.stat-card .employee-avatar-lg {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28);
}
.ui-modern .ui-profile > .card.stat-card .employee-avatar-lg-initials {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}
.ui-modern .ui-profile > .card.stat-card .badge {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.ui-modern .ui-profile > .card.stat-card .btn-outline-secondary,
.ui-modern .ui-profile > .card.stat-card .btn-outline-danger {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
    background: transparent;
}
.ui-modern .ui-profile > .card.stat-card .btn-outline-secondary:hover,
.ui-modern .ui-profile > .card.stat-card .btn-outline-danger:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}
.ui-modern .ui-profile > .card.stat-card details .card { color: var(--ink-primary); }

/* ---- Section cards: a soft tinted band behind each heading ---------------- */
.ui-modern .ui-profile .row > [class*="col-"] > .card {
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}
.ui-modern .ui-profile .row > [class*="col-"] > .card > .card-body { padding-block-start: 0; }
.ui-modern .ui-profile .row > [class*="col-"] > .card .card-title {
    margin: 0 -1.25rem 0.5rem;
    padding: 0.85rem 1.25rem;
    border-block-end: 0;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--brand-primary) 14%, var(--surface-card)),
        color-mix(in srgb, var(--brand-primary) 3%, var(--surface-card)));
    color: var(--brand-primary);
}
:root[data-bs-theme="dark"] .ui-modern .ui-profile .row > [class*="col-"] > .card .card-title { color: var(--ink-primary); }

/* ---- Leave calendar ------------------------------------------------------ */
.ui-modern .nav-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-primary) 8%, var(--surface-card));
}
.ui-modern .nav-tabs .nav-link {
    border: 0;
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-secondary);
}
.ui-modern .nav-tabs .nav-link.active {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}
.ui-modern .btn-group-sm > .btn-outline-secondary {
    border-color: var(--border-subtle);
    background: var(--surface-card);
    color: var(--ink-primary);
}
.ui-modern .btn-group-sm > .btn-outline-secondary.disabled {
    background: color-mix(in srgb, var(--brand-primary) 10%, var(--surface-card));
    color: var(--brand-primary);
    opacity: 1;
    font-weight: 600;
}
.ui-modern .btn-group > .btn:first-child { border-start-start-radius: 999px; border-end-start-radius: 999px; }
.ui-modern .btn-group > .btn:last-child { border-start-end-radius: 999px; border-end-end-radius: 999px; }

/* Legend as a soft chip strip */
.ui-modern [role="note"].d-flex {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--surface-card);
}

/* Timeline */
.ui-modern .leave-timeline { border-radius: 16px; }
.ui-modern .leave-timeline-header {
    background:
        linear-gradient(135deg, var(--brand-primary-darker), color-mix(in srgb, var(--brand-primary) 75%, var(--brand-primary-darker)));
    color: rgba(255, 255, 255, 0.85);
    border-bottom: 0;
}
.ui-modern .leave-timeline-header .leave-timeline-employee,
.ui-modern .leave-timeline-header .leave-timeline-day {
    background: transparent;
    color: inherit;
    border-color: rgba(255, 255, 255, 0.12);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ui-modern .leave-timeline-header .leave-timeline-day.is-weekend { background: rgba(255, 255, 255, 0.08); }
.ui-modern .leave-timeline-header .leave-timeline-day.is-holiday {
    background: color-mix(in srgb, var(--brand-accent) 55%, transparent);
    color: #fff;
}
.ui-modern .leave-timeline-row:not(.leave-timeline-header):nth-child(even) .leave-timeline-employee,
.ui-modern .leave-timeline-row:not(.leave-timeline-header):nth-child(even) {
    background-color: color-mix(in srgb, var(--brand-primary) 3%, var(--surface-card));
}
.ui-modern .leave-timeline-row { border-bottom-color: color-mix(in srgb, var(--border-subtle) 70%, transparent); }
.ui-modern .leave-timeline-day-cell { border-inline-start-color: color-mix(in srgb, var(--border-subtle) 55%, transparent); }
.ui-modern .leave-timeline-day-cell.is-weekend {
    background-color: color-mix(in srgb, var(--brand-primary) 6%, var(--surface-card));
}
.ui-modern .leave-bar {
    margin-block: 0.3rem;
    border-radius: 999px;
    padding-inline: 0.7rem;
    background-image: linear-gradient(180deg,
        color-mix(in srgb, var(--leave-color) 82%, #fff),
        var(--leave-color));
    box-shadow: 0 2px 6px color-mix(in srgb, var(--leave-color) 40%, transparent);
}
.ui-modern .leave-bar.is-pending {
    background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255, 255, 255, 0.4) 5px 10px);
}

/* Month grid */
.ui-modern .leave-month-grid { border-radius: 16px; overflow: hidden; }
.ui-modern .leave-month-weekday {
    background: linear-gradient(135deg, var(--brand-primary-darker), color-mix(in srgb, var(--brand-primary) 75%, var(--brand-primary-darker)));
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
}
.ui-modern .leave-month-entry { border-radius: 999px; }
.ui-modern .leave-month-cell.is-today .leave-month-daynum {
    background: var(--brand-accent);
    color: #fff;
}

/* Wide content (the timeline) scrolls inside its card instead of stretching the page. */
.ui-modern { min-width: 0; }
.ui-modern .card-body { min-width: 0; }
.ui-modern .tab-content, .ui-modern .tab-pane { min-width: 0; max-width: 100%; }
.app-content.ui-modern { width: 100%; }

/* ---- Detail-page hero (add class `page-hero` to a title + actions row) ---- */
.ui-modern .page-hero,
.app-content.ui-modern > .d-flex.justify-content-between:has(> * > h1),
.app-content.ui-modern > .d-flex.justify-content-between:has(> h1),
.app-content.ui-modern > h1 {
    position: relative;
    padding: 1.4rem 1.75rem;
    border-radius: 16px;
    background:
        radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--brand-accent) 30%, transparent) 0%, transparent 55%),
        linear-gradient(135deg, var(--brand-primary-darker), color-mix(in srgb, var(--brand-primary) 72%, var(--brand-primary-darker)));
    color: #fff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
}
.ui-modern .page-hero h1,
.app-content.ui-modern > .d-flex:has(h1) h1,
.app-content.ui-modern > h1 { color: #fff; font-weight: 600; }
.app-content.ui-modern > .d-flex:has(h1) .text-secondary,
.app-content.ui-modern > .d-flex:has(h1) .text-muted { color: rgba(255, 255, 255, 0.78) !important; }
.ui-modern .page-hero .btn-primary,
.app-content.ui-modern > .d-flex:has(h1) > .btn-primary,
.app-content.ui-modern > .d-flex:has(h1) .btn-primary { background: #fff; border-color: #fff; color: var(--brand-primary-darker); }
.app-content.ui-modern > .d-flex:has(h1) .btn-outline-secondary:not(.disabled),
.app-content.ui-modern > .d-flex:has(h1) .btn-outline-danger { color: #fff; border-color: rgba(255, 255, 255, 0.45); background: transparent; }
.ui-modern .page-hero .badge {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.ui-modern .page-hero .leave-legend-swatch {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}
.ui-modern .page-hero .btn-outline-secondary,
.ui-modern .page-hero .btn-outline-danger {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
    background: transparent;
}
.ui-modern .page-hero .btn-outline-secondary:hover,
.ui-modern .page-hero .btn-outline-danger:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* ---- Every titled card gets the soft tinted heading band ------------------ */
.ui-modern .card { overflow: hidden; }
.ui-modern .card-body > .card-title:first-child {
    margin: -1.4rem -1.5rem 0.85rem;
    padding: 0.85rem 1.5rem;
    border-block-end: 0;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--brand-primary) 14%, var(--surface-card)),
        color-mix(in srgb, var(--brand-primary) 3%, var(--surface-card)));
    color: var(--brand-primary);
}
:root[data-bs-theme="dark"] .ui-modern .card-body > .card-title:first-child { color: var(--ink-primary); }
:root[data-bs-theme="dark"] .ui-modern .btn-group-sm > .btn-outline-secondary.disabled { color: var(--ink-primary); }

/* ---- Sign-in and other signed-out pages ---------------------------------- */
body.auth-new { background: var(--surface-bg); }
body.auth-new .auth-split-form {
    background:
        radial-gradient(90% 60% at 0% 0%, color-mix(in srgb, var(--brand-primary) 10%, transparent), transparent 70%),
        var(--surface-bg);
}
body.auth-new .auth-split-form-inner {
    max-width: 28rem;
    padding: 2rem 2rem 1.75rem;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 16px 40px rgba(16, 24, 40, 0.08);
}
body.auth-new .auth-split-form-inner h1 { font-weight: 600; }
body.auth-new .auth-split-form-inner .btn-primary { min-height: 44px; padding-inline: 1.5rem; font-weight: 600; }
body.auth-new .auth-split-brand {
    background:
        radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--brand-accent) 38%, transparent) 0%, transparent 60%),
        linear-gradient(155deg, color-mix(in srgb, var(--brand-primary) 80%, var(--brand-primary-darker)) 0%, var(--brand-primary-darker) 100%);
}
body.auth-new .auth-split-brand::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    height: 6px;
    background-image: var(--sadu-card-top-tile);
    background-repeat: repeat-x;
    background-size: 18px 6px;
    opacity: 0.7;
}
body.auth-new .auth-split-brand-mark {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
body.auth-new .auth-split-brand h1 { font-size: 2.1rem; font-weight: 600; }
body.auth-new .auth-split-brand p { font-size: 1.05rem; }
body.auth-new .btn-group .btn { border-radius: 999px; }
body.auth-new .btn-group .btn:first-child { border-start-end-radius: 0; border-end-end-radius: 0; }
body.auth-new .btn-group .btn:last-child { border-start-start-radius: 0; border-end-start-radius: 0; }
/* Single-card signed-out pages (forgot password, two-factor ...) */
body.auth-new > .min-vh-100 { background: radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--brand-primary) 12%, transparent), transparent 70%); }
body.auth-new .card { border-radius: 20px; box-shadow: 0 16px 40px rgba(16, 24, 40, 0.1) !important; }

/* ---- Sign-in, second pass: dark brand panel on one side, clean form on the other ----
   Colours are local variables so the sign-in palette can be swapped in one place. */
body.auth-new {
    --auth-panel: #1b2038;
    --auth-glow: #1f9d6a;
    --auth-gold: #1f9d6a;
    --auth-action: #131a2e;
    --auth-link: #1f9d6a;
}
body.auth-new .auth-split--new .auth-split-brand {
    flex: 1 1 50%;
    justify-content: flex-end;
    padding: 3rem 3rem 3.25rem;
    background:
        radial-gradient(70% 55% at 0% 0%, color-mix(in srgb, var(--auth-glow) 55%, transparent) 0%, transparent 70%),
        var(--auth-panel);
}
body.auth-new .auth-split--new .auth-split-brand::before,
body.auth-new .auth-split--new .auth-split-brand::after { display: none; }
body.auth-new .auth-brand-lockup { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 2rem; }
body.auth-new .auth-split--new .auth-split-brand-mark {
    width: 1.9rem; height: 1.9rem; margin: 0; border-radius: 8px; font-size: 0.95rem;
    background: var(--auth-gold); color: #fff; box-shadow: none;
}
body.auth-new .auth-brand-name { font-weight: 600; font-size: 1.05rem; color: #fff; }
body.auth-new .auth-split--new .auth-split-brand h1 { font-size: 2.6rem; line-height: 1.12; font-weight: 500; margin-bottom: 1.1rem; }
body.auth-new .auth-split--new .auth-split-brand p { font-size: 0.95rem; max-width: 30rem; color: rgba(255, 255, 255, 0.72); }
body.auth-new .auth-split--new .auth-split-brand-content { max-width: 34rem; }

body.auth-new .auth-split--new .auth-split-form {
    flex-direction: column;
    justify-content: center;
    background: var(--surface-card);
    position: relative;
}
body.auth-new .auth-split--new .auth-split-form-inner {
    max-width: 30rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
body.auth-new .auth-heading { font-size: 1.6rem; font-weight: 600; text-align: center; margin-bottom: 2rem; }
body.auth-new .auth-req { color: #d63b3b; }
body.auth-new .auth-split--new .form-control { min-height: 50px; border-radius: 12px; }
body.auth-new .auth-split--new .form-control:focus {
    border-color: var(--auth-link);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-link) 18%, transparent);
}
body.auth-new .auth-password { position: relative; }
body.auth-new .auth-password .form-control { padding-inline-end: 3rem; }
body.auth-new .auth-password-toggle {
    position: absolute; inset-block: 0; inset-inline-end: 0.35rem;
    width: 2.6rem; border: 0; background: transparent; color: var(--ink-secondary); cursor: pointer;
}
body.auth-new .auth-password-toggle:hover { color: var(--ink-primary); }
body.auth-new .auth-split--new a { color: var(--auth-link); text-decoration: none; }
body.auth-new .auth-split--new .form-check-input:checked { background-color: var(--auth-link); border-color: var(--auth-link); }
body.auth-new .auth-submit {
    min-height: 52px; border-radius: 12px; font-weight: 600;
    background: var(--auth-action); border-color: var(--auth-action); color: #fff;
}
body.auth-new .auth-submit:hover { background: color-mix(in srgb, var(--auth-action) 85%, #fff); border-color: transparent; }
body.auth-new .auth-note { margin: 1.1rem 0 0; text-align: center; font-size: 0.8rem; color: var(--ink-secondary); }
body.auth-new .auth-powered {
    margin: 0; text-align: center; font-size: 0.75rem; letter-spacing: 0.04em; color: var(--ink-secondary);
}
body.auth-new .auth-split--new .auth-powered { position: absolute; inset-inline: 0; inset-block-end: 1.5rem; }
body.auth-new .auth-split--new .btn-group .btn-primary { background: var(--auth-action); border-color: var(--auth-action); color: #fff; }
body.auth-new .auth-split--new .btn-group .btn-outline-primary { color: var(--auth-action); border-color: var(--border-subtle); }
@media (max-width: 767.98px) {
    body.auth-new .auth-split--new .auth-split-brand { display: none; }
}
body.auth-new .auth-split--new .btn-group .btn { padding: 0.3rem 0.85rem; font-size: 0.8125rem; line-height: 1.4; }
body.auth-new .auth-split--new .btn-group { height: 28px; }
body.auth-new .auth-split--new .btn-group .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    min-width: 2.4rem;
    padding: 0 0.7rem;
    font-size: 0.75rem;
    line-height: 1;
    letter-spacing: 0.04em;
}
body.auth-new .auth-split--new .btn-group .btn { min-height: 0; box-sizing: border-box; }
body.auth-new .auth-split--new .btn-group { border-radius: 999px; overflow: hidden; }
.app-content.ui-modern > .d-flex:has(h1) .ui-page-sub { color: rgba(255, 255, 255, 0.78); }

/* ---- Report cards and other "stat" cards: drop the old Sadu strip ---------- */
.ui-modern .stat-card::before,
.ui-modern .stat-card::after { display: none; }
.ui-modern .stat-card {
    border: 1px solid var(--border-subtle);
    border-inline-start: 4px solid var(--brand-primary);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.ui-modern .stat-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border-subtle));
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.1);
}
.ui-modern .stat-card .btn-primary.btn-sm {
    background: color-mix(in srgb, var(--brand-primary) 11%, var(--surface-card));
    border-color: transparent;
    color: var(--brand-primary);
    font-weight: 600;
}
.ui-modern .stat-card .btn-primary.btn-sm:hover {
    background: var(--brand-primary);
    color: #fff;
}
:root[data-bs-theme="dark"] .ui-modern .stat-card .btn-primary.btn-sm { color: var(--ink-primary); }
.ui-modern .card.bg-body-secondary.opacity-75 {
    border: 1px dashed var(--border-subtle);
    box-shadow: none;
    background: transparent !important;
}
/* Section labels such as the report categories */
.ui-modern h2.h6.text-uppercase {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--ink-secondary) !important;
}
.ui-modern h2.h6.text-uppercase::before {
    content: "";
    width: 0.9rem;
    height: 4px;
    border-radius: 999px;
    background: var(--brand-accent);
}

/* ---- Drop-down section headers (reports categories, permission groups) ------ */
.ui-acc-list { display: grid; gap: 0.75rem; }
.ui-acc {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
.ui-acc[open] { box-shadow: 0 8px 24px rgba(16, 24, 40, 0.07); }
.ui-acc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--brand-primary) 13%, var(--surface-card)),
        color-mix(in srgb, var(--brand-primary) 3%, var(--surface-card)));
    border-inline-start: 4px solid var(--brand-accent);
}
.ui-acc-head::-webkit-details-marker { display: none; }
.ui-acc-head:hover { background: linear-gradient(90deg,
        color-mix(in srgb, var(--brand-primary) 19%, var(--surface-card)),
        color-mix(in srgb, var(--brand-primary) 6%, var(--surface-card))); }
.ui-acc-head:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
.ui-acc-title {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--brand-primary);
}
:root[data-bs-theme="dark"] .ui-acc-title { color: var(--ink-primary); }
.ui-acc-meta { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--ink-secondary); }
.ui-acc-count {
    min-width: 2.25rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink-secondary) 12%, var(--surface-card));
    font-family: var(--font-num, 'IBM Plex Mono', monospace); font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}
.ui-acc.has-selection .ui-acc-count {
    background: color-mix(in srgb, var(--brand-primary) 15%, var(--surface-card));
    color: var(--brand-primary);
}
.ui-acc-caret { transition: transform 0.2s; }
.ui-acc[open] .ui-acc-caret { transform: rotate(180deg); }
.ui-acc-body { padding: 1.1rem 1.25rem 1.25rem; border-block-start: 1px solid var(--border-subtle); }
@media (prefers-reduced-motion: reduce) { .ui-acc-caret { transition: none; } }

/* ---- Summary strip, money, components (Payroll) ------------------------------ */
.ui-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}
.ui-kpi { padding: 1.1rem 1.4rem; border-inline-start: 1px solid var(--border-subtle); }
.ui-kpi:first-child { border-inline-start: 0; }
.ui-kpi-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-secondary); }
.ui-kpi-value { margin-top: 0.3rem; font-size: 1.9rem; font-weight: 700; line-height: 1.15; color: var(--ink-primary); font-variant-numeric: tabular-nums; }
.ui-kpi-of { font-size: 1.05rem; font-weight: 500; color: var(--ink-secondary); }
.ui-money { display: inline-flex; align-items: baseline; gap: 0.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-money b { font-weight: 700; color: var(--ink-primary); }
.ui-money-fils { font-size: 0.8em; font-weight: 500; color: var(--ink-secondary); }
.ui-money-cur { margin-inline-start: 0.4rem; font-size: 0.68em; font-weight: 700; letter-spacing: 0.06em; color: var(--brand-primary); }
:root[data-bs-theme="dark"] .ui-money-cur { color: var(--ink-secondary); }
.ui-percent { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.ui-percent b { font-weight: 700; }
.ui-percent-note { margin-inline-start: 0.35rem; font-size: 0.75rem; color: var(--ink-secondary); }
.ui-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-comp { display: flex; align-items: center; gap: 0.75rem; }
.ui-comp-dot { flex: 0 0 auto; width: 0.5rem; align-self: stretch; border-radius: 999px; background: var(--status-success); }
.ui-comp-dot.is-deduction { background: var(--status-danger); }
.ui-comp-name { font-weight: 600; margin-bottom: 0.2rem; }
.ui-code {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--brand-primary) 9%, var(--surface-card));
    color: var(--brand-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
:root[data-bs-theme="dark"] .ui-code { color: var(--ink-primary); }
.ui-tick {
    padding: 2px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--status-success) 16%, var(--surface-card));
    color: var(--status-success);
}

/* ---- Avatars, rank and count pills, days-left -------------------------------- */
.ui-avatar {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-inline-end: 0.5rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand-primary) 14%, var(--surface-card));
    color: var(--brand-primary);
    font-size: 0.78rem;
    font-weight: 700;
    vertical-align: middle;
}
:root[data-bs-theme="dark"] .ui-avatar { color: var(--ink-primary); }
.ui-avatar-lg { width: 2.5rem; height: 2.5rem; margin: 0; border-radius: 12px; font-size: 1rem; }
.ui-rank,
.ui-count-pill {
    display: inline-block;
    min-width: 2.25rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.ui-rank { background: color-mix(in srgb, var(--brand-primary) 12%, var(--surface-card)); color: var(--brand-primary); }
.ui-count-pill { background: color-mix(in srgb, var(--brand-accent) 15%, var(--surface-card)); color: var(--ink-primary); }
:root[data-bs-theme="dark"] .ui-rank { color: var(--ink-primary); }
.ui-days {
    margin-inline-start: 0.5rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--status-success) 14%, var(--surface-card));
    color: var(--status-success);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.ui-days.is-soon { background: color-mix(in srgb, var(--status-warning) 16%, var(--surface-card)); color: var(--status-warning); }
.ui-days.is-over { background: color-mix(in srgb, var(--status-danger) 14%, var(--surface-card)); color: var(--status-danger); }

/* Calm row hover on every table (some pages set a strong accent hover of their own). */
.ui-modern .table-hover > tbody > tr:hover > * {
    --bs-table-hover-bg: color-mix(in srgb, var(--brand-primary) 6%, var(--surface-card));
    --bs-table-bg-state: color-mix(in srgb, var(--brand-primary) 6%, var(--surface-card));
}

/* ---- Avatar photos ------------------------------------------------------------ */
.ui-avatar { overflow: hidden; }
.ui-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ui-avatar-round { border-radius: 50%; }

/* ---- Org chart (tree with connecting lines, drag to re-assign) ---------------- */
.org-modern { --org-line: color-mix(in srgb, var(--brand-primary) 38%, var(--border-subtle)); padding-block: 1.5rem; }
.org-modern .org-chart-tree li::before,
.org-modern .org-chart-tree li::after,
.org-modern .org-chart-tree ul::before { border-color: var(--org-line); border-width: 2px; }
.org-modern .org-chart-tree li::before { border-radius: 0; }
.org-modern .org-chart-tree li:last-child::before { border-radius: 0 12px 0 0; }
.org-modern .org-chart-tree li:first-child::after { border-radius: 12px 0 0 0; }
.org-node {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 220px;
    max-width: 280px;
    padding: 0.65rem 0.85rem;
    text-align: start;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px rgba(16, 24, 40, 0.06);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.org-node[draggable="true"] { cursor: grab; }
.org-node:hover { border-color: var(--brand-primary); box-shadow: 0 8px 22px rgba(16, 24, 40, 0.12); }
.org-node .ui-avatar-lg { flex: 0 0 auto; width: 2.75rem; height: 2.75rem; font-size: 1.05rem; }
.org-node-text { min-width: 0; }
.org-node-name { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.org-node-role { font-size: 0.8125rem; color: var(--brand-primary); font-weight: 600; }
:root[data-bs-theme="dark"] .org-node-role { color: var(--ink-primary); }
.org-node-dept { font-size: 0.75rem; color: var(--ink-secondary); }
.org-node-count { position: absolute; inset-block-start: -0.55rem; inset-inline-end: -0.4rem; min-width: 1.6rem; padding: 0.05rem 0.45rem; font-size: 0.75rem; border: 2px solid var(--surface-card); }
.org-node-off { position: absolute; inset-block-end: -0.55rem; inset-inline-start: 0.8rem; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--status-danger); color: #fff; font-size: 0.6875rem; font-weight: 700; }
.org-node.is-inactive { opacity: .72; }
.org-node.is-dragging { opacity: .4; transform: scale(.97); }
.org-node.is-target { border-color: var(--brand-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-accent) 28%, transparent); }
.org-drop-top {
    display: none;
    margin-bottom: 1rem;
    padding: 0.7rem 1rem;
    border: 2px dashed var(--border-subtle);
    border-radius: 12px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--ink-secondary);
}
.org-modern.is-dragging .org-drop-top { display: block; }
.org-drop-top.is-target { border-color: var(--brand-accent); background: color-mix(in srgb, var(--brand-accent) 12%, transparent); color: var(--ink-primary); }

/* ---- Year calendar (Official Holidays) ---------------------------------------- */
.ui-yearcal { padding: 1rem 1.25rem 1.25rem; }
.ui-yearcal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.ui-yearcal-years { display: flex; gap: 0.35rem; }
.ui-yearcal-years a { padding: 0.2rem 0.75rem; border-radius: 999px; font-weight: 700; font-size: 0.875rem; text-decoration: none; color: var(--ink-secondary); font-variant-numeric: tabular-nums; }
.ui-yearcal-years a:hover { background: color-mix(in srgb, var(--brand-primary) 10%, var(--surface-card)); }
.ui-yearcal-years a.is-active { background: var(--brand-primary); color: #fff; }
.ui-yearcal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem 1.5rem; }
.ui-minimonth-title { margin-bottom: 0.35rem; font-weight: 700; font-size: 0.9rem; color: var(--brand-primary); }
:root[data-bs-theme="dark"] .ui-minimonth-title { color: var(--ink-primary); }
.ui-minimonth-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.ui-dow { font-size: 0.6875rem; font-weight: 700; color: var(--ink-secondary); }
.ui-day { display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.ui-day.is-holiday { background: var(--brand-accent); color: #fff; font-weight: 700; cursor: help; }
.ui-day.is-today { box-shadow: inset 0 0 0 2px var(--brand-primary); font-weight: 700; }

.ui-modern .text-success .ui-money b, .ui-modern .text-danger .ui-money b { color: inherit; }

.ui-modern .finance-hero-total .ui-money b,
.ui-modern .finance-hero-total .ui-money-fils,
.ui-modern .finance-hero-total .ui-money-cur { color: inherit; }
.ui-modern .finance-hero-total-amount .ui-money { font-size: 1em; }

/* ---- Settings rows: label + help on the left, control on the right ------------ */
.ui-modern .settings-field-row,
.ui-modern .settings-field-row + .settings-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
    column-gap: 2rem;
    align-items: center;
    margin: 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-subtle);
}
.ui-modern .settings-field-row:first-child { border-top: 0; padding-top: 0.25rem; }
.ui-modern .settings-field-row > .form-label { grid-column: 1; grid-row: 1; align-self: end; margin: 0; font-size: 0.95rem; }
.ui-modern .settings-field-row > .form-text { grid-column: 1; grid-row: 2; align-self: start; margin: 0.15rem 0 0 !important; font-size: 0.8125rem; color: var(--ink-secondary); }
.ui-modern .settings-field-row > :not(.form-label):not(.form-text):not(.invalid-feedback) { grid-column: 2; grid-row: 1 / span 2; max-width: none !important; width: 100%; }
.ui-modern .settings-field-row > .invalid-feedback { grid-column: 2; }
.ui-modern .settings-field-row .input-group-text { min-width: 5.5rem; justify-content: center; font-weight: 600; font-size: 0.8125rem; color: var(--ink-secondary); background: color-mix(in srgb, var(--brand-primary) 7%, var(--surface-card)); }
.ui-modern .settings-field-row .form-control,
.ui-modern .settings-field-row .form-select { font-variant-numeric: tabular-nums; }
.ui-modern .settings-field-row:has(.palette-picker),
.ui-modern .settings-field-row:has(.weekday-picker) { grid-template-columns: minmax(0, 1fr); }
.ui-modern .settings-field-row:has(.palette-picker) > *,
.ui-modern .settings-field-row:has(.weekday-picker) > * { grid-column: 1 !important; grid-row: auto !important; }
.ui-modern .settings-field-row:has(.palette-picker) > .form-text,
.ui-modern .settings-field-row:has(.weekday-picker) > .form-text { margin-bottom: 0.6rem !important; }
@media (max-width: 767.98px) {
    .ui-modern .settings-field-row,
    .ui-modern .settings-field-row + .settings-field-row { grid-template-columns: minmax(0, 1fr); row-gap: 0.4rem; }
    .ui-modern .settings-field-row > * { grid-column: 1 !important; grid-row: auto !important; }
}

/* ---- Org chart: queued moves -------------------------------------------------- */
.org-node.is-moved { border-color: var(--brand-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 25%, transparent); }
.org-pending {
    position: sticky; inset-block-start: 0.75rem; z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
    margin-bottom: 1rem; padding: 0.65rem 1rem;
    border: 1px solid var(--brand-accent); border-radius: 12px;
    background: color-mix(in srgb, var(--brand-accent) 12%, var(--surface-card));
    font-weight: 600;
}
.org-pending[hidden] { display: none; }
.org-pending-actions { display: inline-flex; gap: 0.5rem; }

/* ---- Settings: sub-headings and the reminder schedule panel ------------------- */
.ui-modern .settings-section-title {
    margin: 1.5rem 0 0.25rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid color-mix(in srgb, var(--brand-primary) 22%, var(--border-subtle));
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--brand-primary);
}
:root[data-bs-theme="dark"] .ui-modern .settings-section-title { color: var(--ink-secondary); }
.ui-modern .settings-section-title:first-of-type { margin-top: 0; }
.ui-modern .settings-section-title + .settings-field-row { border-top: 0; }

.rem-panel { display: grid; gap: 1rem; }
.rem-card { padding: 1.1rem 1.25rem; border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--surface-card); }
.rem-title { margin: 0 0 0.2rem; font-size: 1rem; font-weight: 700; }
.rem-intro { margin: 0 0 0.9rem; font-size: 0.875rem; color: var(--ink-secondary); }
.rem-note { margin-top: 0.25rem; font-size: 0.78rem; color: var(--ink-secondary); }
.rem-row { display: grid; grid-template-columns: minmax(130px, 1.3fr) repeat(4, minmax(110px, 1fr)); gap: 0.75rem; align-items: center; padding: 0.7rem 0; border-top: 1px solid var(--border-subtle); }
.rem-head { padding: 0 0 0.45rem; border-top: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-secondary); }
.rem-name { font-weight: 600; }
.rem-row .input-group { max-width: 150px; }
.rem-row .input-group-text, .rem-repeat .input-group-text { min-width: 4.5rem; justify-content: center; font-size: 0.8125rem; font-weight: 600; color: var(--ink-secondary); background: color-mix(in srgb, var(--brand-primary) 7%, var(--surface-card)); }
.rem-repeat { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem 2rem; margin-bottom: 0.75rem; }
.rem-repeat-label { display: grid; gap: 0.4rem; font-weight: 600; font-size: 0.9rem; }
.rem-repeat .input-group { max-width: 200px; font-weight: 400; }
.rem-example { background: color-mix(in srgb, var(--brand-accent) 8%, var(--surface-card)); }
.rem-example-list { margin: 0.4rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; font-variant-numeric: tabular-nums; }
.rem-example-list li { padding-inline-start: 1.1rem; position: relative; }
.rem-example-list li::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: 0.55em; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--brand-accent); }
@media (max-width: 767.98px) {
    .rem-head { display: none; }
    .rem-row { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
    .rem-row > [data-label]::before { content: attr(data-label); display: block; margin-bottom: 0.2rem; font-size: 0.75rem; font-weight: 700; color: var(--ink-secondary); }
}

.rem-legend { margin: 0.9rem 0 0; padding: 0.7rem 0 0; border-top: 1px solid var(--border-subtle); list-style: none; display: grid; gap: 0.2rem; font-size: 0.78rem; color: var(--ink-secondary); }
.rem-row .input-group-text { min-width: 3.5rem; padding-inline: 0.5rem; }
@media (max-width: 1100px) and (min-width: 768px) {
    .rem-row { grid-template-columns: minmax(110px, 1.2fr) repeat(4, minmax(90px, 1fr)); gap: 0.5rem; }
    .rem-row .input-group-text { display: none; }
}
