:root {
  --ink: #15221c; --muted: #52655b; --edge: #dae3db; --paper: #fff; --base: #f2f5ef;
  --green: #194e3f; --green-hover: #24634e; --lime: #e1efcd; --warning: #84550c; --error: #a33334;
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  color: var(--ink); background: var(--base); line-height: 1.5; font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { border: 1px solid var(--edge); background: var(--paper); color: var(--ink); cursor: pointer; border-radius: 8px; padding: 8px 12px; font-weight: 600; min-height: 37px; }
button:hover { background: #f0f5ec; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--green); border-color: var(--green); color: white; }
button.primary:hover { background: var(--green-hover); }
button.danger { background: #a33334; border-color: #a33334; color: white; }
:focus-visible { outline: 3px solid #4a9a7d; outline-offset: 2px; }
label { display: grid; gap: 6px; font-weight: 600; }
input, select, textarea { min-width: 0; width: 100%; background: white; color: var(--ink); border: 1px solid #cfdcd3; border-radius: 8px; padding: 8px 10px; }
input[type=checkbox] { width: auto; accent-color: var(--green); }
textarea { resize: vertical; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(29px, 4vw, 39px); letter-spacing: -.045em; line-height: 1.14; }
h2 { font-size: 19px; letter-spacing: -.02em; line-height: 1.28; }
code, .mono { font-family: 'Cascadia Mono', Consolas, monospace; overflow-wrap: anywhere; }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail { padding: 28px 18px; border-right: 1px solid var(--edge); background: #fbfdf9; display: flex; flex-direction: column; gap: 32px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px; }
.brand strong { display: block; font-size: 18px; letter-spacing: -.025em; }
.brand small { color: var(--muted); }
nav { display: grid; gap: 5px; }
.nav, .logout { text-align: left; border: 0; background: transparent; width: 100%; padding: 10px 12px; }
.nav span, .logout span { display: inline-block; width: 22px; color: #366654; font-size: 16px; }
.nav[aria-current=page] { background: var(--lime); color: var(--green); }
.logout { margin-top: auto; }
.workspace { padding: 30px clamp(18px, 4vw, 50px) 42px; min-width: 0; max-width: 1660px; width: 100%; }
.heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; margin-bottom: 26px; }
.eyebrow { font-size: 11px; font-weight: 750; letter-spacing: .13em; color: var(--muted); margin-bottom: 8px; }
.interface-grid, .profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.interface-grid { margin-bottom: 20px; }
.interface { padding: 18px; }
.panel { background: var(--paper); border: 1px solid var(--edge); border-radius: 13px; box-shadow: 0 1px 1px #112b150a; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-top small { color: var(--muted); }
.chip { display: inline-flex; gap: 6px; align-items: center; border-radius: 6px; padding: 3px 8px; white-space: nowrap; width: max-content; max-width: 100%; font-weight: 650; font-size: 11.5px; background: #edf0ed; color: #42564a; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.good { color: #1c5d42; background: #e5f2e3; }
.chip.warm { color: var(--warning); background: #fbefd8; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 15px 0; padding-top: 13px; border-top: 1px solid var(--edge); gap: 10px; }
.metrics strong { display: block; font-size: 16px; font-weight: 650; }
.metrics small, .helper, .table-foot { color: var(--muted); }
.action-row { display: flex; flex-wrap: wrap; gap: 7px; }
.interface button { padding: 5px 9px; min-height: 31px; font-size: 12px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px 16px; }
.tabs, .tools { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.tabs button { border-color: transparent; }
.tabs button[aria-pressed=true] { background: #e9f1e4; color: var(--green); }
.tools input { width: 170px; }
.scroll-table { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { background: #f7faf5; color: var(--muted); font-size: 12px; }
th, td { padding: 12px 12px; border-top: 1px solid var(--edge); }
th:first-child, td:first-child { padding-left: 16px; }
tr:last-child td { border-bottom: 1px solid var(--edge); }
td small { display: block; color: var(--muted); }
td button { min-height: 32px; padding: 4px 9px; }
.table-foot { padding: 12px 16px; font-size: 12px; }
.helper { margin: 10px 0; font-size: 13px; }
.content { padding: 20px; align-self: start; }
.content > * + * { margin-top: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wide { grid-column: 1 / -1; }
.checkbox { display: flex; gap: 5px; align-items: center; align-self: end; min-height: 40px; }
details { border-block: 1px solid var(--edge); padding: 11px 0; }
details summary { cursor: pointer; font-weight: 650; }
details label, details textarea { margin-top: 10px; }
.profile-values { margin: 12px 0; display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr); gap: 0 10px; }
.profile-values dt, .profile-values dd { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--edge); }
.profile-values dt { color: var(--muted); font-size: 12px; }
.profile-values dd { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draft { margin-top: 15px; }
.notice { padding: 12px 14px; border: 1px solid #c5dbc4; background: #e8f2e5; color: var(--green); border-radius: 8px; margin-bottom: 15px; }
.notice.error, .text-error { color: var(--error); }
.notice.error { background: #fff1f0; border-color: #f1ccca; }
.text-error { margin-top: 10px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(100%, 425px); padding: 32px; background: white; border: 1px solid var(--edge); border-radius: 16px; box-shadow: 0 18px 38px #102c1810; }
.login-card > * + * { margin-top: 14px; }
.login-card p { color: var(--muted); }
.login-card .primary { width: 100%; }
dialog { width: min(calc(100% - 24px), 660px); max-height: 88vh; overflow: auto; padding: 22px; border: 1px solid var(--edge); border-radius: 14px; color: var(--ink); }
dialog::backdrop { background: #10241e88; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 15px; }
.dialog-head button { font-size: 20px; padding: 0 10px; }
.dialog-head + div > * + *, .dialog-form > * + * { margin-top: 13px; }
#dialogBody h3 { font-size: 14px; margin-block: 12px 4px; }
.qr { max-width: 280px; width: 100%; display: block; image-rendering: pixelated; }
.backup-list { padding-left: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
@media (max-width: 1050px) { .shell { grid-template-columns: 185px minmax(0, 1fr); } .profile-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .shell { grid-template-columns: 1fr; } .rail { padding: 12px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid var(--edge); } nav { display: flex; flex-wrap: wrap; gap: 4px; } .nav, .logout { width: auto; padding: 6px 8px; } .nav span { display: none; } .logout { justify-self: end; align-self: flex-end; margin-top: -3px; } .workspace { padding-top: 22px; } .interface-grid { grid-template-columns: 1fr; } }
@media (max-width: 380px) { .tools input { width: 100%; } .login-card, .content { padding: 16px; } .field-grid { grid-template-columns: 1fr; } }
