/* ==========================================================================
   BioMed 360 â€” Medical Equipment OS
   Light clinical design system
   ========================================================================== */

:root {
    --bg: #f3f6f8;
    --bg-warm: #f7f9fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-tint: #f0fdfa;
    --ink: #0b1f33;
    --text: #172b3f;
    --muted: #64748b;
    --muted-2: #8ba0b4;
    --border: #e3e9ef;
    --border-strong: #ccd7e1;
    --primary: #0f766e;
    --primary-strong: #115e59;
    --primary-bright: #0d9488;
    --primary-soft: #ccfbf1;
    --primary-wash: #f0fdfa;
    --blue: #2563eb;
    --blue-soft: #eff6ff;
    --amber: #b45309;
    --amber-soft: #fffbeb;
    --red: #b91c1c;
    --red-soft: #fef2f2;
    --green: #047857;
    --green-soft: #ecfdf5;
    --purple: #6d28d9;
    --purple-soft: #f5f3ff;
    --sidebar-w: 258px;
    --topbar-h: 74px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-xs: 0 1px 2px rgba(11, 31, 51, .04);
    --shadow-sm: 0 1px 2px rgba(11, 31, 51, .04), 0 8px 24px -20px rgba(11, 31, 51, .25);
    --shadow-md: 0 18px 45px -28px rgba(11, 31, 51, .32), 0 2px 5px rgba(11, 31, 51, .04);
    --shadow-lg: 0 28px 70px -30px rgba(11, 31, 51, .38);
    --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text);
    background:
        radial-gradient(1200px 500px at 85% -180px, rgba(13, 148, 136, .07), transparent 65%),
        radial-gradient(900px 420px at 5% 105%, rgba(37, 99, 235, .045), transparent 70%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: #99f6e4; color: #0b1f33; }

.icon { flex: 0 0 auto; }

.skip-link {
    position: fixed; top: -60px; left: 16px; z-index: 999;
    padding: 10px 16px; border-radius: 8px; background: var(--ink); color: #fff;
    transition: top .15s;
}
.skip-link:focus { top: 12px; color: #fff; }

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app-frame { min-height: 100vh; }

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    padding: 20px 16px 16px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfd 62%, #f7fbfa 100%);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d5e0e6 transparent;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 4px 18px; }
.sidebar .sidebar-close { display: none; margin-left: auto; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { border-radius: 12px; box-shadow: 0 8px 18px -12px rgba(15, 118, 110, .55); }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { font-size: 16px; letter-spacing: -.02em; line-height: 1.2; font-weight: 760; color: var(--ink); }
.brand-copy span { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-top: 3px; }

.workspace-role {
    margin: 0 2px 18px;
    padding: 11px 12px;
    border: 1px solid #d7e9e5;
    border-radius: 12px;
    background: linear-gradient(135deg, #f4fdfb, #ecfdf5);
}
.workspace-role .micro-label { display: block; margin-bottom: 7px; color: #5f7d78; }
.workspace-role-inner { display: flex; align-items: center; gap: 8px; }
.workspace-role-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; color: var(--primary); background: #d7f5ef; }
.workspace-role-name { font-size: 12px; font-weight: 700; color: #134e4a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-role .status-dot { margin-left: auto; }

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .13); flex: 0 0 auto; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, .12); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); } }

.side-nav { display: flex; flex-direction: column; gap: 20px; padding-bottom: 18px; }
.nav-section { display: flex; flex-direction: column; gap: 4px; }
.nav-label { padding: 0 10px 6px; font-size: 9.5px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: #93a7b8; }
.nav-link {
    position: relative;
    display: flex; align-items: center; gap: 10px;
    min-height: 39px; padding: 8px 10px;
    border-radius: 9px;
    color: #3c5265;
    font-size: 12.8px; font-weight: 560;
    transition: background .15s, color .15s;
}
.nav-link .icon { color: #7c93a6; transition: color .15s; }
.nav-link:hover { background: #f3f8f7; color: var(--ink); }
.nav-link:hover .icon { color: var(--primary); }
.nav-link.is-active { background: #e9faf6; color: #0f5d57; font-weight: 680; box-shadow: inset 3px 0 0 var(--primary-bright); }
.nav-link.is-active .icon { color: var(--primary); }
.nav-link span:not(.nav-count) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
    margin-left: auto;
    min-width: 22px; height: 20px; padding: 0 6px;
    display: inline-grid; place-items: center;
    border-radius: 6px;
    background: #eef3f6; color: #62798b;
    font-size: 10px; font-weight: 750;
}
.nav-count-warn { background: #fef3c7; color: #92400e; }

.sidebar-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.shift-log-btn {
    display: flex; align-items: center; gap: 9px;
    width: 100%; padding: 9px 10px;
    border: 1px solid #dbe6e3; border-radius: 11px;
    background: #fff; color: #294458; text-align: left;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.shift-log-btn:hover { border-color: #9ed9cd; box-shadow: 0 8px 20px -16px rgba(15, 118, 110, .5); transform: translateY(-1px); }
.shift-log-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 9px; background: #e6fbf7; color: var(--primary); }
.shift-log-btn > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.shift-log-btn strong { font-size: 11.5px; font-weight: 700; }
.shift-log-btn small { font-size: 10px; color: var(--muted); }
.shift-log-btn > .icon { margin-left: auto; color: #8aa0b0; }
.sidebar-compliance { display: flex; align-items: center; gap: 6px; padding: 0 5px; font-size: 9.8px; color: #8aa0b0; }
.sidebar-compliance .icon { color: #7fb8ac; }

.sidebar-scrim { display: none; }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */
.topbar {
    position: sticky; top: 0; z-index: 45;
    min-height: var(--topbar-h);
    display: flex; align-items: center; gap: 22px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, .9);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mobile-menu { display: none; }
.page-heading { min-width: 0; }
.page-heading-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-heading h1 { font-size: 20px; font-weight: 760; letter-spacing: -.025em; color: var(--ink); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-subtitle { font-size: 10.8px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compliance-pill {
    display: inline-flex; align-items: center; gap: 5px;
    height: 22px; padding: 0 8px;
    border-radius: 999px;
    background: #f1f6f8; border: 1px solid #e1eaef;
    color: #60788a; font-size: 9.3px; font-weight: 650; letter-spacing: .025em;
    white-space: nowrap;
}
.compliance-pill .icon { color: #3d9e8d; }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-divider { width: 1px; height: 24px; background: var(--border); margin: 0 2px; }
.global-search {
    display: flex; align-items: center; gap: 8px;
    width: 268px; height: 36px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: 9px;
    background: #f9fbfc; color: var(--muted);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.global-search:focus-within { border-color: #83cfc5; background: #fff; box-shadow: 0 0 0 3px rgba(13, 148, 136, .08); }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11.5px; color: var(--text); }
.global-search input::placeholder { color: #90a3b3; }
.global-search kbd { flex: 0 0 auto; }
kbd {
    display: inline-grid; place-items: center;
    min-width: 19px; height: 19px; padding: 0 5px;
    border: 1px solid #dbe4eb; border-bottom-width: 2px; border-radius: 5px;
    background: #fff; color: #7b8fa0; font-size: 9.5px; font-family: var(--font); font-weight: 650;
}

.icon-btn {
    position: relative;
    width: 36px; height: 36px;
    display: inline-grid; place-items: center;
    border: 1px solid transparent; border-radius: 9px;
    background: transparent; color: #60788a;
    transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: #f2f7f8; color: var(--ink); border-color: #e6edf1; }
.icon-btn.has-indicator { border-color: var(--border); background: #fff; }
.notification-count {
    position: absolute; top: -4px; right: -4px;
    min-width: 16px; height: 16px; padding: 0 4px;
    display: grid; place-items: center;
    border: 2px solid #fff; border-radius: 999px;
    background: #dc2626; color: #fff; font-size: 8.5px; font-weight: 800;
}

.user-trigger {
    display: flex; align-items: center; gap: 8px;
    height: 40px; padding: 3px 7px 3px 3px;
    border: 1px solid transparent; border-radius: 10px;
    list-style: none; cursor: pointer;
}
.user-trigger::-webkit-details-marker, .dropdown summary::-webkit-details-marker { display: none; }
.user-trigger:hover { background: #f5f9f9; border-color: #e7eef1; }
.user-trigger-copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-trigger-copy strong { font-size: 11px; font-weight: 700; color: var(--ink); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-trigger-copy small { font-size: 9.3px; color: var(--muted); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-trigger > .icon { color: #8ba0b0; }

.avatar {
    display: inline-grid; place-items: center;
    width: 38px; height: 38px; border-radius: 11px;
    color: #fff; font-size: 12px; font-weight: 750; letter-spacing: .01em;
    flex: 0 0 auto;
}
.avatar-sm { width: 32px; height: 32px; border-radius: 9px; font-size: 10.5px; }
.avatar-lg { width: 52px; height: 52px; border-radius: 14px; font-size: 16px; }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 80;
    width: 284px;
    border: 1px solid var(--border); border-radius: 14px;
    background: #fff; box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: dropdown-in .14s ease-out;
}
@keyframes dropdown-in { from { opacity: 0; transform: translateY(-5px) scale(.99); } }
.dropdown-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 16px 12px; border-bottom: 1px solid #eef3f5; }
.dropdown-panel-head > div { display: flex; flex-direction: column; gap: 2px; }
.dropdown-panel-head strong { font-size: 12px; color: var(--ink); }
.dropdown-panel-head span { font-size: 10px; color: var(--muted); }
.dropdown-panel-foot { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 11px; border-top: 1px solid #eef3f5; background: #fbfdfd; font-size: 10.5px; font-weight: 700; }
.notification-panel { width: 370px; }
.notification-list { max-height: 370px; overflow-y: auto; }
.notification-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #f1f5f7; transition: background .15s; }
.notification-item:hover { background: #f8fcfb; }
.notification-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; flex: 0 0 auto; }
.tone-danger { background: var(--red-soft); color: var(--red); }
.tone-warning { background: var(--amber-soft); color: var(--amber); }
.tone-success { background: var(--green-soft); color: var(--green); }
.tone-info { background: var(--blue-soft); color: var(--blue); }
.tone-neutral { background: #f1f5f9; color: #475569; }
.tone-teal { background: var(--primary-wash); color: var(--primary); }
.notification-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.notification-copy strong { font-size: 10.8px; font-weight: 690; color: var(--text); line-height: 1.4; }
.notification-copy small { font-size: 9.8px; color: var(--muted); line-height: 1.4; }
.notification-item > .icon { margin-left: auto; color: #a3b3c0; margin-top: 5px; }
.notification-empty { display: grid; justify-items: center; gap: 3px; padding: 30px 20px; text-align: center; }
.empty-check { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #ecfdf5; color: var(--green); margin-bottom: 5px; }
.notification-empty strong { font-size: 12px; }
.notification-empty p { font-size: 10.5px; color: var(--muted); }

.user-panel { width: 294px; }
.user-panel-head { display: flex; align-items: center; gap: 11px; padding: 16px; border-bottom: 1px solid #eef3f5; }
.user-panel-head > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
.user-panel-head strong { font-size: 12.5px; }
.user-panel-head span { font-size: 10.3px; color: var(--muted); }
.user-panel-head small { font-size: 9.6px; color: #7d938f; margin-top: 2px; }
.menu-list { padding: 6px; }
.menu-item {
    display: flex; align-items: center; gap: 9px;
    width: 100%; padding: 9px 10px;
    border: 0; border-radius: 8px; background: transparent;
    color: #40576a; font-size: 11.3px; font-weight: 570; text-align: left;
}
.menu-item:hover { background: #f4f8f8; color: var(--ink); }
.menu-item .icon { color: #8398a9; }
.menu-logout { padding: 6px; border-top: 1px solid #eef3f5; }
.menu-item-danger { color: #b91c1c; }
.menu-item-danger .icon { color: #dc2626; }
.menu-item-danger:hover { background: #fef2f2; color: #991b1b; }

/* --------------------------------------------------------------------------
   Page structure
   -------------------------------------------------------------------------- */
.page { flex: 1; width: 100%; max-width: 1560px; margin: 0 auto; padding: 24px 28px 34px; }
.app-footer {
    display: flex; align-items: center; gap: 10px;
    padding: 15px 28px 20px;
    color: #8ba0b0; font-size: 9.8px;
}
.footer-sep { width: 3px; height: 3px; border-radius: 50%; background: #b5c4ce; }
.footer-spacer { flex: 1; }
.footer-status { display: inline-flex; align-items: center; gap: 6px; }

.page-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.page-toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.page-intro { margin-bottom: 20px; }
.page-intro h2 { font-size: 18px; letter-spacing: -.02em; color: var(--ink); }
.page-intro p { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.subtle { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 10.6px; letter-spacing: -.01em; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--red) !important; }
.text-warning { color: var(--amber) !important; }
.text-success { color: var(--green) !important; }
.text-primary { color: var(--primary) !important; }
.fw-700 { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.full-width { width: 100%; }
.muted-icon { color: #a3b3c0; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.micro-label {
    font-size: 9.5px; font-weight: 760; letter-spacing: .1em;
    text-transform: uppercase; color: var(--muted);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 38px; padding: 0 14px;
    border: 1px solid transparent; border-radius: 9px;
    font-size: 11.8px; font-weight: 680; line-height: 1; white-space: nowrap;
    transition: transform .12s, box-shadow .15s, background .15s, border-color .15s, color .15s;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .nav-link:focus-visible, .input:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(13, 148, 136, .16); }
.btn-primary {
    background: linear-gradient(180deg, #0f8077 0%, #0f766e 100%);
    color: #fff; border-color: #0c655d;
    box-shadow: 0 6px 14px -10px rgba(15, 118, 110, .65);
}
.btn-primary:hover { background: linear-gradient(180deg, #0d8c81 0%, #0f675f 100%); color: #fff; box-shadow: 0 10px 20px -12px rgba(15, 118, 110, .7); }
.btn-secondary { background: #fff; border-color: var(--border-strong); color: #345065; box-shadow: var(--shadow-xs); }
.btn-secondary:hover { border-color: #a9becb; background: #fbfdfd; color: var(--ink); }
.btn-ghost { background: transparent; border-color: transparent; color: #526b7e; }
.btn-ghost:hover { background: #eef5f4; color: var(--primary-strong); }
.btn-soft { background: #eef8f6; border-color: #d5eee9; color: #0f6d64; }
.btn-soft:hover { background: #e2f7f2; border-color: #b7e5dc; color: #0b5c54; }
.btn-warning { background: #fffbeb; border-color: #f5d78a; color: #9a5b06; }
.btn-warning:hover { background: #fef3c7; color: #7c4703; }
.btn-danger-soft { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.btn-danger-soft:hover { background: #fee2e2; border-color: #fca5a5; }
.btn-danger { background: #b91c1c; border-color: #991b1b; color: #fff; }
.btn-danger:hover { background: #991b1b; color: #fff; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 10.6px; border-radius: 8px; gap: 5px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 12.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-link { height: auto; padding: 0; border: 0; background: none; color: var(--primary); font-size: inherit; }
.btn-link:hover { color: var(--primary-strong); }

.link-arrow { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 690; }
.link-arrow .icon { transition: transform .15s; }
.link-arrow:hover .icon { transform: translateX(2px); }

/* --------------------------------------------------------------------------
   Cards, KPI and grids
   -------------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    min-width: 0;
}
.card-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 17px 20px 14px;
    border-bottom: 1px solid #edf2f5;
}
.card-header.borderless { border-bottom: 0; padding-bottom: 2px; }
.card-title { font-size: 13px; font-weight: 730; color: var(--ink); letter-spacing: -.01em; display: flex; align-items: center; gap: 7px; }
.card-title .icon { color: var(--primary); }
.card-subtitle { font-size: 10.3px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 14px 16px; }
.card-footer { padding: 12px 20px; border-top: 1px solid #edf2f5; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10.3px; font-weight: 640; }
.card-link:hover { color: var(--primary); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); }
.grid-1-2 { grid-template-columns: minmax(320px, 1fr) minmax(0, 1.55fr); }
.grid-3-1 { grid-template-columns: minmax(0, 2.3fr) minmax(300px, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card {
    position: relative;
    padding: 17px 18px 15px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.kpi-card::after {
    content: ""; position: absolute; inset: 0 0 auto auto; width: 92px; height: 92px;
    background: radial-gradient(circle at top right, var(--kpi-glow, rgba(13,148,136,.09)), transparent 70%);
    pointer-events: none;
}
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.kpi-label { font-size: 10.5px; font-weight: 680; color: #5d7486; letter-spacing: .005em; }
.kpi-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--primary-wash); color: var(--primary); }
.kpi-icon.tone-blue { background: #eff6ff; color: #2563eb; }
.kpi-icon.tone-amber { background: #fffbeb; color: #b45309; }
.kpi-icon.tone-red { background: #fef2f2; color: #b91c1c; }
.kpi-icon.tone-purple { background: #f5f3ff; color: #6d28d9; }
.kpi-value { margin-top: 8px; font-size: 28px; line-height: 1.05; font-weight: 760; letter-spacing: -.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 9.9px; color: var(--muted); flex-wrap: wrap; }
.trend { display: inline-flex; align-items: center; gap: 2px; font-size: 9.8px; font-weight: 700; color: var(--green); }
.trend.down { color: var(--red); }
.trend.flat { color: var(--muted); }
.kpi-foot .sep { width: 3px; height: 3px; border-radius: 50%; background: #c0cdd6; }

.stat-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #e9eff3; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-top: 16px; }
.stat-strip-item { background: #fbfdfd; padding: 13px 16px; text-align: center; }
.stat-strip-label { font-size: 8.7px; letter-spacing: .1em; font-weight: 750; text-transform: uppercase; color: #7e94a5; }
.stat-strip-value { margin-top: 4px; font-size: 18px; line-height: 1.2; font-weight: 750; letter-spacing: -.02em; color: var(--ink); }
.stat-strip-value.green { color: var(--green); }
.stat-strip-value.amber { color: var(--amber); }
.stat-strip-value.red { color: var(--red); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-heading h2 { font-size: 15px; font-weight: 740; letter-spacing: -.015em; color: var(--ink); }
.section-heading p { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* Dashboard specific */
.dashboard-main { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr); gap: 20px; align-items: start; }
.dashboard-column { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.status-breakdown { display: flex; flex-direction: column; gap: 16px; }
.status-line { display: flex; flex-direction: column; gap: 6px; }
.status-line-head { display: flex; align-items: center; gap: 8px; font-size: 10.8px; }
.status-line-head .status-name { font-weight: 630; color: #385266; }
.status-line-head .status-pct { color: var(--muted); font-size: 9.9px; }
.status-line-head .status-count { margin-left: auto; font-size: 10.5px; font-weight: 730; color: var(--ink); white-space: nowrap; }
.progress { height: 8px; border-radius: 999px; background: #edf2f4; overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; background: var(--bar, var(--primary-bright)); transition: width .8s cubic-bezier(.2,.7,.2,1); }
.progress-bar.teal { background: linear-gradient(90deg, #14b8a6, #0d9488); }
.progress-bar.amber { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.progress-bar.red { background: linear-gradient(90deg, #f87171, #ef4444); }
.progress-bar.blue { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.progress-sm { height: 6px; }

.metric-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid #edf2f5; }
.metric-mini { text-align: center; padding: 7px 8px; border-radius: 10px; background: #f9fbfc; border: 1px solid #edf2f5; }
.metric-mini span { display: block; font-size: 8.6px; text-transform: uppercase; letter-spacing: .08em; font-weight: 720; color: #7c91a2; }
.metric-mini strong { display: block; margin-top: 3px; font-size: 17px; color: var(--ink); letter-spacing: -.02em; font-weight: 760; }
.metric-mini strong.teal { color: var(--primary-bright); }
.metric-mini strong.amber { color: var(--amber); }

.sla-list { display: flex; flex-direction: column; }
.sla-item { padding: 13px 15px; border-bottom: 1px solid #eef3f5; transition: background .15s; }
.sla-item:last-child { border-bottom: 0; }
.sla-item:hover { background: #fbfdfd; }
.sla-item-top { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.sla-ticket { font-family: var(--mono); font-size: 9.8px; font-weight: 700; color: var(--red); }
.sla-priority { margin-left: auto; }
.sla-title { font-size: 11.8px; font-weight: 700; color: var(--text); line-height: 1.35; }
.sla-meta { font-size: 9.8px; color: var(--muted); margin-top: 1px; }
.sla-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: 9.5px; }
.sla-clock { display: inline-flex; align-items: center; gap: 4px; color: var(--amber); font-weight: 670; }
.sla-clock.is-overdue { color: var(--red); }
.sla-status { font-size: 9.3px; font-weight: 700; color: #5f7587; }
.queue-foot { padding: 12px 15px; border-top: 1px solid #edf2f5; }
.queue-foot a { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 10.3px; font-weight: 690; }

.upcoming-list { display: flex; flex-direction: column; }
.upcoming-item { display: flex; align-items: center; gap: 11px; padding: 11px 16px; border-bottom: 1px solid #f0f4f6; }
.upcoming-item:last-child { border-bottom: 0; }
.upcoming-date { width: 39px; flex: 0 0 auto; text-align: center; border-radius: 8px; background: #f6f9fa; border: 1px solid #e9eff2; padding: 5px 0; }
.upcoming-date strong { display: block; font-size: 13px; line-height: 1.1; color: var(--ink); }
.upcoming-date span { display: block; font-size: 7.7px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.upcoming-date.is-overdue { background: #fef2f2; border-color: #fecaca; }
.upcoming-date.is-overdue strong { color: var(--red); }
.upcoming-copy { min-width: 0; flex: 1; }
.upcoming-copy strong { display: block; font-size: 10.8px; font-weight: 670; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-copy span { display: block; font-size: 9.4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-copy .upcoming-kind { color: #7b9080; }

.activity-list { padding: 3px 16px 10px; }
.activity-item { position: relative; display: flex; gap: 10px; padding: 9px 0 9px 4px; }
.activity-item::before { content: ""; position: absolute; left: 14px; top: 31px; bottom: -8px; width: 1px; background: #e8eff2; }
.activity-item:last-child::before { display: none; }
.activity-avatar { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 8.2px; font-weight: 750; flex: 0 0 auto; z-index: 1; border: 2px solid #fff; }
.activity-copy { min-width: 0; padding-top: 2px; }
.activity-copy p { font-size: 9.9px; line-height: 1.4; color: #40586a; }
.activity-copy strong { font-weight: 720; color: var(--ink); }
.activity-copy time { display: block; margin-top: 1px; font-size: 8.8px; color: #96a8b5; }

.mini-chart { display: flex; align-items: flex-end; gap: 10px; height: 88px; padding: 4px 2px 0; }
.mini-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.mini-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 100%; }
.mini-bar { width: 7px; min-height: 2px; border-radius: 3px 3px 1px 1px; background: #d8e5e8; }
.mini-bar.logged { background: #99f6e4; }
.mini-bar.resolved { background: var(--primary-bright); }
.mini-chart-col span { font-size: 8.2px; color: #92a5b4; font-weight: 650; }
.chart-legend { display: flex; align-items: center; gap: 12px; font-size: 8.8px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot { width: 6px; height: 6px; border-radius: 2px; background: #99f6e4; }
.legend-dot.dark { background: var(--primary-bright); }

.alert-card { border-left: 3px solid #f59e0b; }
.alert-card.danger { border-left-color: #ef4444; }
.alert-card-inner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde8b5; }
.alert-card-inner.danger { background: #fef2f2; border-color: #fecaca; }
.alert-card-inner .icon { color: #b45309; margin-top: 1px; }
.alert-card-inner.danger .icon { color: #b91c1c; }
.alert-card-inner strong { display: block; font-size: 10.8px; color: #7c4703; }
.alert-card-inner.danger strong { color: #991b1b; }
.alert-card-inner p { font-size: 9.8px; color: #9a6a1f; margin-top: 2px; }
.alert-card-inner.danger p { color: #b45454; }

/* --------------------------------------------------------------------------
   Badges & chips
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    height: 20px; padding: 0 7px;
    border: 1px solid transparent; border-radius: 999px;
    font-size: 8.9px; font-weight: 720; line-height: 1; letter-spacing: .01em;
    white-space: nowrap;
}
.badge-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge-success { background: #ecfdf5; border-color: #bbf7d0; color: #047857; }
.badge-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.badge-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.badge-info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.badge-teal { background: #f0fdfa; border-color: #99f6e4; color: #0f766e; }
.badge-purple { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }
.badge-neutral { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
.badge-lg { height: 23px; padding: 0 9px; font-size: 9.5px; }

.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 8px; border-radius: 6px;
    background: #f4f8f9; border: 1px solid #e7eef2;
    color: #547082; font-size: 9.4px; font-weight: 620;
}
.chip .icon { color: #7d95a7; }
.chip-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.risk-dot { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; display: inline-block; margin-right: 5px; }
.risk-dot.high { background: #ef4444; }
.risk-dot.medium { background: #f59e0b; }
.risk-dot.low { background: #10b981; }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-card { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.data-table th {
    padding: 10px 15px;
    background: #f8fafb;
    border-bottom: 1px solid var(--border);
    color: #778d9e; font-size: 8.7px; font-weight: 760; letter-spacing: .095em; text-transform: uppercase;
    text-align: left; white-space: nowrap;
}
.data-table td { padding: 12px 15px; border-bottom: 1px solid #edf2f5; vertical-align: middle; font-size: 10.8px; color: #40576a; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #fbfdfd; }
.data-table .cell-title { display: flex; flex-direction: column; gap: 1px; min-width: 150px; }
.data-table .cell-title strong { font-size: 11.2px; font-weight: 690; color: var(--ink); line-height: 1.35; }
.data-table .cell-title span { font-size: 9.2px; color: var(--muted); }
.data-table .cell-actions { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.data-table .num { font-variant-numeric: tabular-nums; }
.data-table .muted { color: var(--muted); }
.row-danger { background: #fffafa; }
.table-empty { padding: 38px 20px; }

.table-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid #edf2f5; background: #fff; }
.table-toolbar .search-field { flex: 1 1 240px; max-width: 340px; }
.table-toolbar .toolbar-right { display: flex; align-items: center; gap: 7px; margin-left: auto; flex-wrap: wrap; }
.filter-select { height: 32px; padding: 0 28px 0 9px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 10px; color: #536b7d; }
.filter-select:focus { outline: 0; border-color: #83cfc5; box-shadow: 0 0 0 3px rgba(13,148,136,.08); }

.search-field {
    display: flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: 9px; background: #fbfcfd;
    color: #8ca0b0;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.search-field:focus-within { border-color: #83cfc5; background: #fff; box-shadow: 0 0 0 3px rgba(13, 148, 136, .08); }
.search-field input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 10.8px; color: var(--text); }
.search-field input::placeholder { color: #9aacb9; }
.search-field .icon { flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid .full, .form-grid-3 .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 10.2px; font-weight: 680; color: #40586a; display: flex; align-items: center; gap: 3px; }
.required { color: #dc2626; font-weight: 700; }
.input {
    width: 100%; height: 38px; padding: 0 11px;
    border: 1px solid var(--border-strong); border-radius: 8px;
    background: #fff; color: var(--text); font-size: 11.3px;
    transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 86px; padding: 9px 11px; line-height: 1.5; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23748b9c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.input:focus { outline: 0; border-color: #5ec2b7; box-shadow: 0 0 0 3px rgba(13, 148, 136, .1); }
.input::placeholder { color: #9aacb9; font-size: 10.8px; }
.input:disabled { background: #f5f8fa; color: #8ca0b0; cursor: not-allowed; }
.field-help { font-size: 9.3px; color: #8ca0b0; line-height: 1.4; }
.field-error { font-size: 9.4px; color: #b91c1c; font-weight: 600; }
.field.is-invalid .input { border-color: #f87171; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 8px 0 0 8px; }
.input-group-addon { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 8px 8px 0; background: #f7fafb; color: #7890a1; font-size: 10.5px; font-weight: 650; }

.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 10.8px; color: #40586a; cursor: pointer; }
.checkbox input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--primary); flex: 0 0 auto; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; }
.radio-pill span { display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 10.2px; font-weight: 620; color: #5d7486; cursor: pointer; }
.radio-pill input:checked + span { border-color: #7ed7cb; background: #f0fdfa; color: #0f6d64; box-shadow: inset 0 0 0 1px #b7ece3; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 10.5px; color: #526b7e; }
.switch input { position: absolute; opacity: 0; }
.switch-track { width: 34px; height: 19px; border-radius: 999px; background: #cbd5e1; transition: background .15s; position: relative; flex: 0 0 auto; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--primary-bright); }
.switch input:checked + .switch-track::after { transform: translateX(15px); }

.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 4px; flex-wrap: wrap; }
.form-actions .left { margin-right: auto; }
.form-section { padding: 20px; border-bottom: 1px solid #edf2f5; }
.form-section:last-child { border-bottom: 0; }
.form-section-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 15px; }
.form-section-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: #f0fdfa; color: var(--primary); }
.form-section-head h2 { font-size: 12.4px; font-weight: 730; color: var(--ink); }
.form-section-head p { font-size: 9.8px; color: var(--muted); margin-top: 1px; }
.form-note { display: flex; gap: 8px; padding: 10px 12px; border: 1px solid #dcece9; border-radius: 9px; background: #f5fbfa; font-size: 9.9px; color: #4d6f6a; }
.form-note .icon { color: var(--primary); margin-top: 1px; }

/* --------------------------------------------------------------------------
   Filter bars and tabs
   -------------------------------------------------------------------------- */
.filter-bar {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid var(--border); border-radius: 12px; background: #fff;
    box-shadow: var(--shadow-xs);
    margin-bottom: 16px;
}
.filter-bar .search-field { flex: 1 1 280px; max-width: 420px; }
.filter-bar .spacer { flex: 1; }
.filter-bar .filter-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.filter-label { display: inline-flex; align-items: center; gap: 5px; font-size: 9.4px; color: #7c91a2; font-weight: 650; }
.filter-label .icon { color: #8da1af; }

.tabs { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: #f7fafb; }
.tab { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #657c8e; font-size: 9.9px; font-weight: 650; }
.tab:hover { color: var(--ink); }
.tab.is-active { background: #fff; color: var(--primary-strong); box-shadow: 0 1px 3px rgba(11,31,51,.08); }

.segmented { display: inline-flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented a, .segmented button { padding: 6px 10px; background: #fff; border: 0; border-right: 1px solid var(--border); font-size: 9.8px; font-weight: 630; color: #61788a; }
.segmented a:last-child, .segmented button:last-child { border-right: 0; }
.segmented a.is-active, .segmented button.is-active { background: #eef8f6; color: #0f6d64; }

/* --------------------------------------------------------------------------
   Tiers, avatars, metadata
   -------------------------------------------------------------------------- */
.tier { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 999px; font-size: 8.7px; font-weight: 750; letter-spacing: .02em; border: 1px solid; }
.tier-platinum { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }
.tier-gold { background: #fffbeb; border-color: #fde68a; color: #a16207; }
.tier-silver { background: #f8fafc; border-color: #dbe3ea; color: #52677a; }
.tier-standard { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }

.person { display: flex; align-items: center; gap: 7px; min-width: 0; }
.person-copy { display: flex; flex-direction: column; min-width: 0; }
.person-copy strong { font-size: 10.4px; font-weight: 670; line-height: 1.3; }
.person-copy span { font-size: 9px; color: var(--muted); line-height: 1.3; }

.meta-list { display: flex; flex-direction: column; gap: 6px; }
.meta-row { display: flex; align-items: flex-start; gap: 7px; font-size: 10.1px; color: #526b7e; }
.meta-row .icon { color: #8da4b4; margin-top: 1px; }
.meta-row strong { color: #314a5e; font-weight: 670; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 20px; }
.detail-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-item { min-width: 0; }
.detail-item dt { font-size: 9.2px; color: #869baa; font-weight: 620; margin-bottom: 2px; }
.detail-item dd { font-size: 10.8px; color: #2b4356; font-weight: 580; line-height: 1.45; overflow-wrap: break-word; }
.detail-item dd strong { font-weight: 710; color: var(--ink); }

.terms-box { padding: 12px 14px; border: 1px solid #e2ecef; border-radius: 10px; background: #f8fbfb; font-size: 10px; line-height: 1.55; color: #4d6577; }

/* --------------------------------------------------------------------------
   Empty states
   -------------------------------------------------------------------------- */
.empty-state { display: grid; justify-items: center; text-align: center; gap: 5px; padding: 44px 22px; }
.empty-state-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #f0f6f7; border: 1px solid #e3edf0; color: #7b95a7; margin-bottom: 5px; }
.empty-state h3 { font-size: 13px; color: var(--ink); font-weight: 720; }
.empty-state p { max-width: 360px; font-size: 10.5px; color: var(--muted); }
.empty-state-actions { margin-top: 9px; display: flex; gap: 7px; }

/* --------------------------------------------------------------------------
   Modals, toasts, help
   -------------------------------------------------------------------------- */
dialog.modal {
    width: min(560px, calc(100vw - 30px));
    max-height: calc(100vh - 50px);
    padding: 0; border: 1px solid #dbe6eb; border-radius: 16px;
    background: #fff; box-shadow: var(--shadow-lg);
    color: var(--text);
    overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in .18s cubic-bezier(.2,.8,.2,1); }
dialog.modal::backdrop { background: rgba(11, 31, 51, .46); backdrop-filter: blur(3px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
dialog.modal-sm { width: min(460px, calc(100vw - 30px)); }
dialog.modal-lg { width: min(820px, calc(100vw - 30px)); }
dialog.modal-xl { width: min(1020px, calc(100vw - 30px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 19px 22px 15px; border-bottom: 1px solid #edf2f5; flex: 0 0 auto; }
.modal-head h2 { font-size: 15px; font-weight: 740; letter-spacing: -.015em; color: var(--ink); }
.modal-head p { font-size: 10.3px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #edf2f5; flex-wrap: wrap; }
.modal-actions .left { margin-right: auto; }

.toast-stack { position: fixed; top: 84px; right: 22px; z-index: 120; display: flex; flex-direction: column; gap: 8px; width: min(390px, calc(100vw - 32px)); pointer-events: none; }
.toast {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 12px 13px;
    border: 1px solid var(--border); border-radius: 11px; background: #fff;
    box-shadow: 0 18px 45px -22px rgba(11,31,51,.38);
    font-size: 10.5px; line-height: 1.45; color: #355064;
    pointer-events: auto; animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(8px); } }
.toast-success { border-left: 3px solid #10b981; }
.toast-danger { border-left: 3px solid #ef4444; }
.toast-icon { margin-top: 1px; color: #059669; }
.toast-danger .toast-icon { color: #dc2626; }
.toast > div { flex: 1; }
.toast strong { font-weight: 720; color: var(--ink); }
.toast ul { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; }
.toast li { font-size: 9.8px; color: #7f4a4a; }
.toast-close { border: 0; background: transparent; color: #9aacb9; padding: 0 2px; }
.toast-close:hover { color: var(--ink); }

.help-fab {
    position: fixed; right: 22px; bottom: 20px; z-index: 40;
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 12px;
    border: 1px solid #d9e5e8; border-radius: 999px;
    background: rgba(255,255,255,.94); color: #43606f;
    font-size: 10.2px; font-weight: 670;
    box-shadow: 0 10px 30px -18px rgba(11,31,51,.45);
    backdrop-filter: blur(8px);
    transition: border-color .15s, transform .15s;
}
.help-fab .icon { color: var(--primary); }
.help-fab:hover { border-color: #a8d8cf; transform: translateY(-1px); color: var(--primary-strong); }
@media print { .help-fab { display: none !important; } }

.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.help-card { padding: 13px; border: 1px solid #e5edf0; border-radius: 10px; background: #fbfdfd; }
.help-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; background: #eef8f6; color: var(--primary); margin-bottom: 8px; }
.help-card h3 { font-size: 11px; color: var(--ink); }
.help-card p { font-size: 9.6px; color: var(--muted); line-height: 1.5; margin-top: 3px; }
.shortcut-list { display: flex; flex-direction: column; gap: 7px; margin-top: 15px; padding-top: 13px; border-top: 1px solid #edf2f5; }
.shortcut-list div { display: flex; align-items: center; gap: 5px; font-size: 10px; color: #4e6779; }
.shortcut-list span { margin-right: auto; }
.shortcut-list kbd { margin-left: 3px; }

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid #edf2f5; flex-wrap: wrap; }
.pagination-info { font-size: 9.6px; color: var(--muted); }
.pagination-info strong { color: #3f586b; font-weight: 680; }
.pagination-links { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.page-link { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; color: #5d7486; font-size: 9.8px; font-weight: 620; }
a.page-link:hover { background: #f3f8f8; border-color: #e4edef; color: var(--ink); }
.page-link.is-active { background: #0f766e; border-color: #0f766e; color: #fff; }
.page-link.is-disabled { opacity: .4; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1320px) {
    .kpi-grid { gap: 12px; }
    .global-search { width: 220px; }
    .user-trigger-copy { display: none; }
}

@media (max-width: 1180px) {
    :root { --sidebar-w: 232px; }
    .page { padding-left: 20px; padding-right: 20px; }
    .topbar { padding-left: 20px; padding-right: 20px; }
    .dashboard-main { grid-template-columns: 1fr; }
    .dashboard-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .global-search { display: none; }
}

@media (max-width: 980px) {
    :root { --sidebar-w: 0px; }
    .sidebar { transform: translateX(-102%); transition: transform .22s ease; width: 258px; box-shadow: 0 20px 60px rgba(11,31,51,.18); }
    .sidebar.is-open { transform: translateX(0); }
    .sidebar .sidebar-close, .mobile-menu { display: inline-grid; }
    .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(11,31,51,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
    .sidebar-scrim.is-visible { opacity: 1; pointer-events: auto; }
    .app-main { margin-left: 0; }
    .compliance-pill { display: none; }
    .topbar { min-height: 64px; }
    .dashboard-column { grid-template-columns: 1fr; }
    .grid-2, .grid-2-1, .grid-1-2, .grid-3-1 { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: auto; }
    .hide-on-mobile { display: none !important; }
}

@media (max-width: 720px) {
    body { font-size: 13px; }
    .page { padding: 16px 14px 30px; }
    .topbar { padding: 10px 14px; }
    .page-subtitle { display: none; }
    .page-heading h1 { font-size: 17px; }
    .topbar-actions { gap: 4px; }
    .topbar-divider { display: none; }
    .user-trigger { padding: 2px; }
    .user-trigger > .icon { display: none; }
    .btn .hide-on-small { display: none; }
    .btn .show-on-small { display: inline; }
    .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .kpi-card { padding: 13px; }
    .kpi-value { font-size: 23px; }
    .kpi-icon { width: 31px; height: 31px; }
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .detail-grid, .detail-grid-3 { grid-template-columns: 1fr; }
    .stat-strip { grid-template-columns: 1fr; }
    .metric-strip { grid-template-columns: 1fr; }
    .filter-bar { padding: 10px; }
    .filter-bar .search-field { flex-basis: 100%; max-width: none; }
    .table-toolbar { padding: 10px; }
    .table-toolbar .search-field { max-width: none; flex-basis: 100%; }
    .toast-stack { top: 74px; right: 12px; }
    .help-fab { right: 12px; bottom: 12px; }
    .help-grid { grid-template-columns: 1fr; }
    .notification-panel { width: min(340px, calc(100vw - 24px)); }
    .user-panel { width: min(294px, calc(100vw - 24px)); }
    .app-footer { padding: 12px 14px 18px; flex-wrap: wrap; }
    .footer-sep, .footer-status { display: none; }
    .pagination { justify-content: center; }
    .pagination-links { margin-left: 0; }
    .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
}

.show-on-small { display: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

