@font-face {
    font-family: "Google Sans Flex";
    font-style: normal;
    font-weight: 400 900;
    font-stretch: 100%;
    font-display: swap;
    src: url("/static/fonts/google-sans-flex-latin.woff2") format("woff2");
}

:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-muted: #f2f4f8;
    --surface-tint: #f1fbf9;
    --text: #182033;
    --text-strong: #0f172a;
    --text-muted: #667085;
    --border: #e2e7f0;
    --border-strong: #cbd3e1;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --accent-soft: #e7f6f3;
    --accent-glow: rgba(15, 118, 110, .18);
    --success: #087a55;
    --success-soft: #e8f8f1;
    --warning: #b45309;
    --warning-soft: #fff5e7;
    --danger: #c4324a;
    --danger-soft: #fff0f2;
    --pending: #667085;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-lg: 0 24px 70px rgba(38, 42, 73, .14);
    --sidebar-width: 272px;
    --header-height: 78px;
    font-family: "Google Sans Flex", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
body:not(.auth-body) { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
form { margin: 0; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--text-strong); letter-spacing: -.025em; }
code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .9em; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 14px; transform: translateY(-160%); border-radius: 10px; background: var(--text-strong); color: #fff; box-shadow: var(--shadow-sm); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid rgba(13, 148, 136, .32); outline-offset: 2px; }

/* App shell */
.app-shell { width: 100vw; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.sidebar { position: relative; display: flex; min-height: 0; flex-direction: column; overflow: hidden; background: linear-gradient(180deg, #102525 0%, #142f2d 100%); color: #ecfdfb; border-right: 1px solid rgba(255,255,255,.07); }
.sidebar::before { content: ""; position: absolute; width: 260px; height: 260px; top: -170px; left: -100px; border-radius: 50%; background: rgba(20,184,166,.2); filter: blur(20px); pointer-events: none; }
.brand { position: relative; height: var(--header-height); display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #14b8a6, #0f766e); color: #fff; font-size: 18px; font-weight: 800; box-shadow: 0 8px 22px rgba(15,118,110,.3), inset 0 1px rgba(255,255,255,.3); }
.brand-copy, .auth-brand > span:last-child, .sidebar-footer > span:last-child { display: grid; line-height: 1.25; }
.brand-copy strong { font-size: 16px; letter-spacing: -.02em; }
.brand-copy small, .sidebar-footer small, .auth-brand small { color: #aeb7d0; font-size: 11px; font-weight: 500; letter-spacing: .02em; }
.nav { position: relative; flex: 1; overflow-y: auto; padding: 18px 14px 24px; scrollbar-width: thin; }
.nav-label { display: block; margin: 18px 10px 7px; color: #7f89a6; font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.nav-link { position: relative; min-height: 44px; display: flex; align-items: center; gap: 11px; margin: 2px 0; padding: 9px 11px; border-radius: 10px; color: #bbc4dc; font-weight: 550; transition: background .15s ease, color .15s ease, transform .15s ease; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.nav-link.is-active { background: linear-gradient(90deg, rgba(20,184,166,.25), rgba(20,184,166,.08)); color: #fff; box-shadow: inset 0 0 0 1px rgba(94,234,212,.16); }
.nav-link.is-active::before { content: ""; position: absolute; left: -14px; width: 3px; height: 24px; border-radius: 0 4px 4px 0; background: #2dd4bf; box-shadow: 0 0 14px rgba(45,212,191,.7); }
.nav-group { margin: 3px 0; }
.nav-group summary { min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: #bbc4dc; font-weight: 600; cursor: pointer; list-style: none; transition: .15s ease; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover, .nav-group[open] > summary { background: rgba(255,255,255,.06); color: #fff; }
.nav-caret { margin-left: auto; font-size: 18px; line-height: 1; transition: transform .15s ease; }
.nav-group[open] .nav-caret { transform: rotate(90deg); }
.nav-submenu { display: grid; gap: 2px; padding: 3px 0 5px 31px; }
.nav-sub-link { min-height: 34px; display: flex; align-items: center; padding: 6px 10px; border-radius: 8px; color: #9faac4; font-size: 12px; font-weight: 550; }
.nav-sub-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-sub-link.is-active { background: rgba(20,184,166,.16); color: #7de3d7; }
[data-nav-permission]:not(.is-authorized) { display: none !important; }
.icon { width: 20px; height: 20px; flex: 0 0 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin: 0 14px 14px; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.04); }
.sidebar-footer strong { font-size: 12px; color: #dce2f3; }
.status-pulse { width: 9px; height: 9px; border-radius: 50%; background: #35d39a; box-shadow: 0 0 0 5px rgba(53,211,154,.12); }
.sidebar-tools { position: relative; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; margin: 0 14px 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-tools form { width: 100%; }
.sidebar-tools .install-app-button { grid-column: 1 / -1; }
.sidebar-tools .nav-link { min-height: 40px; justify-content: center; margin: 0; padding: 0; }
.sidebar-tools .nav-link > span:not(.notification-count) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sidebar-tool-button { width: 100%; border: 0; background: transparent; cursor: pointer; }
.notification-preferences { display: flex; align-items: center; gap: 8px; }
.update-panel-body { display: grid; gap: 20px; }
.update-checklist { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.update-check { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.update-check:nth-child(odd) { border-right: 1px solid var(--border); }
.update-check strong, .update-check span:last-child { display: block; }
.update-check span:last-child { margin-top: 2px; color: var(--text-muted); font-size: 12px; }
.status-dot { width: 9px; height: 9px; flex: 0 0 9px; margin-top: 6px; border-radius: 50%; background: var(--pending); }
.status-pass { background: var(--success); }.status-fail { background: var(--danger); }.status-warn { background: var(--warning); }
.sidebar-tools .notification-count { top: 4px; right: 4px; border-color: #102525; }
.drawer-backdrop { display: none; }

.main-shell { width: 100%; min-width: 0; height: 100vh; height: 100dvh; display: grid; grid-template-rows: var(--header-height) minmax(0, 1fr); }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 28px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); }
.topbar-title { display: grid; gap: 2px; }
.topbar-title > span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: 23px; line-height: 1.2; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.button-icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-button { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: #475467; cursor: pointer; box-shadow: var(--shadow-xs); transition: .15s ease; }
.icon-button:hover { border-color: #8cd8d0; background: var(--accent-soft); color: var(--accent); transform: translateY(-1px); }
.mobile-only { display: none; }
.workspace { min-height: 0; overflow: auto; padding: 0 0 100px; background-image: radial-gradient(circle at 85% 0%, rgba(13,148,136,.06), transparent 28%); }
.workspace-inner { width: 100%; height: 100%; min-height: 0; margin: 0; }
.session-warning { margin: 0 0 18px; border: 1px solid #f2cf9c; background: var(--warning-soft); color: #8a4607; border-radius: 12px; padding: 12px 15px; box-shadow: var(--shadow-xs); }

/* Page-specific fixed action footer */
.page-action-footer, .employee-profile .form-panel > .form-actions { position: fixed; z-index: 18; left: var(--sidebar-width); right: 0; bottom: 0; min-height: 76px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 0 !important; padding: 13px 28px calc(13px + env(safe-area-inset-bottom)) !important; border-top: 1px solid rgba(203,211,225,.9); background: rgba(255,255,255,.94); box-shadow: 0 -10px 32px rgba(15,23,42,.08); backdrop-filter: blur(18px); transition: left .18s ease; }
.page-action-footer > .button, .employee-profile .form-panel > .form-actions > .button { min-width: 0; flex: 1 1 0; }

body[data-sidebar-collapsed="true"] { --sidebar-width: 78px; }
body[data-sidebar-collapsed="true"] .brand { justify-content: center; padding-inline: 0; }
body[data-sidebar-collapsed="true"] .brand-copy, body[data-sidebar-collapsed="true"] .nav-label, body[data-sidebar-collapsed="true"] .sidebar-footer > span:last-child { display: none; }
body[data-sidebar-collapsed="true"] .nav-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body[data-sidebar-collapsed="true"] .nav { padding-inline: 11px; }
body[data-sidebar-collapsed="true"] .nav-link { justify-content: center; padding-inline: 0; }
body[data-sidebar-collapsed="true"] .nav-group summary { justify-content: center; padding-inline: 0; }
body[data-sidebar-collapsed="true"] .nav-group summary > span, body[data-sidebar-collapsed="true"] .nav-submenu { display: none; }
body[data-sidebar-collapsed="true"] .nav-link.is-active::before { left: -11px; }
body[data-sidebar-collapsed="true"] .sidebar-tools { margin-inline: 11px; }
body[data-sidebar-collapsed="true"] .sidebar-tools .nav-link { justify-content: center; padding-inline: 0; }
body[data-sidebar-collapsed="true"] .sidebar-tools .notification-count { width: auto; height: 19px; overflow: visible; clip-path: none; white-space: nowrap; }
body[data-sidebar-collapsed="true"] .sidebar-footer { justify-content: center; margin-inline: 11px; padding-inline: 0; }

/* Authentication and setup — intentionally no application sidebar */
.auth-body { min-height: 100vh; overflow: auto; background: #f7f7fc; }
.auth-shell { position: relative; min-height: 100vh; display: grid; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; }
.auth-shell::before, .auth-shell::after { content: ""; position: fixed; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.auth-shell::before { width: 520px; height: 520px; top: -300px; right: -150px; background: radial-gradient(circle, rgba(13,148,136,.14), transparent 68%); }
.auth-shell::after { width: 440px; height: 440px; bottom: -280px; left: -120px; background: radial-gradient(circle, rgba(14,165,233,.1), transparent 68%); }
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; width: min(100% - 40px, 1180px); margin: 0 auto; padding: 24px 0; }
.auth-brand strong { font-size: 17px; }
.auth-brand small { color: var(--text-muted); }
.auth-stage { position: relative; z-index: 1; width: min(100% - 40px, 1180px); margin: auto; display: grid; place-items: center; padding: 28px 0 48px; }
.auth-glow { position: absolute; width: 520px; height: 260px; border-radius: 50%; background: rgba(13,148,136,.08); filter: blur(70px); pointer-events: none; }
.auth-footer { position: relative; z-index: 1; display: flex; justify-content: space-between; width: min(100% - 40px, 1180px); margin: 0 auto; padding: 20px 0; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.auth-panel { position: relative; width: min(100%, 440px); display: grid; gap: 20px; padding: 34px; border: 1px solid rgba(255,255,255,.95); border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: var(--shadow-lg); backdrop-filter: blur(18px); }
.auth-heading { margin-bottom: 2px; }
.auth-heading h2 { margin: 0 0 6px; font-size: 28px; }
.auth-heading p { margin: 0; color: var(--text-muted); }
.auth-kicker, .eyebrow { display: block; margin-bottom: 8px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.auth-help { margin: -4px 0 0; color: var(--text-muted); font-size: 11px; text-align: center; }
.auth-panel .button.primary { width: 100%; min-height: 46px; }
.auth-body .form-panel { position: relative; width: min(100%, 1000px); }

/* First-run onboarding */
.auth-body .setup-panel { width: min(100%,820px); gap: 0; overflow: visible; margin-bottom: 74px; border: 1px solid rgba(255,255,255,.95); border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: var(--shadow-lg); }
.setup-heading { padding: 30px 32px 23px; border-bottom: 1px solid var(--border); }
.setup-heading h2 { margin: 0 0 7px; font-size: 30px; }
.setup-heading p { max-width: 620px; margin: 0; color: var(--text-muted); }
.setup-progress { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.setup-progress li { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 11px; font-weight: 750; }
.setup-progress li::after { content: ""; height: 2px; flex: 1; border-radius: 2px; background: var(--border); }
.setup-progress li:last-child::after { display: none; }
.setup-progress li span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-muted); color: var(--text-muted); }
.setup-progress li.is-active { color: var(--accent); }.setup-progress li.is-active span { background: var(--accent); color: #fff; }
.setup-panel > .form-alert { margin: 20px 28px 0; }
.setup-essential { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; padding: 26px 32px; }
.setup-password-field { grid-column: 1 / -1; }
.field-hint { color: var(--text-muted); font-weight: 450; }
.password-control { position: relative; display: block; }
.password-control input { padding-right: 68px; }
.password-control button { position: absolute; top: 5px; right: 5px; min-height: 34px; padding: 5px 10px; border: 0; border-radius: 8px; background: var(--surface-muted); color: var(--accent); font-size: 11px; font-weight: 750; cursor: pointer; }
.setup-advanced { margin: 0 32px 22px; overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: #fafbfe; }
.setup-advanced summary { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; cursor: pointer; list-style: none; }
.setup-advanced summary::-webkit-details-marker { display: none; }
.setup-advanced summary > span:first-child { display: grid; }.setup-advanced summary small { color: var(--text-muted); font-weight: 450; }
.setup-advanced summary > span:last-child { color: var(--accent); font-size: 11px; font-weight: 800; }
.setup-advanced[open] summary { border-bottom: 1px solid var(--border); }
.setup-advanced .form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.setup-actions { position: fixed; z-index: 18; left: 0; right: 0; bottom: 0; justify-content: space-between; margin: 0; padding: 13px max(28px,calc((100vw - 1180px) / 2)) calc(13px + env(safe-area-inset-bottom)) !important; border-top: 1px solid rgba(203,211,225,.9); background: rgba(255,255,255,.96); box-shadow: 0 -10px 32px rgba(15,23,42,.08); backdrop-filter: blur(14px); }
.setup-actions > span { display: grid; }.setup-actions small { color: var(--text-muted); font-weight: 450; }

/* Shared surfaces */
.page-grid, .employee-profile { display: grid; gap: 20px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-heading h2 { margin-bottom: 4px; font-size: 24px; }
.page-heading p { margin: 0; color: var(--text-muted); }
.panel, .form-section { overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-header, .section-heading { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #fff, #fcfcfe); }
.panel-header h2, .section-heading h2 { margin: 0; font-size: 17px; }
.table-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.muted-line { display: block; margin-top: 3px; color: var(--text-muted); font-size: 12px; font-weight: 450; }
.empty-state { display: grid; place-items: center; min-height: 150px; padding: 30px; color: var(--text-muted); text-align: center; }
.empty-state p { margin: 0; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 18px; }
.metric, .metric-card { position: relative; min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: linear-gradient(145deg, #fff, #f8f9ff); }
.metric::after, .metric-card::after { content: ""; position: absolute; width: 76px; height: 76px; right: -28px; top: -26px; border-radius: 50%; background: var(--accent-soft); }
.metric-label, .metric-card span { color: var(--text-muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.metric strong, .metric-card strong { color: var(--text-strong); font-size: 26px; letter-spacing: -.04em; }
.task-list { padding: 8px 20px 18px; }
.task-row { min-height: 48px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border: 0; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.status-dot.pending { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.dashboard-hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 30px; overflow: hidden; background: linear-gradient(125deg, #102525 0%, #164e4a 62%, #0f766e 130%); color: #fff; }
.dashboard-hero h2 { max-width: 720px; margin: 0 0 10px; color: #fff; font-size: clamp(24px,3vw,36px); line-height: 1.15; }
.dashboard-hero p { max-width: 720px; margin: 0; color: #c9cdea; }
.dashboard-hero .eyebrow { color: #7de3d7; }
.dashboard-hero .button { flex: 0 0 auto; border-color: rgba(255,255,255,.28); }
.quick-actions { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; padding: 18px; }
.quick-action { min-height: 92px; display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: #fafbfe; transition: .15s ease; }
.quick-action:hover { border-color: #8cd8d0; background: var(--accent-soft); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.quick-action > span:last-child { display: grid; gap: 3px; }
.quick-action small { color: var(--text-muted); }
.quick-action-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 20px; font-weight: 750; }

/* Forms */
.form-panel { width: 100%; display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 20px; }
.form-grid > .span-2, .form-grid > .field-span { grid-column: 1 / -1; }
label { display: grid; align-content: start; gap: 7px; color: #344054; font-size: 13px; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px; outline: none; background: #fff; color: var(--text); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
input:hover, select:hover, textarea:hover { border-color: #aeb8c8; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(15,118,110,.1); }
input[readonly] { background: var(--surface-muted); color: var(--text-muted); }
input[type="checkbox"], input[type="radio"] { width: 17px; min-height: 17px; accent-color: var(--accent); }
input[type="range"] { padding: 0; accent-color: var(--accent); }
.choice-field { display: grid; gap: 8px; min-width: 0; }
.choice-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-button { position: relative; min-height: 42px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 700; line-height: 1.25; text-align: left; cursor: pointer; box-shadow: var(--shadow-xs); transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease; }
.choice-button::before { content: ""; width: 16px; height: 16px; flex: 0 0 16px; display: inline-grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 5px; color: transparent; font-size: 11px; line-height: 1; }
.choice-button:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); transform: translateY(-1px); }
.choice-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-button.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent); }
.choice-button.is-selected::before { content: "✓"; border-color: var(--accent); background: var(--accent); color: #fff; }
.choice-button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.choice-native { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
.checkbox-row { grid-template-columns: 20px minmax(0,1fr); align-items: center; align-self: end; min-height: 44px; }
.compact-input { width: min(100%, 300px); }
.compact-field { display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.compact-field input { min-height: 38px; }
.linked-field { min-height: 44px; display: flex; align-items: center; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); color: var(--accent); }
.field-error, .danger-text { color: var(--danger); font-weight: 550; }
.form-alert { padding: 13px 15px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-xs); }
.form-alert.danger { border-color: #ffc7cf; background: var(--danger-soft); color: #9e2639; }
.form-alert.success { border-color: #b7ead8; background: var(--success-soft); color: #076443; }
.form-actions, .inline-form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.form-panel > .form-actions { padding: 0 2px 4px; }
.inline-form-actions { padding: 0 20px 20px; }
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; color: #344054; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-xs); transition: .15s ease; }
.button:hover { border-color: #8cd8d0; background: var(--accent-soft); color: var(--accent-strong); transform: translateY(-1px); }
.button.primary { border-color: var(--accent); background: linear-gradient(180deg, #138b81, var(--accent)); color: #fff; box-shadow: 0 7px 18px rgba(15,118,110,.2); }
.button.primary:hover { border-color: var(--accent-strong); background: var(--accent-strong); color: #fff; }
.button.small { min-height: 32px; padding: 5px 10px; border-radius: 8px; font-size: 12px; }

/* Lists and tables */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.list-toolbar input[type="search"] { width: min(100%, 310px); background: #fff; }
.list-toolbar select { width: auto; min-width: 155px; }
.toolbar-spacer { flex: 1; }
.status-pills { display: flex; align-items: center; gap: 5px; padding: 4px; overflow-x: auto; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-muted); scrollbar-width: none; }
.status-pills::-webkit-scrollbar { display: none; }
.status-pill { min-height: 31px; padding: 5px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 11px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.status-pill:hover { color: var(--accent); }
.status-pill.is-active { background: #fff; color: var(--accent); box-shadow: var(--shadow-xs); }
.panel:has(.column-menu[open]) { overflow: visible; }
.table-wrap { width: 100%; overflow: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data-table th { position: sticky; top: 0; z-index: 1; background: #f7f8fb; color: #667085; font-size: 11px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: #f4fbfa; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td strong { color: var(--text-strong); }
.sort-button { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.selection-cell { width: 44px; text-align: center !important; }
.selection-cell input { width: 16px; min-height: 16px; }
.action-cell { width: 100px; }
.column-menu { position: relative; }
.column-menu summary { list-style: none; }
.column-menu-panel { position: absolute; z-index: 12; top: calc(100% + 8px); right: 0; width: 210px; display: grid; gap: 4px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: var(--shadow-lg); }
.column-menu-panel label { grid-template-columns: 20px 1fr; align-items: center; padding: 6px; font-weight: 550; }
.column-menu-panel input { width: 16px; min-height: 16px; }
.list-footer { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--border); color: var(--text-muted); background: #fcfcfe; }
.pagination { display: flex; flex-wrap: wrap; gap: 5px; }
.page-button { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--text-muted); cursor: pointer; }
.page-button.is-active { border-color: var(--accent); background: var(--accent); color: #fff; }
.mobile-list { display: none; }
.mobile-list-card { padding: 16px; border-bottom: 1px solid var(--border); }
.mobile-list-card-header { display: flex; justify-content: space-between; gap: 12px; }
.mobile-list-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.mobile-list-fields span { display: block; color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.filter-sheet { position: fixed; z-index: 40; inset: 0 0 0 auto; width: min(400px,100%); padding: 22px; overflow: auto; border-left: 1px solid var(--border); background: #fff; box-shadow: -20px 0 60px rgba(15,23,42,.14); }
.filter-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.filter-options { display: grid; gap: 10px; }
.filter-options label { grid-template-columns: 20px 1fr; align-items: center; padding: 9px; border-radius: 9px; background: var(--surface-muted); }
.filter-options input { width: 16px; min-height: 16px; }

/* Status and domain components */
.badge { min-height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 3px 9px; border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.status-ACTIVE, .status-SUCCESS, .status-VERIFIED, .status-COMPLETED { background: var(--success-soft); color: var(--success); }
.status-INACTIVE, .status-FAILED, .status-REJECTED, .status-LOCKED { background: var(--danger-soft); color: var(--danger); }
.status-DRAFT, .status-PENDING, .status-RUNNING { background: var(--warning-soft); color: var(--warning); }
.status-MET { background: var(--success-soft); color: var(--success); }
.status-SHORT { background: var(--danger-soft); color: var(--danger); }
.status-NOT_APPLICABLE { background: var(--surface-muted); color: var(--text-muted); }
.status-SUPERSEDED, .status-EXPIRED { background: #eef0f4; color: #667085; }

.notification-bell.is-active { background: var(--accent-soft); color: var(--accent); }
.notification-count { position: absolute; top: -5px; right: -6px; min-width: 19px; height: 19px; padding: 0 4px; border: 2px solid #fff; border-radius: 999px; background: var(--danger); color: #fff; font-size: 9px; font-weight: 850; line-height: 15px; text-align: center; }
.notification-list { display: grid; }
.notification-item { display: grid; grid-template-columns: 9px minmax(0,1fr); gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.notification-item:last-child { border-bottom: 0; }
.notification-item.is-unread { background: linear-gradient(90deg, var(--accent-soft), #fff 65%); }
.notification-marker { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--pending); }
.notification-INFO .notification-marker { background: var(--accent); }.notification-SUCCESS .notification-marker { background: var(--success); }.notification-WARNING .notification-marker { background: var(--warning); }.notification-DANGER .notification-marker { background: var(--danger); }
.notification-heading { display: flex; justify-content: space-between; gap: 12px; }
.notification-heading time { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.notification-copy p { margin: 6px 0 0; color: var(--text-muted); }
.notification-actions { display: flex; gap: 8px; margin-top: 11px; }

.audit-filters { flex-wrap: wrap; }
.audit-filters > input[type="search"] { min-width: 230px; }
.audit-filters select { max-width: 270px; }
.audit-filter-error { margin: 15px 18px; }
.audit-table code { white-space: nowrap; color: var(--accent-strong); }
.audit-metadata { margin-top: 7px; }
.audit-metadata summary { color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700; }
.audit-metadata pre { max-width: 440px; margin: 8px 0 0; padding: 12px; overflow: auto; border: 1px solid var(--border); border-radius: 9px; background: #f7f8fb; font-size: 11px; white-space: pre-wrap; word-break: break-word; }
.checksum { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent-strong); }
.backup-grid { max-width: none; }

.profile-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 22px; background: linear-gradient(135deg, #fff, #f1fbf9); }
.profile-header h2 { margin: 0; font-size: 22px; }
.profile-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 6px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.8); box-shadow: var(--shadow-xs); scrollbar-width: thin; }
.profile-tab { padding: 9px 13px; border-radius: 9px; color: var(--text-muted); white-space: nowrap; font-size: 12px; font-weight: 700; }
.profile-tab:hover { color: var(--accent); background: var(--accent-soft); }
.profile-tab.is-active { background: var(--accent); color: #fff; box-shadow: 0 5px 12px rgba(15,118,110,.18); }
.profile-content { padding: 22px; }
.profile-summary { display: grid; grid-template-columns: 170px 1fr; gap: 26px; align-items: start; }
.profile-photo { width: 170px; height: 170px; object-fit: cover; border: 5px solid #fff; border-radius: 20px; background: var(--surface-muted); box-shadow: 0 12px 30px rgba(15,23,42,.13); }
.profile-photo.placeholder { display: grid; place-items: center; padding: 15px; border: 1px dashed var(--border-strong); box-shadow: none; color: var(--text-muted); text-align: center; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.detail-grid > div { min-height: 74px; display: grid; align-content: center; gap: 5px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 11px; background: #fafbfc; }
.detail-grid > div > span { color: var(--text-muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.address-card { margin-top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 11px; background: #fafbfc; }
.address-card p { margin: 5px 0 0; color: var(--text-muted); }
.timeline { display: grid; }
.timeline article { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.timeline-marker { width: 11px; height: 11px; margin-top: 5px; border: 3px solid #a7e8df; border-radius: 50%; background: var(--accent); box-sizing: content-box; }
.photo-crop-layout { display: grid; grid-template-columns: 256px 1fr; gap: 24px; align-items: start; }
[data-photo-preview] { width: 256px; height: 256px; max-width: 100%; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-muted); box-shadow: var(--shadow-sm); }

.role-summary { display: flex; flex-wrap: wrap; gap: 10px; padding: 17px 20px; color: var(--text-muted); }
.permission-groups { display: grid; gap: 11px; padding: 16px; }
.permission-group { overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.permission-group summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; cursor: pointer; font-weight: 750; background: #fbfcfe; }
.permission-list { display: grid; border-top: 1px solid var(--border); }
.permission-row { display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: start; gap: 9px; padding: 11px 15px; border-bottom: 1px solid var(--border); font-weight: 550; }
.permission-row:last-child { border: 0; }
.permission-row small { display: block; margin-top: 2px; color: var(--text-muted); font-weight: 450; }
.permission-row.is-sensitive { background: var(--warning-soft); }.permission-row.is-dangerous { background: var(--danger-soft); }
.security-actions { display: grid; grid-template-columns: minmax(170px,.6fr) minmax(0,1.4fr); align-items: start; gap: 18px; padding: 20px; }
.inline-security-form { display: grid; grid-template-columns: minmax(150px,1fr) minmax(150px,1fr) auto; gap: 9px; }
.inline-form { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.inline-form input, .inline-form select { min-width: 130px; min-height: 36px; }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .audit-filters select { max-width: none; }
    .quick-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 860px) {
    .app-shell { grid-template-columns: minmax(0,1fr); }
    .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(86vw,272px); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(15,23,42,.2); }
    body[data-sidebar-collapsed="true"] .brand { justify-content: flex-start; padding: 0 22px; }
    body[data-sidebar-collapsed="true"] .brand-copy, body[data-sidebar-collapsed="true"] .nav-label, body[data-sidebar-collapsed="true"] .sidebar-footer > span:last-child { display: grid; }
    body[data-sidebar-collapsed="true"] .nav-link span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; }
    body[data-sidebar-collapsed="true"] .nav { padding: 18px 14px 24px; }
    body[data-sidebar-collapsed="true"] .nav-link { justify-content: flex-start; padding: 9px 11px; }
    body[data-sidebar-collapsed="true"] .nav-group summary { justify-content: flex-start; padding: 9px 11px; }
    body[data-sidebar-collapsed="true"] .nav-group summary > span { display: inline; }
    body[data-sidebar-collapsed="true"] .nav-submenu { display: grid; }
    body[data-sidebar-collapsed="true"] .sidebar-tools { margin-inline: 14px; }
    body[data-sidebar-collapsed="true"] .sidebar-tools .nav-link { justify-content: center; padding: 0; }
    body[data-sidebar-collapsed="true"] .sidebar-tools .nav-link > span:not(.notification-count) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    body[data-sidebar-collapsed="true"] .sidebar-tools .notification-count { position: absolute; width: auto; height: 19px; overflow: visible; clip-path: none; white-space: nowrap; }
    body[data-sidebar-collapsed="true"] .sidebar-footer { justify-content: flex-start; margin: 0 14px 14px; padding: 12px; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .drawer-backdrop { position: fixed; z-index: 20; inset: 0; display: block; background: rgba(15,23,42,.5); backdrop-filter: blur(2px); }
    .mobile-only { display: grid; }
    .topbar { padding: 0 16px; }
    .workspace { padding: 0 0 calc(94px + env(safe-area-inset-bottom)); }
    .page-action-footer, .employee-profile .form-panel > .form-actions { left: 0; min-height: 70px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)) !important; }
    .form-grid, .detail-grid, .security-actions, .inline-security-form { grid-template-columns: 1fr; }
    .table-wrap { display: none; }
    .audit-table-wrap, .backup-table-wrap, .profile-table-wrap { display: block; overflow-x: auto; }
    .mobile-list { display: block; }
    .desktop-list-control { display: none !important; }
    .employee-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; }
    .employee-toolbar > input[type="search"], .employee-toolbar > .status-pills { width: 100%; grid-column: 1 / -1; }
    .employee-toolbar > .toolbar-spacer { display: none; }
    .employee-toolbar > .toolbar-export { min-width: 96px; }
    .filter-sheet { inset: auto 0 0; width: 100%; max-height: 84vh; border: 0; border-top: 1px solid var(--border); border-radius: 18px 18px 0 0; }
    .auth-footer { flex-direction: column; gap: 5px; }
}

@media (max-width: 620px) {
    :root { --header-height: 68px; }
    .topbar-title > span { display: none; }
    .topbar h1 { max-width: 42vw; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-actions { gap: 5px; }
    .icon-button { width: 38px; height: 38px; }
    .metric-grid { grid-template-columns: 1fr; padding: 13px; }
    .page-heading, .panel-header, .table-header { align-items: flex-start; flex-direction: column; }
    .panel-header .form-actions, .table-header .form-actions { width: 100%; justify-content: flex-start; }
    .form-actions { justify-content: stretch; }
    .form-actions .button { flex: 1; }
    .page-action-footer .button, .employee-profile .form-panel > .form-actions .button { min-height: 46px; }
    .profile-summary, .photo-crop-layout { grid-template-columns: 1fr; }
    .profile-photo { width: 132px; height: 132px; }
    .profile-content { padding: 15px; }
    .auth-panel { padding: 26px 22px; border-radius: 16px; }
    .auth-stage { align-items: start; padding-top: 8px; }
    .auth-body .setup-panel { border-radius: 18px; }
    .setup-heading { padding: 24px 20px 20px; }.setup-heading h2 { font-size: 25px; }
    .setup-progress { margin-top: 20px; }.setup-progress li { gap: 5px; font-size: 9px; }
    .setup-essential { grid-template-columns: 1fr; padding: 22px 20px; }
    .setup-password-field { grid-column: auto; }
    .setup-advanced { margin: 0 20px 18px; }.setup-advanced .form-grid { grid-template-columns: 1fr; padding: 16px; }
    .setup-actions { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)) !important; }.setup-actions > span { display: none; }.setup-actions .button { width: 100%; min-height: 48px; }
    .auth-brand, .auth-stage, .auth-footer { width: min(100% - 28px,1180px); }
    .mobile-list-fields { grid-template-columns: 1fr; }
    .dashboard-hero { align-items: flex-start; flex-direction: column; padding: 24px 20px; }
    .quick-actions { grid-template-columns: 1fr; }
}

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

.self-service-page { display: grid; gap: 14px; }
.offline-banner { margin: 0 0 12px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--warning) 10%, var(--surface)); color: var(--text); font-size: 13px; }
.self-service-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; }
.self-service-hero h2 { margin: 4px 0 6px; }
.self-service-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.metric-grid.compact { padding: 14px; }
.request-list { display: grid; }
.request-row { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); }
.request-review { border-top: 1px solid var(--border); padding: 4px 0 16px; }
.request-review p { margin: 12px 18px; color: var(--muted); }
.request-changes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 12px 18px; }
.request-changes > div { display: grid; gap: 4px; }
@media (max-width: 720px) {
    .self-service-grid { grid-template-columns: 1fr; }
    .self-service-hero { align-items: flex-start; flex-direction: column; }
    .self-service-hero form, .self-service-hero .button { width: 100%; }
    .request-row { grid-template-columns: 1fr auto; gap: 5px 10px; }
    .request-row > :nth-child(2) { grid-column: 1; }
    .request-row > :nth-child(3) { grid-column: 2; grid-row: 1 / span 2; }
    .request-changes { grid-template-columns: 1fr; }
}
