:root {
    --ink: #20313d;
    --muted: #687780;
    --line: #d9e1e5;
    --soft: #eef4f6;
    --soft-blue: #e5f0f4;
    --blue: #36708f;
    --blue-dark: #214d66;
    --navy: #102d3d;
    --green: #238467;
    --red: #ba400a;
    --amber: #b37b15;
    --white: #fff;
    --shadow: 0 18px 50px rgba(28, 51, 64, .08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #f5f8f9;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f5f8f9; color: var(--ink); }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 24px 18px 40px; background: var(--navy); color: #fff; z-index: 50; }
.brand, .login-brand { display: flex; align-items: center; gap: 13px; color: inherit; }
.brand { margin: 0 8px 28px; }
.brand:hover { color: #fff; }
.brand-mark { display: inline-grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--blue); color: #fff; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand small, .login-brand strong, .login-brand small { display: block; }
.brand small, .login-brand small { margin-top: 2px; color: #9eb5c1; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.nav-heading { margin: 25px 12px 7px; color: #7d9dab; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 39px; padding: 8px 12px; border-radius: 9px; color: #d9e6eb; font-size: 14px; }
.nav-link:hover, .nav-link.is-active { background: rgba(255,255,255,.09); color: #fff; }
.nav-link.is-active { box-shadow: inset 3px 0 0 #79b8d6; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: #6f93a3; }
.nav-link.is-active .nav-dot { background: #8ed2ef; }
.app-main { min-width: 0; }
.topbar { display: flex; min-height: 108px; align-items: center; gap: 20px; padding: 22px clamp(24px, 4vw, 58px); background: #fff; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 2px 0 0; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.035em; }
.eyebrow { margin: 0; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.account { display: flex; align-items: center; gap: 18px; margin-left: auto; text-align: right; }
.account span strong, .account span small { display: block; }
.account span small { color: var(--muted); margin-top: 2px; }
.menu-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--line); background: #fff; border-radius: 9px; }
.content { padding: clamp(24px, 4vw, 58px); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.metric, .panel, .action-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.metric { padding: 23px; }
.metric span, .metric small { display: block; color: var(--muted); }
.metric strong { display: block; margin: 8px 0 5px; color: var(--navy); font-size: 34px; letter-spacing: -.04em; }
.metric small { font-size: 12px; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.panel { min-width: 0; overflow: hidden; }
.panel-heading { display: flex; align-items: center; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 4px 0 0; font-size: 21px; letter-spacing: -.02em; }
.panel-heading-actions { justify-content: space-between; gap: 20px; }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid #cbd8de; border-radius: 8px; background: #fff; color: var(--ink); font-weight: 700; }
.button:hover { background: var(--soft); color: var(--ink); }
.button-primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.button-primary:hover { background: var(--blue-dark); color: #fff; }
.button-quiet { background: transparent; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--soft); color: #526670; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
tbody tr:hover { background: #f8fbfc; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: #edf1f3; color: #596970; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-confirmed, .status-positive { background: #dff3ea; color: #17684f; }
.status-highly-probable, .status-probable { background: #e3eff7; color: #245d7a; }
.status-possible { background: #fff0cf; color: #865b08; }
.filter-bar { display: flex; gap: 9px; padding: 18px 24px; background: #fbfcfc; border-bottom: 1px solid var(--line); }
.search-field { flex: 1; }
input, textarea, select { width: 100%; border: 1px solid #cbd6dc; border-radius: 8px; background: #fff; color: var(--ink); padding: 11px 13px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(54,112,143,.12); }
textarea { resize: vertical; }
label { display: grid; gap: 7px; color: #2e4856; font-weight: 750; }
label small, fieldset small { color: var(--muted); font-weight: 400; line-height: 1.5; }
.form-panel { max-width: 1080px; }
.form-stack { display: grid; gap: 22px; padding: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 26px; }
.span-2 { grid-column: 1 / -1; }
fieldset { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 10px; }
legend { padding: 0 8px; color: var(--navy); font-weight: 800; }
.radio-list { display: grid; gap: 10px; }
.radio-list label { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border-radius: 8px; background: var(--soft); }
.radio-list input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; }
.radio-list strong, .radio-list small { display: block; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 6px; }
.notice { margin: 22px 26px 0; padding: 15px 17px; border-radius: 9px; background: var(--soft-blue); border-left: 4px solid var(--blue); }
.notice p { margin: 5px 0 0; }
.notice-success { background: #e5f4ed; border-color: var(--green); }
.notice-error { background: #fbe9e3; border-color: var(--red); }
.empty-state { padding: 55px 28px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 18px; }
.empty-state p { margin: 7px 0 0; }
.worker-list { list-style: none; margin: 0; padding: 5px 25px 20px; }
.worker-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.worker-list small { display: block; color: var(--muted); margin-top: 3px; }
.worker-state { width: 10px; height: 10px; border-radius: 50%; background: #98a3a8; }
.worker-state.is-online { background: var(--green); box-shadow: 0 0 0 5px rgba(35,132,103,.12); }
.pagination { display: flex; justify-content: center; gap: 6px; padding: 20px; }
.pagination a { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 7px; }
.pagination a.is-current { background: var(--blue); color: #fff; border-color: var(--blue); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 25px; }
.action-card { padding: 21px; box-shadow: none; }
.action-card h3 { margin: 0; }
.action-card p { min-height: 42px; color: var(--muted); }
.data-list { margin: 0; padding: 8px 26px 24px; }
.data-list div { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.data-list dt { font-weight: 800; }
.data-list dd { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 25px; background: radial-gradient(circle at 20% 10%, #dcecf2 0, transparent 38%), #f5f8f9; }
.auth-main { width: min(100%, 470px); }
.login-card { padding: 36px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.login-brand { margin-bottom: 36px; }
.login-brand small { color: var(--muted); }
.login-card h1 { margin: 0 0 7px; font-size: 32px; }
.login-card .form-stack { padding: 20px 0 0; }
.muted { color: var(--muted); }
.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; }
code { padding: 2px 5px; background: var(--soft); border-radius: 5px; }
@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: -285px; width: 270px; transition: left .2s ease; }
    .sidebar-open .sidebar { left: 0; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
    .menu-toggle { display: block; }
    .two-columns, .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .account span { display: none; }
}
@media (max-width: 560px) {
    .content, .topbar { padding: 20px; }
    .metric-grid, .card-grid { grid-template-columns: 1fr; }
    .panel-heading-actions, .filter-bar { align-items: stretch; flex-direction: column; }
    .button-row .button { flex: 1; }
    .login-card { padding: 25px; }
}
