:root {
  color-scheme: light;
  --ink: #10213f;
  --muted: #62728c;
  --line: #d8e0eb;
  --ground: #f4f7fb;
  --surface: #ffffff;
  --navy: #0b1d3a;
  --blue: #123e7a;
  --teal: #00a3b5;
  --teal-soft: #e3f7f8;
  --success: #1e7e58;
  --warning: #8b5700;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--ground); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }

.loading-shell, .auth-shell, .password-shell {
  display: grid; place-items: center; min-height: 100vh; padding: 24px; text-align: center;
}
.loading-shell { gap: 20px; color: var(--muted); }
.loading-logo { width: min(300px, 82vw); height: auto; }

.auth-card, .password-card {
  width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface); box-shadow: 0 24px 64px rgba(11, 29, 58, .12); text-align: left;
}
.auth-card__brand { width: 250px; max-width: 100%; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-weight: 750; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.1; letter-spacing: -.04em; }
h2 { font-size: 22px; line-height: 1.2; letter-spacing: -.025em; }
h3 { font-size: 15px; margin-bottom: 6px; }
.muted { color: var(--muted); line-height: 1.55; }
.notice { border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.4; margin: 18px 0; }
.notice--error { color: #9e2033; background: #fff0f2; border: 1px solid #f9cbd1; }
.notice--success { color: #176746; background: #e9f8f1; border: 1px solid #b5e7cf; }
.field { display: grid; gap: 7px; margin: 16px 0; color: #30425f; font-size: 14px; font-weight: 650; }
.field input { width: 100%; border: 1px solid #b9c5d5; border-radius: 9px; padding: 12px 13px; color: var(--ink); background: #fff; }
.field input:focus { outline: 3px solid rgba(0, 163, 181, .18); border-color: var(--teal); }
.primary, .secondary, .text-button { border-radius: 9px; font-weight: 750; }
.primary { width: 100%; border: 1px solid var(--blue); background: var(--blue); color: #fff; padding: 12px 16px; }
.primary:hover { background: #0c3269; }
.primary:disabled { cursor: wait; opacity: .6; }
.secondary { border: 1px solid #b7c4d5; background: #fff; color: var(--blue); padding: 9px 12px; }
.text-button { border: 0; background: transparent; color: var(--blue); padding: 6px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 265px minmax(0, 1fr); }
.sidebar { background: var(--navy); color: #dfe9f7; display: flex; flex-direction: column; min-height: 100vh; padding: 26px 15px 16px; }
.brand { display: block; width: 200px; max-width: 100%; padding: 0 9px 24px; filter: brightness(0) invert(1); }
.facility-name { padding: 15px 12px; margin: 0 0 14px; border-top: 1px solid rgba(255,255,255,.16); border-bottom: 1px solid rgba(255,255,255,.16); }
.facility-name strong, .facility-name span { display: block; }
.facility-name strong { color: #fff; font-size: 14px; line-height: 1.35; }
.facility-name span { color: #93a9c9; font-size: 12px; margin-top: 4px; }
.nav { display: grid; gap: 4px; }
.nav button { display: flex; align-items: center; gap: 11px; width: 100%; color: #c1d0e5; background: transparent; border: 0; border-radius: 9px; padding: 10px 12px; text-align: left; font-size: 14px; }
.nav button:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav button[aria-current="page"] { background: #174b91; color: #fff; box-shadow: inset 3px 0 0 var(--teal); }
.nav__symbol { width: 20px; color: #6ed7df; font-weight: 800; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 18px 10px 0; color: #93a9c9; font-size: 12px; }
.sidebar-footer button { margin-top: 7px; padding: 0; color: #e0f5f7; }

.main { min-width: 0; }
.topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px clamp(20px, 4vw, 54px); background: #fff; border-bottom: 1px solid var(--line); }
.topbar__title { margin: 0; font-size: 20px; letter-spacing: -.025em; }
.topbar__context { color: var(--muted); font-size: 13px; margin: 5px 0 0; }
.identity { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.identity__avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: var(--teal); font-weight: 800; }
.content { max-width: 1440px; margin: 0 auto; padding: clamp(22px, 4vw, 48px); }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { margin-bottom: 8px; }
.page-heading .muted { max-width: 620px; margin-bottom: 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: 0 5px 16px rgba(26, 51, 88, .04); }
.metric { margin: 9px 0 2px; color: var(--navy); font-size: 35px; line-height: 1; letter-spacing: -.055em; font-weight: 800; }
.metric-label { margin: 0; color: var(--muted); font-size: 13px; }
.empty-state { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; padding: 28px; margin-top: 22px; border: 1px solid #bde7eb; border-radius: 16px; background: linear-gradient(135deg, #fff 0%, #effcfc 100%); }
.empty-state__mark { display: grid; place-items: center; width: 46px; height: 46px; color: var(--teal); background: #d8f5f6; border-radius: 13px; font-size: 25px; font-weight: 800; }
.empty-state h2 { margin-bottom: 7px; }
.empty-state p { margin-bottom: 0; }
.workspace-panel { margin-top: 22px; }
.workspace-panel .card { min-height: 180px; }
.feature-list { display: grid; gap: 11px; margin-top: 22px; }
.feature-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.feature-row h3 { font-size: 16px; }
.feature-row p { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.switch { appearance: none; position: relative; width: 46px; height: 26px; margin: 0; border: 0; border-radius: 20px; background: #aebccc; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22); transition: transform .15s; }
.switch:checked { background: var(--teal); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid rgba(0,163,181,.24); outline-offset: 2px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 12px; align-items: center; padding-top: 22px; }
.settings-actions .primary { width: auto; }
.version-pill { display: inline-flex; align-items: center; border: 1px solid #b9d4e7; border-radius: 999px; color: #245080; background: #f0f8ff; padding: 6px 10px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.standalone-note { display: flex; gap: 12px; padding: 15px 17px; margin: 22px 0; border-radius: 11px; color: #37506e; background: #eef4fb; border: 1px solid #d8e5f3; font-size: 13px; line-height: 1.45; }
.standalone-note strong { color: var(--blue); }

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { min-height: auto; padding: 14px; position: sticky; top: 0; z-index: 2; }
  .brand { width: 140px; padding: 0 4px 10px; }
  .facility-name, .sidebar-footer { display: none; }
  .nav { display: flex; overflow-x: auto; padding-bottom: 2px; }
  .nav button { flex: 0 0 auto; width: auto; padding: 8px 10px; }
  .nav__symbol { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .topbar { min-height: 70px; padding: 14px 20px; }
  .identity__text { display: none; }
}
@media (max-width: 520px) {
  .auth-card, .password-card { padding: 28px 22px; border-radius: 18px; }
  .page-heading { display: block; }
  .page-heading .version-pill { margin-top: 14px; }
  .empty-state { grid-template-columns: 1fr; }
  .feature-row { padding: 15px; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .settings-actions .primary { width: 100%; }
}
