/* =====================================================
   DICTORA — THEME: design tokens + shared components
   (loaded by layouts/super.blade.php on every page)
===================================================== */
:root,
:root[data-theme="light"] {
    color-scheme: light;
    --primary: #0878E8;
    --primary-hover: #0963C7;
    --primary-dark: #082D70;
    --primary-light: #EAF3FF;
    --primary-soft: #F1F6FF;
    --cyan: #00B8F0;
    --accent: #FF6800;
    --accent-light: #FFF0E5;
    --gold: #E9B91A;
    --gradient-primary: linear-gradient(135deg, #082D70 0%, #0878E8 60%, #00B8F0 100%);
    --gradient-accent: linear-gradient(135deg, #FF9A00, #FF6800, #F04428);
    --gradient-gold: linear-gradient(135deg, #FFE46B, #FFB800, #FF8A00);

    --bg-body: #EEF3F9;
    --surface: #FFFFFF;
    --surface-2: #F8FAFE;
    --surface-3: #E9EFF6;
    --text-primary: #172943;
    --text-secondary: #52647D;
    --text-muted: #5F7089;
    --heading-color: #082D70;
    --border: #D5E0ED;
    --border-light: #E6EDF6;

    --success: #159A63;
    --success-bg: #E7F7EE;
    --danger: #E54848;
    --danger-bg: #FFF0F0;
    --warning: #C98600;
    --warning-bg: #FFF7DF;
    --info: #098FC4;
    --info-bg: #E6F7FF;

    /* tinted icon tiles (kpi / stat / service icons) */
    --tile-cyan-bg: #E5F9FF;
    --tile-cyan: #0091BD;
    --tile-gold-bg: #FFF6D8;
    --tile-gold: #B98D00;

    --sidebar-bg: #082D70;
    --sidebar-bg-end: #061F50;
    --sidebar-text: #E5F0FF;
    --sidebar-muted: #A9C5E8;
    --sidebar-hover: rgba(255, 255, 255, .09);
    --sidebar-active: linear-gradient(120deg, #0878E8, #00A9DE);

    --card-bg: #FFFFFF;
    --card-border: #DFE8F3;

    --shadow-card: 0 1px 2px rgba(8, 45, 112, .06), 0 6px 16px rgba(8, 45, 112, .05);
    --shadow-card-hover: 0 4px 12px rgba(8, 45, 112, .10), 0 14px 30px rgba(8, 45, 112, .09);
    --shadow-modal: 0 24px 60px rgba(8, 45, 112, .28), 0 4px 12px rgba(8, 45, 112, .10);
    --shadow-3d-btn: 0 2px 0 #065BB7, 0 7px 16px rgba(8, 120, 232, .26);
    --shadow-3d-btn-hover: 0 1px 0 #065BB7, 0 11px 22px rgba(8, 120, 232, .34);
    --shadow-3d-btn-active: 0 0 0 #065BB7, 0 4px 10px rgba(8, 120, 232, .24);
    --shadow-3d-accent: 0 2px 0 #CB4300, 0 7px 16px rgba(255, 104, 0, .26);
    --shadow-3d-accent-hover: 0 1px 0 #CB4300, 0 11px 22px rgba(255, 104, 0, .34);
    --shadow-icon: 0 4px 10px rgba(8, 120, 232, .15);

    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --t-fast: .15s ease;
    --t-norm: .25s ease;
    --sidebar-w: 264px;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --primary: #48A2FF;
    --primary-hover: #74BAFF;
    --primary-dark: #071A32;
    --primary-light: #142F50;
    --primary-soft: #10243C;
    --cyan: #25C8F5;
    --accent: #FF8A42;
    --accent-light: #482A1D;
    --gold: #FFD65B;
    --gradient-primary: linear-gradient(135deg, #1766CA 0%, #0878E8 55%, #00B8F0 100%);
    --gradient-accent: linear-gradient(135deg, #FFB04F, #FF792E, #E84C2C);
    --gradient-gold: linear-gradient(135deg, #FFE88A, #FFD044, #FFA52C);

    --bg-body: #0A1424;
    --surface: #14243A;
    --surface-2: #192B43;
    --surface-3: #203650;
    --text-primary: #EDF5FF;
    --text-secondary: #B3C4DA;
    --text-muted: #8FA3BC;
    --heading-color: #F1F7FF;
    --border: #293D57;
    --border-light: #20344D;

    --success: #35CF8C;
    --success-bg: #123B31;
    --danger: #FF7078;
    --danger-bg: #43252F;
    --warning: #FFC45A;
    --warning-bg: #44351D;
    --info: #4ACBFA;
    --info-bg: #123747;

    --tile-cyan-bg: #0D293A;
    --tile-cyan: #25C8F5;
    --tile-gold-bg: #433719;
    --tile-gold: #FFD65B;

    --sidebar-bg: #07182D;
    --sidebar-bg-end: #061326;
    --sidebar-text: #E3EEFD;
    --sidebar-muted: #91A9C8;
    --sidebar-hover: rgba(255, 255, 255, .07);
    --sidebar-active: linear-gradient(120deg, #1268CD, #0878E8);

    --card-bg: #14243A;
    --card-border: #293D57;

    --shadow-card: 0 2px 6px rgba(0, 0, 0, .25), 0 8px 22px rgba(0, 0, 0, .20);
    --shadow-card-hover: 0 10px 28px rgba(0, 0, 0, .38), 0 2px 6px rgba(0, 0, 0, .18);
    --shadow-modal: 0 24px 60px rgba(0, 0, 0, .6), 0 4px 12px rgba(0, 0, 0, .3);
    --shadow-3d-btn: 0 2px 0 #07549D, 0 7px 18px rgba(0, 120, 232, .30);
    --shadow-3d-btn-hover: 0 1px 0 #07549D, 0 11px 24px rgba(0, 120, 232, .40);
    --shadow-3d-btn-active: 0 0 0 #07549D, 0 4px 12px rgba(0, 120, 232, .26);
    --shadow-3d-accent: 0 2px 0 #B84819, 0 7px 18px rgba(255, 104, 0, .28);
    --shadow-3d-accent-hover: 0 1px 0 #B84819, 0 11px 24px rgba(255, 104, 0, .36);
    --shadow-icon: 0 4px 12px rgba(0, 0, 0, .30);
}

/* ============ BASE ============ */
* {
    font-family: 'Inter', system-ui, -apple-system, sans-serif
}

[hidden] {
    display: none !important
}

h1,
h2,
h3,
h4,
h5,
h6,
.heading-font {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -.02em;
}

body {
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: .94rem;
    overflow-x: hidden;
    transition: background var(--t-norm), color var(--t-norm);
}

body.no-scroll {
    overflow: hidden
}

::selection {
    background: var(--primary);
    color: #fff
}

::placeholder {
    color: var(--text-muted) !important;
    opacity: .85 !important
}

hr {
    border-color: var(--border-light);
    opacity: 1
}

.row-icon {
    padding: 0.1rem 0.5rem 0.1rem;
    border-radius: 6px;
}

/* ============ 3D CARD ============ */
.card-3d {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: transform .2s cubic-bezier(.2, .8, .3, 1), box-shadow .25s ease, border-color .2s;
    position: relative;
    min-width: 0;
}

.card-3d:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-light);
}

.card-3d.no-lift:hover {
    transform: none;
    box-shadow: var(--shadow-card);
    border-color: var(--card-border)
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.card-head h6 {
    font-size: .98rem;
    font-weight: 700;
    margin: 0;
    color: var(--heading-color)
}

/* ============ BUTTONS ============ */
.btn-3d {
    border: none;
    border-radius: var(--radius-pill);
    padding: .6rem 1.35rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--shadow-3d-btn);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .18);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .15);
    transition: transform .12s ease, box-shadow .15s ease;
    white-space: nowrap;
}

.btn-3d:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-3d-btn-hover);
    color: #fff
}

.btn-3d:active {
    transform: translateY(3px);
    box-shadow: var(--shadow-3d-btn-active)
}

.btn-3d:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px
}

.btn-3d.accent {
    background: var(--gradient-accent);
    box-shadow: var(--shadow-3d-accent);
    border-color: rgba(255, 255, 255, .14)
}

.btn-3d.accent:hover {
    box-shadow: var(--shadow-3d-accent-hover)
}

.btn-3d.sm {
    padding: .42rem .95rem;
    font-size: .78rem
}

.btn-soft {
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: .82rem;
    padding: .45rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: all var(--t-fast);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.btn-soft:hover {
    background: var(--primary-soft);
    border-color: var(--primary-light);
    color: var(--primary)
}

.btn-soft.sm {
    padding: .32rem .7rem;
    font-size: .74rem
}

.btn-soft.danger {
    color: var(--danger)
}

.btn-soft.danger:hover {
    background: var(--danger-bg);
    border-color: transparent;
    color: var(--danger)
}

.btn-soft.active,
.btn-soft.active:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 3px 10px rgba(8, 120, 232, .28)
}

[data-theme="dark"] .btn-soft.active,
[data-theme="dark"] .btn-soft.active:hover {
    color: #06121F
}

.btn-soft:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px
}

/* segmented range / filter group */
.chip-tabs {
    display: inline-flex;
    gap: .2rem;
    padding: .2rem;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.chip-tabs::-webkit-scrollbar {
    display: none
}

.chip-tabs .btn-soft {
    border-color: transparent;
    background: transparent;
    flex-shrink: 0
}

.chip-tabs .btn-soft:hover {
    background: var(--surface);
    border-color: var(--border-light)
}

.chip-tabs .btn-soft.active,
.chip-tabs .btn-soft.active:hover {
    background: var(--primary);
    border-color: var(--primary)
}

/* ============ BADGES ============ */
.badge-3d {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border-radius: var(--radius-pill);
    padding: .3rem .75rem;
    font-weight: 600;
    font-size: .72rem;
    line-height: 1;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--border-light);
    white-space: nowrap;
}

[data-theme="dark"] .badge-3d {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: var(--border)
}

/* declared AFTER the dark rule and with equal specificity so tones win in both themes */
.badge-3d.badge-soft-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: transparent
}

.badge-3d.badge-soft-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: transparent
}

.badge-3d.badge-soft-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: transparent
}

.badge-3d.badge-soft-info {
    background: var(--info-bg);
    color: var(--info);
    border-color: transparent
}

/* ============ SELECT / INPUT ============ */
.select-3d,
.input-3d {
    width: 100%;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface-2);
    padding: .5rem .95rem;
    font-size: .82rem;
    color: var(--text-primary);
    outline: none;
    transition: all var(--t-fast);
    appearance: none;
    -webkit-appearance: none;
    min-width: 0;
}

.select-3d {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'><path fill='%238493A7' d='M8 11L2 5h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    padding-right: 2rem;
    cursor: pointer;
    text-overflow: ellipsis;
}

.select-3d option {
    background: var(--surface);
    color: var(--text-primary)
}

textarea.input-3d {
    border-radius: var(--radius-md);
    min-height: 92px;
    resize: vertical;
    padding: .65rem .95rem;
    display: block
}

.select-3d:focus,
.input-3d:focus {
    border-color: var(--primary);
    background-color: var(--surface);
    box-shadow: 0 0 0 3px rgba(8, 120, 232, .16);
}

.form-label-sm {
    display: block;
    font-size: .74rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: .35rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .85rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

/* bootstrap checkbox re-skin (follows theme) */
.form-check-input {
    background-color: var(--surface-2);
    border-color: var(--border);
    cursor: pointer
}

.form-check-input:checked,
.form-check-input:indeterminate {
    background-color: var(--primary);
    border-color: var(--primary)
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 120, 232, .18)
}

/* ============ TABLE ============ */
.table-clean {
    --bs-table-color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-light);
    --bs-table-accent-bg: transparent;
    --bs-table-striped-bg: transparent;
    --bs-table-hover-bg: transparent;
    --bs-table-hover-color: var(--text-primary);
    margin: 0;
    font-size: .86rem;
    color: var(--text-primary)
}

/* Bootstrap 5.3 paints every cell with an inset box-shadow = --bs-table-bg (white). Kill it so dark theme works. */
.table-clean>:not(caption)>*>* {
    background-color: transparent;
    box-shadow: none;
    color: var(--text-primary)
}

.table-clean thead th {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--border) !important;
    background: transparent;
    padding: .55rem .6rem;
    white-space: nowrap;
}

.table-clean tbody td {
    padding: .7rem .6rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table-clean tbody tr:last-child td {
    border-bottom: none
}

.table-clean tbody tr {
    transition: background var(--t-fast)
}

.table-clean tbody tr:hover {
    background: var(--surface-2)
}

.table-responsive {
    -webkit-overflow-scrolling: touch
}

.user-cell {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0
}

.user-cell>div:last-child {
    min-width: 0
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .74rem;
    color: #fff;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, .3), 0 2px 6px rgba(8, 45, 112, .15);
}

.user-name {
    font-weight: 600;
    font-size: .85rem;
    line-height: 1.25;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%
}

.user-mail {
    font-size: .72rem;
    color: var(--text-muted);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%
}

/* inside tables keep names bounded so the row never explodes */
.table-clean .user-cell>div:last-child {
    max-width: 230px
}

.cell-num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap
}

/* ============ PROGRESS 3D ============ */
.progress-3d {
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .07);
    overflow: hidden;
}

.progress-bar-3d {
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    box-shadow: 0 1px 3px rgba(8, 120, 232, .4);
    transition: width .6s cubic-bezier(.2, .8, .3, 1);
}

.progress-bar-3d.warn {
    background: linear-gradient(135deg, #FFB04F, #FF6800)
}

.progress-bar-3d.danger {
    background: linear-gradient(135deg, #FF8080, #E54848)
}

.progress-bar-3d.success {
    background: linear-gradient(135deg, #3DD68C, #159A63)
}

/* ============ DOT ============ */
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0
}

.dot.ok {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(21, 154, 99, .15)
}

.dot.warn {
    background: var(--warning);
    box-shadow: 0 0 0 3px rgba(201, 134, 0, .15)
}

.dot.err {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(229, 72, 72, .15)
}

/* ============ LIST ROWS (provider / activity / log / override) ============ */
.provider-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .62rem 0;
    border-bottom: 1px solid var(--border-light)
}

.provider-row:last-child {
    border-bottom: none
}

.provider-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    background: var(--surface-3);
    color: var(--text-secondary);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, .5);
}

[data-theme="dark"] .provider-logo {
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, .05)
}

.provider-row>.flex-grow-1,
.activity-row>.flex-grow-1,
.override-row>.flex-grow-1,
.log-row>.flex-grow-1 {
    min-width: 0
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 1rem;
    display: block;
}

.empty-state h6 {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: .3rem
}

.empty-state p {
    font-size: .85rem;
    margin: 0
}

/* ============ SHELL: SIDEBAR ============ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-end) 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    z-index: 1040;
    box-shadow: 6px 0 25px rgba(0, 0, 0, .08);
    border-right: 1px solid rgba(255, 255, 255, .06);
    transition: transform .3s cubic-bezier(.2, .8, .3, 1);
    overscroll-behavior: contain;
}

.sidebar-brand {
    padding: 1.4rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    position: sticky;
    top: 0;
    background: var(--sidebar-bg);
    z-index: 2;
}

.sidebar-brand img {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35))
}

.sidebar-brand h4 {
    font-size: 1.22rem;
    font-weight: 800;
    margin: 0;
    color: #fff;
    letter-spacing: -.4px;
    line-height: 1.15
}

.sidebar-brand span {
    display: block;
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: 1.6px;
    opacity: .72;
    margin-top: 3px
}

.sidebar-nav {
    flex: 1;
    padding: 1rem .8rem 1.5rem;
    list-style: none;
    margin: 0
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    border-radius: var(--radius-sm);
    padding: .68rem .95rem;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 13px;
    font-weight: 500;
    font-size: .88rem;
    opacity: .88;
    transition: background .2s, opacity .2s, color .2s;
    cursor: pointer;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    color: var(--sidebar-muted);
    transition: color .2s;
    flex-shrink: 0
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    opacity: 1;
    color: #fff
}

.sidebar-nav .nav-link:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: -2px
}

/* sign-out is a <button> inside a POST form (logout must not be a GET link) */
.sidebar-nav .nav-logout-item {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.sidebar-nav .nav-logout-item form {
    margin: 0;
}

.sidebar-nav .nav-logout {
    width: 100%;
    background: transparent;
    border: 0;
    text-align: left;
}

.sidebar-nav .nav-logout:hover i {
    color: #ff8a8a;
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    opacity: 1;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .28), inset 0 1px 1px rgba(255, 255, 255, .18);
}

.sidebar-nav .nav-link.active i {
    color: #fff
}

.sidebar-nav .count {
    margin-left: auto;
    font-size: .66rem;
    font-weight: 700;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    padding: .12rem .45rem;
    border-radius: var(--radius-pill);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .75rem;
    opacity: .72;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 15, 30, .55);
    z-index: 1030;
    display: none;
    backdrop-filter: blur(4px);
}

.menu-overlay.show {
    display: block
}

/* ============ SHELL: MAIN / TOPBAR ============ */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 2rem 2rem;
}

/* keep ultra-wide screens readable */
.main-content>* {
    max-width: 1680px;
    margin-left: auto;
    margin-right: auto
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: .9rem;
    min-width: 0
}

.topbar h1 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--heading-color);
    margin: 0;
    letter-spacing: -.6px
}

.topbar .crumb {
    font-size: .76rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.topbar .crumb i {
    font-size: .6rem;
    opacity: .7
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(8, 45, 112, .06);
    transition: all .2s cubic-bezier(.2, .8, .3, 1);
    position: relative;
    flex-shrink: 0;
    padding: 0;
}

.icon-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(8, 45, 112, .13);
    border-color: var(--primary-light);
    color: var(--primary)
}

.icon-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px
}

.avatar-chip {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: .3rem .9rem .3rem .35rem;
    box-shadow: 0 2px 8px rgba(8, 45, 112, .06);
    cursor: pointer;
    transition: all .2s;
}

.avatar-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(8, 45, 112, .12)
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .3px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, .35);
    flex-shrink: 0;
}

.avatar-chip small {
    display: block;
    font-size: .66rem;
    color: var(--text-muted);
    line-height: 1
}

.avatar-chip strong {
    font-size: .8rem;
    line-height: 1.3;
    display: block;
    color: var(--text-primary)
}

/* ============ TABS ============ */
.tabbar {
    display: flex;
    gap: .35rem;
    flex-wrap: nowrap;
    padding: .4rem;
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.tabbar::-webkit-scrollbar {
    display: none
}

.tab {
    border: none;
    background: transparent;
    padding: .6rem 1.1rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: .85rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
    transition: all .2s cubic-bezier(.2, .8, .3, 1);
    white-space: nowrap;
    flex-shrink: 0;
}

.tab i {
    font-size: .95rem;
    opacity: .85
}

.tab:hover {
    background: var(--primary-soft);
    color: var(--primary)
}

.tab.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(8, 120, 232, .30), inset 0 1px 1px rgba(255, 255, 255, .18);
}

.tab.active i {
    opacity: 1
}

.tab:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px
}

.tab .count {
    font-size: .66rem;
    font-weight: 700;
    background: rgba(128, 144, 168, .22);
    color: inherit;
    padding: .12rem .45rem;
    border-radius: var(--radius-pill);
    margin-left: .15rem;
}

.tab.active .count {
    background: rgba(255, 255, 255, .25)
}

/* ============ VIEW TRANSITION ============ */
.view {
    animation: fadeIn .25s ease
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(.96) translateY(8px)
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0)
    }
}

/* ============ TOAST ============ */
.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    max-width: 360px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.toast-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: .8rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    box-shadow: 0 12px 32px rgba(8, 45, 112, .20);
    animation: toastIn .28s cubic-bezier(.2, .8, .3, 1);
    pointer-events: auto;
    border-left: 4px solid var(--primary);
}

[data-theme="dark"] .toast-item {
    box-shadow: 0 12px 32px rgba(0, 0, 0, .5)
}

.toast-item.success {
    border-left-color: var(--success)
}

.toast-item.danger {
    border-left-color: var(--danger)
}

.toast-item.warning {
    border-left-color: var(--warning)
}

.toast-item.info {
    border-left-color: var(--info)
}

.toast-item>i {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--primary)
}

.toast-item.success>i {
    color: var(--success)
}

.toast-item.danger>i {
    color: var(--danger)
}

.toast-item.warning>i {
    color: var(--warning)
}

.toast-item.info>i {
    color: var(--info)
}

.toast-item .t-body {
    flex: 1;
    min-width: 0
}

.toast-item .t-title {
    font-weight: 700;
    font-size: .85rem;
    color: var(--text-primary);
    line-height: 1.3
}

.toast-item .t-msg {
    font-size: .76rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 2px
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.98)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(10px) scale(.98)
    }
}

.toast-item.out {
    animation: toastOut .22s ease forwards
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary)
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .18)
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .32)
}

/* ============ SHARED PAGE COMPONENTS (moved from users.css) ============ */
/* ============ SEARCH ============ */
.search-box {
    position: relative;
    width: 100%
}

.search-box i {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .85rem;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface-2);
    padding: .5rem .9rem .5rem 2.2rem;
    font-size: .82rem;
    color: var(--text-primary);
    outline: none;
    transition: all var(--t-fast);
}

.search-box input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(8, 120, 232, .16)
}


/* ============ MODAL ============ */
.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn .18s ease;
}

.modal-scrim {
    position: absolute;
    inset: 0;
    background: rgba(5, 15, 30, .55);
    backdrop-filter: blur(6px)
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow: auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    animation: scaleIn .22s cubic-bezier(.2, .8, .3, 1);
}

.modal-card.wide {
    max-width: 820px
}

.modal-head {
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 1;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-head h5 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--heading-color);
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere
}

.modal-card .modal-body {
    padding: 1.3rem 1.4rem;
    color: var(--text-primary)
}

.modal-foot {
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: .6rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-foot:empty {
    display: none
}

.close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--t-fast);
}

.close-btn:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: transparent
}

.close-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px
}


/* ============ FORM GRID ============ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem
}

.form-grid>* {
    min-width: 0
}

.form-grid .full {
    grid-column: 1/-1
}


/* ============ ACTIVITY TIMELINE ============ */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: .5rem
}

.activity-row {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    padding: .8rem .9rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    transition: all var(--t-fast);
}

.activity-row:hover {
    background: var(--surface-3);
    transform: translateX(2px)
}

.activity-row .user-mail {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .92rem;
    background: var(--primary-light);
    color: var(--primary);
}

[data-theme="dark"] .activity-icon {
    background: var(--primary-soft)
}

.activity-icon.success {
    background: var(--success-bg);
    color: var(--success)
}

.activity-icon.warn {
    background: var(--warning-bg);
    color: var(--warning)
}

.activity-icon.danger {
    background: var(--danger-bg);
    color: var(--danger)
}

.activity-icon.accent {
    background: var(--accent-light);
    color: var(--accent)
}

.activity-time {
    font-size: .7rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0
}


/* ============ STAT CARD ============ */
.stat-card {
    padding: 1.1rem 1.2rem;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    transition: all .2s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover)
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: .65rem;
    background: var(--primary-light);
    color: var(--primary);
}

[data-theme="dark"] .stat-icon {
    background: var(--primary-soft)
}

.stat-icon.cyan {
    background: var(--tile-cyan-bg);
    color: var(--tile-cyan)
}

.stat-icon.gold {
    background: var(--tile-gold-bg);
    color: var(--tile-gold)
}

.stat-icon.accent {
    background: var(--accent-light);
    color: var(--accent)
}

.stat-icon.success {
    background: var(--success-bg);
    color: var(--success)
}

.stat-icon.warning {
    background: var(--warning-bg);
    color: var(--warning)
}

.stat-icon.danger {
    background: var(--danger-bg);
    color: var(--danger)
}

.stat-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.8px;
    color: var(--heading-color);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-top: .15rem
}

.kpi-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--text-secondary)
}

.kpi-sub {
    font-size: .74rem;
    color: var(--text-muted);
    font-weight: 500
}


/* ============ RESPONSIVE (shared) ============ */
@media (max-width:1199.98px) {
    .main-content {
        padding: 1.4rem 1.5rem 2rem
    }
}

@media (max-width:991.98px) {
    .admin-wrapper {
        display: block
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        max-width: 86vw;
        transform: translateX(-100%);
        visibility: hidden;
        box-shadow: 10px 0 45px rgba(0, 0, 0, .3);
        transition: transform .3s cubic-bezier(.2, .8, .3, 1), visibility 0s linear .3s;
    }

    .sidebar.show {
        transform: translateX(0);
        visibility: visible;
        transition: transform .3s cubic-bezier(.2, .8, .3, 1), visibility 0s
    }

    .main-content {
        padding: 1.25rem
    }

    .topbar h1 {
        font-size: 1.4rem
    }
}

@media (max-width:767.98px) {
    .topbar-actions {
        margin-left: auto
    }
}

@media (max-width:575.98px) {
    .main-content {
        padding: 1rem .85rem 1.5rem
    }

    .topbar {
        margin-bottom: .9rem
    }

    .topbar h1 {
        font-size: 1.25rem
    }

    .topbar-title {
        gap: .6rem
    }

    .topbar .crumb {
        font-size: .7rem
    }

    .tabbar {
        margin-bottom: 1.1rem
    }

    .tab {
        padding: .55rem .9rem;
        font-size: .8rem
    }

    .toast-stack {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-width: none
    }

    .card-head {
        margin-bottom: .85rem
    }

    .table-clean {
        font-size: .82rem
    }

    .table-clean .user-cell>div:last-child {
        max-width: 160px
    }
}

@media (max-width:399.98px) {
    .topbar .crumb {
        display: none
    }

    .icon-btn {
        width: 40px;
        height: 40px
    }

    .topbar-actions {
        gap: .45rem
    }

    .avatar-chip {
        padding: .25rem
    }
}

/* touch devices: no hover "lift" (it sticks after a tap) */
@media (hover:none) {

    .card-3d:hover,
    .icon-btn:hover,
    .avatar-chip:hover,
    .btn-3d:hover {
        transform: none
    }
}

@media (prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important
    }
}

/* ============ RESPONSIVE (modal / forms / stats / activity) ============ */
@media (max-width:575.98px) {
    .form-grid {
        grid-template-columns: 1fr
    }

    .modal-shell {
        padding: .6rem;
        align-items: flex-end
    }

    .modal-card {
        max-height: 94vh;
        max-height: 94dvh
    }

    .modal-head,
    .modal-foot {
        padding: .9rem 1rem
    }

    .modal-card .modal-body {
        padding: 1.1rem 1rem
    }

    .modal-foot>* {
        flex: 1 1 auto;
        justify-content: center
    }

    .stat-card {
        padding: .9rem 1rem
    }

    .stat-value {
        font-size: 1.4rem
    }

    /* request / override / activity rows wrap their actions below the text */
    .activity-row {
        flex-wrap: wrap
    }

    .activity-row>.flex-grow-1 {
        flex-basis: calc(100% - 60px)
    }

    .activity-row>.d-flex:last-child {
        margin-left: auto
    }

    .activity-time {
        display: none
    }
}

/* ============ SHARED (moved/added for the organization model) ============ */
/* ============ PAGINATION ============ */
.pagination-3d {
    display: flex;
    gap: .3rem;
    align-items: center;
    flex-wrap: wrap
}

.page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 .55rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--primary-soft)
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 3px 10px rgba(8, 120, 232, .3)
}

[data-theme="dark"] .page-btn.active {
    color: #06121F
}

.page-btn:disabled {
    opacity: .4;
    cursor: not-allowed
}

.page-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px
}


/* category / feature colour tint — colour comes from --c (set inline).
   In dark mode the foreground is lightened so dark navy stays readable. */
.tint,
.badge-3d.tint {
    --c: var(--primary);
    background: var(--primary-light);
    color: var(--c);
    background: color-mix(in srgb, var(--c) 14%, transparent);
}

.badge-3d.tint {
    border-color: transparent
}

[data-theme="dark"] .tint,
[data-theme="dark"] .badge-3d.tint {
    color: color-mix(in srgb, var(--c) 55%, #fff);
    background: color-mix(in srgb, var(--c) 22%, transparent);
}

.cat-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem
}

.cat-icon.lg {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 1.2rem
}

.crumb-current {
    color: var(--primary);
    font-weight: 600
}

/* ============ FORM / DIALOG HELPERS (shared) ============ */
.req {
    color: var(--danger)
}

.field-hint {
    font-size: .7rem;
    color: var(--text-muted);
    margin-top: .3rem
}

.modal-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: .9rem;
    line-height: 1.55
}

.modal-text strong {
    color: var(--text-primary)
}

.btn-3d.btn-danger-3d {
    background: var(--danger);
    box-shadow: 0 6px 16px rgba(229, 72, 72, .30)
}

.form-error {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem .85rem;
    border-radius: var(--radius-sm);
    background: var(--danger-bg);
    color: var(--danger);
    font-size: .8rem;
    font-weight: 600
}

.form-error[hidden] {
    display: none
}

.user-mail.dep-wrap {
    white-space: normal;
    max-width: none
}

/* plan chip */
.plan-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 600;
    font-size: .8rem;
    white-space: nowrap
}

.plan-chip i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block
}


.progress-3d.sm {
    height: 6px
}

.org-anchor {
    font-weight: 600;
    font-size: .83rem;
    color: var(--text-primary);
    text-decoration: none
}

.org-anchor:hover {
    color: var(--primary)
}


/* ---------- toggle switch + switch row (shared: Feature & Access, Settings) ---------- */
/* ---------- toggle ---------- */
.toggle-3d {
    position: relative;
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: var(--surface-3);
    box-shadow: inset 0 0 0 1px var(--border);
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
    border: none;
    padding: 0;
    flex-shrink: 0;
}

/* bigger touch target without changing the visual size */
.toggle-3d::before {
    content: '';
    position: absolute;
    inset: -10px -6px
}

.toggle-3d::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transition: transform .2s;
}

.toggle-3d.on {
    background: var(--success);
    box-shadow: none
}

.toggle-3d.on::after {
    transform: translateX(18px)
}

.toggle-3d:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px
}

.toggle-3d:disabled,
.toggle-3d.locked {
    opacity: .5;
    cursor: not-allowed
}

.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--border-light)
}

.switch-row:last-child {
    border-bottom: none
}

.switch-row>div:first-child {
    min-width: 0
}

.switch-row .user-mail {
    white-space: normal;
    max-width: none
}


/* ---------- voice record modal + meta chips (shared: user page, voice records page) ---------- */
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .9rem;
    margin-top: .35rem;
    color: var(--text-secondary);
    font-size: .85rem
}

.hero-meta span,
.hero-meta a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
    overflow-wrap: anywhere
}

/* recording modal */
.wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 56px;
    padding: 0 .25rem;
    margin: .75rem 0 .35rem
}

.wave i {
    flex: 1 1 0;
    min-width: 1px;
    border-radius: 2px;
    background: var(--border);
    transition: background .15s
}

.wave i.on {
    background: var(--primary)
}

.player {
    display: flex;
    align-items: center;
    gap: .75rem
}

.player .time {
    font-size: .78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap
}

.transcript {
    margin-top: 1rem;
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--surface-2, var(--surface-3));
    font-size: .85rem;
    line-height: 1.55
}