:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1f2937;
    background: #f3f6fb;
    font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: #1757b8; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { min-height: 66px; padding: 0 max(24px, calc((100% - 1220px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border-bottom: 1px solid #e4e9f1; }
.brand { color: #17345d; font-size: 18px; font-weight: 750; white-space: nowrap; }
.topbar nav { display: flex; align-items: center; gap: 22px; }
.admin-name, .muted { color: #697586; }
.admin-name { font-size: 13px; }
.container { max-width: 1220px; width: calc(100% - 40px); min-height: calc(100vh - 120px); margin: 30px auto 56px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: 30px; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 18px; }
.eyebrow { margin-bottom: 7px; color: #3974c5; font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.muted { margin-bottom: 0; font-size: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card, .panel, .login-card { background: white; border: 1px solid #e6eaf0; border-radius: 12px; box-shadow: 0 4px 16px #22304408; }
.stat-card { min-height: 112px; padding: 19px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card span { color: #697586; font-size: 13px; }
.stat-card strong { color: #17345d; font-size: 25px; }
.panel { margin-bottom: 22px; overflow: hidden; }
.panel-heading { padding: 19px 21px; border-bottom: 1px solid #edf0f5; }
.count { margin-left: 5px; color: #728096; font-size: 13px; font-weight: 500; }
.empty-state { padding: 20px; color: #697586; font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th, td { padding: 13px 15px; vertical-align: top; border-bottom: 1px solid #edf0f5; }
th { color: #697586; background: #fafbfc; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.table-sub { display: block; margin-top: 5px; color: #758195; font-size: 12px; }
.badge { display: inline-block; border-radius: 99px; padding: 5px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-active { color: #18794e; background: #e7f7ef; }
.badge-isolated { color: #a34721; background: #fff0e7; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; padding: 20px; }
label { display: flex; flex-direction: column; gap: 6px; color: #49566a; font-size: 12px; font-weight: 650; }
input, textarea, select { width: 100%; min-width: 0; padding: 9px 10px; color: #263244; background: #fff; border: 1px solid #d9e0e9; border-radius: 7px; font: inherit; font-weight: 400; }
input:focus, textarea:focus, select:focus { outline: 2px solid #b7d2ff; border-color: #6794db; }
.wide { grid-column: 1 / -1; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 9px 14px; border: 1px solid transparent; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.button:hover { text-decoration: none; filter: brightness(.96); }
.button-primary { color: white; background: #2464bd; }
.button-secondary { color: #285b48; background: #eaf6f0; border-color: #d2eddf; }
.button-warning { color: #8a481f; background: #fff2e7; border-color: #f7dfca; }
.button-danger { color: #a43b3b; background: #fff0f0; border-color: #f2d5d5; }
.button-small { min-height: 31px; padding: 6px 9px; font-size: 11px; }
.actions-cell { min-width: 240px; }
.action-form { display: grid; grid-template-columns: 125px 95px auto; gap: 6px; margin-bottom: 9px; }
.action-form input, .action-form select { padding: 6px; font-size: 11px; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; }
.link-button { padding: 0; color: #1757b8; background: none; border: 0; font: inherit; cursor: pointer; }
.edit-details { display: inline-block; margin: 0 8px; color: #1757b8; font-size: 12px; cursor: pointer; }
.edit-form { display: grid; position: absolute; z-index: 2; width: 280px; gap: 10px; margin-top: 7px; padding: 14px; background: #fff; border: 1px solid #dfe5ed; border-radius: 9px; box-shadow: 0 10px 30px #17243a24; cursor: default; }
.alert { margin-bottom: 20px; padding: 12px 15px; border-radius: 8px; font-size: 14px; }
.alert-success { color: #176344; background: #e8f7ef; border: 1px solid #cdebd9; }
.alert-error { color: #8d3030; background: #fff0f0; border: 1px solid #f2d4d4; }
.login-card { width: min(100%, 440px); margin: 8vh auto; padding: 30px; }
.login-card h1 { font-size: 25px; }
.stack-form { display: grid; gap: 16px; margin-top: 24px; }
.button-full { width: 100%; }
.footer { padding: 20px; color: #8791a0; text-align: center; font-size: 12px; border-top: 1px solid #e6eaf0; background: #fff; }
@media (max-width: 850px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topbar { padding: 14px 20px; align-items: flex-start; flex-direction: column; }
    .topbar nav { width: 100%; flex-wrap: wrap; gap: 14px; }
}
@media (max-width: 520px) {
    .container { width: calc(100% - 24px); margin-top: 20px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .stats-grid, .form-grid { grid-template-columns: 1fr; }
    .wide { grid-column: auto; }
    .login-card { padding: 23px; }
}
