:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #17242a;
  background: #f4f6f5;
  font-size: 14px;
  line-height: 1.45;
  --ink: #17242a;
  --muted: #5b6b70;
  --line: #d9e1de;
  --surface: #fff;
  --accent: #0d6b60;
  --accent-dark: #07554d;
  --danger: #a93131;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #db9839; outline-offset: 2px; }
h1, h2, h3, p, dl { margin-top: 0; }
h1 { font-size: clamp(1.5rem, 2vw, 2rem); line-height: 1.2; letter-spacing: -.035em; margin-bottom: .35rem; }
h2 { font-size: 1.05rem; line-height: 1.3; letter-spacing: -.01em; margin-bottom: 0; }
small, .muted, .help { color: var(--muted); }
small { font-size: .8rem; }
.eyebrow { color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin-bottom: .5rem; }
.brand-mark { display: inline-grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 7px; background: #d4a85e; color: #15272a; font-family: Georgia, serif; font-weight: 900; font-size: 1.3rem; }
.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: #152a2d; color: #e9f0ee; }
.sidebar__brand { display: flex; gap: .75rem; align-items: center; padding: 1.4rem 1.25rem; border-bottom: 1px solid #294246; }
.sidebar__brand strong, .sidebar__brand small { display: block; }
.sidebar__brand strong { letter-spacing: .12em; }
.sidebar__brand small { color: #a9c1bf; }
.sidebar__nav { flex: 1; overflow: auto; padding: 1rem .65rem; }
.sidebar__nav a { display: block; text-decoration: none; padding: .7rem .8rem; margin: .1rem 0; border-radius: 6px; color: #c8d9d6; font-weight: 570; }
.sidebar__nav a:hover { background: #254448; color: #fff; }
.sidebar__nav a[aria-current="page"] { color: #fff; background: #0c6159; box-shadow: inset 3px 0 #d4a85e; }
.sidebar__footer { border-top: 1px solid #294246; padding: 1rem 1.25rem 1.3rem; display: grid; gap: .15rem; }
.sidebar__footer span { font-weight: 700; }
.sidebar__footer small { margin-bottom: .45rem; }
.sidebar__footer .link-button { color: #b9ded7; text-align: left; padding: .2rem 0; }
.workspace { min-width: 0; }
.topbar { height: 64px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; padding: 0 clamp(1rem, 3vw, 2.5rem); }
.topbar__right { display: flex; align-items: center; gap: 1rem; }
.topbar__user { font-weight: 650; color: #34494d; }
.topbar__logout, .topbar__password { display: none; }
.mobile-brand, .mobile-nav { display: none; }
main#main { width: min(1480px, 100%); margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2.5rem) 5rem; outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; }
.page-head .muted { margin-bottom: 0; }
.page-head .button { margin-top: .25rem; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 1.2rem; margin-bottom: 1rem; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-bottom: .9rem; margin-bottom: .9rem; border-bottom: 1px solid #edf0ee; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.two-col > .panel { margin-bottom: 0; }
.two-col + .panel { margin-top: 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; border-top: 3px solid #0f766b; padding: 1rem 1.1rem; min-height: 114px; }
.stat span, .stat small, .stat strong { display: block; }
.stat span { color: var(--muted); font-size: .85rem; font-weight: 650; }
.stat strong { font-size: 1.85rem; letter-spacing: -.04em; margin: .35rem 0 .1rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat strong em { font-style: normal; font-size: .9rem; font-weight: 600; color: var(--muted); }
.stat small { overflow-wrap: anywhere; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border: 1px solid var(--accent); border-radius: 6px; padding: .48rem .8rem; color: #fff; background: var(--accent); font-weight: 680; text-align: center; }
.button:hover { background: var(--accent-dark); }
.button:disabled { opacity: .6; cursor: wait; }
.button--secondary { background: #fff; color: #26534f; border-color: #a8bfbb; }
.button--secondary:hover { background: #edf5f2; }
.button--danger { background: var(--danger); border-color: var(--danger); }
.button--danger:hover { background: #852626; }
.link-button { border: 0; background: none; color: #075e58; padding: 0; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.link-button:hover { color: #043b37; }
.danger-text { color: var(--danger); }
.form { display: grid; gap: .8rem; margin-bottom: 1rem; }
.form:last-child { margin-bottom: 0; }
.form__actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .25rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.field { display: grid; gap: .3rem; min-width: 0; color: #2d464a; font-size: .84rem; font-weight: 670; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; border: 1px solid #aec0bd; border-radius: 6px; padding: .57rem .65rem; background: #fff; color: var(--ink); font-weight: 450; }
.field textarea { resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #73948d; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.check { display: flex; align-items: center; gap: .55rem; }
.check input { accent-color: var(--accent); width: 17px; height: 17px; }
.help { font-size: .85rem; line-height: 1.5; margin: .45rem 0 0; }
.rule { height: 1px; background: var(--line); margin: 1.3rem 0; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .89rem; text-align: left; }
th { white-space: nowrap; background: #f3f6f5; color: #52666a; font-size: .73rem; letter-spacing: .045em; text-transform: uppercase; }
td, th { border-bottom: 1px solid #e8eeeb; padding: .67rem .65rem; vertical-align: top; }
td { overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; margin-top: .1rem; }
.pill { display: inline-flex; align-items: center; white-space: nowrap; border: 1px solid #d4dfdc; border-radius: 999px; padding: .17rem .52rem; background: #f2f6f4; color: #476064; font-size: .77rem; font-weight: 750; }
.pill--green { color: #075b47; background: #e0f2e9; border-color: #b1d7c6; }
.pill--blue { color: #1b5478; background: #e6f2fa; border-color: #bfd8e9; }
.pill--amber { color: #79500e; background: #fff3d9; border-color: #e7d1a5; }
.empty, .loading { padding: 2rem 1rem; text-align: center; color: var(--muted); background: #f8faf9; border: 1px dashed #ccd8d3; border-radius: 6px; }
.error-state { padding: 1.5rem; border: 1px solid #dfa9a9; border-radius: 7px; background: #fff4f3; color: #742424; }
.inline-error { border-left: 3px solid var(--danger); background: #fff0ef; color: #792e2e; padding: .7rem .85rem; margin: .6rem 0; }
.notice { position: fixed; right: 1rem; bottom: 1rem; z-index: 20; max-width: min(420px, calc(100vw - 2rem)); border-radius: 7px; border: 1px solid #aad1c2; color: #0a4e3f; background: #e5f5ed; padding: .75rem 1rem; box-shadow: 0 10px 26px #0f292225; font-weight: 650; }
.notice--error { color: #852828; border-color: #e5b0ae; background: #fff1f0; }
.detail-grid, .metric-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.2rem; margin: 0; }
.detail-row { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; padding: .53rem 0; border-bottom: 1px solid #edf0ee; min-width: 0; }
.detail-row dt { color: var(--muted); }
.detail-row dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.callout { padding: .9rem 1rem; border-radius: 6px; border-left: 4px solid #829c9b; background: #f4f7f6; }
.callout p { margin: .3rem 0 0; }
.callout--good { background: #eaf6ee; border-color: #2d9671; }
.callout--warn { background: #fff6e4; border-color: #c38125; }
.json-view { max-height: 260px; overflow: auto; padding: .8rem; background: #eff3f1; border-radius: 5px; font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { border: 1px solid #b8c9c5; border-radius: 5px; background: #fff; padding: .45rem .7rem; color: #28534e; font-weight: 650; }
.chip--active { background: #0d6b60; color: #fff; border-color: #0d6b60; }
.pager { display: flex; justify-content: flex-end; gap: .5rem; padding-top: 1rem; }
.message-list, .log-list { list-style: none; padding: 0; margin: 0; max-height: 520px; overflow: auto; }
.message-list li, .log-list li { display: grid; grid-template-columns: 145px 120px minmax(0, 1fr); gap: .7rem; border-bottom: 1px solid var(--line); padding: .6rem 0; overflow-wrap: anywhere; }
.message-list time, .log-list time { color: var(--muted); font-size: .8rem; }
.log-list li { grid-template-columns: 145px minmax(0, 1fr); }
.log-list code { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; white-space: pre-wrap; }
.bar-chart { display: grid; gap: .35rem; list-style: none; padding: 0; margin: 0; }
.bar-chart li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) 3rem; gap: .55rem; align-items: center; font-size: .8rem; }
.bar-chart meter { width: 100%; height: .8rem; }
.bar-chart meter::-webkit-meter-bar { background: #e8efec; border: 0; border-radius: 2px; }
.bar-chart meter::-webkit-meter-optimum-value { background: #0d6b60; border-radius: 2px; }
.bar-chart strong { text-align: right; }
.totp-qr { display: block; width: min(260px, 100%); height: auto; margin: 1rem auto; image-rendering: pixelated; }
.confirm-dialog { width: min(450px, calc(100% - 2rem)); border: 1px solid #cad8d2; border-radius: 10px; padding: 1.3rem; color: var(--ink); box-shadow: 0 25px 70px #0f252b60; }
.confirm-dialog::backdrop { background: #102327aa; }
.confirm-dialog .field { margin: 1rem 0; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); min-height: 100vh; }
.login-card { align-self: center; width: min(420px, calc(100% - 2rem)); margin: 2rem auto; }
.login-card .brand-mark { width: 42px; height: 42px; margin-bottom: 1.4rem; }
.login-card h1 { font-size: 2rem; }
.login-card > .muted { margin-bottom: 1.6rem; }
.login-card .form { gap: 1rem; }
.login-card .button { width: 100%; min-height: 44px; }
.fixture-label { color: #8a641e; font-size: .82rem; border-top: 1px solid var(--line); margin-top: 1.3rem; padding-top: 1rem; }
.login-aside { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 7vw, 7rem); background: #173638; color: #e6f0ec; }
.login-aside span { color: #d4a85e; font-size: .75rem; letter-spacing: .15em; text-transform: uppercase; font-weight: 800; }
.login-aside strong { font-family: Georgia, serif; font-size: clamp(2.2rem, 4vw, 4.3rem); line-height: 1.1; letter-spacing: -.035em; margin: 1.2rem 0; }
.login-aside p { color: #b9ceca; }
@media (max-width: 1100px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .two-col { grid-template-columns: 1fr; } .two-col > .panel { margin-bottom: 0; } }
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 56px; justify-content: space-between; }
  .topbar__logout, .topbar__password { display: inline; }
  .mobile-brand { display: flex; align-items: center; gap: .6rem; }
  .mobile-brand .brand-mark { width: 27px; height: 27px; font-size: 1.1rem; }
  .mobile-nav { display: flex; overflow-x: auto; gap: .2rem; padding: .35rem .6rem; background: #193539; color: #e9f2ef; scrollbar-width: thin; }
  .mobile-nav a { white-space: nowrap; text-decoration: none; padding: .52rem .65rem; border-radius: 5px; font-weight: 650; }
  .mobile-nav a[aria-current="page"] { background: #0b695e; }
  main#main { padding-top: 1.25rem; }
  .login-layout { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}
@media (max-width: 560px) {
  .topbar__user { display: none; }
  .stat-grid, .field-grid, .detail-grid, .metric-list { grid-template-columns: 1fr; }
  .page-head { align-items: center; }
  .page-head .button { font-size: .8rem; }
  .panel { padding: .9rem; }
  .message-list li { grid-template-columns: 1fr 1fr; gap: .2rem; }
  .message-list li span { grid-column: 1 / -1; }
  .log-list li { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) { .notice { animation: appear .18s ease-out; } @keyframes appear { from { opacity: 0; transform: translateY(8px); } } }
