:root {
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
  color: var(--ink);
  background: var(--surface-page);
  font-synthesis: none;
  --brand-primary: #174898;
  --brand-primary-hover: #123775;
  --brand-accent: #087b78;
  --brand-primary-soft: #eaf1fc;
  --brand-accent-soft: #e5f4f2;
  --ink: #182841;
  --muted: #50617a;
  --surface-soft: color-mix(in srgb, var(--brand-primary-soft) 42%, white);
  --surface-page: color-mix(in srgb, var(--brand-primary-soft) 64%, white);
  --line: color-mix(in srgb, var(--brand-primary) 17%, white);
  --control-line: color-mix(in srgb, var(--brand-primary) 32%, #eef0f4);
  --accent-rule: color-mix(in srgb, var(--brand-accent) 68%, var(--brand-primary));
  --brand-shadow: color-mix(in srgb, var(--brand-primary) 17%, transparent);
  --blue: var(--brand-primary);
  --blue-dark: var(--brand-primary-hover);
  --accent: var(--brand-primary-hover);
  --focus-light: var(--brand-primary);
  --control: #fff;
  --paper: #fff;
  --radius: 15px;
  --shadow: 0 2px 8px var(--brand-shadow);
  --glass: linear-gradient(145deg, white 28%, var(--surface-soft));
  --glass-shadow: inset 0 1px #fff, 0 4px 16px color-mix(in srgb, var(--brand-primary) 9%, transparent);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue-dark); }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid var(--focus-light); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
.skip { position: fixed; top: -100px; left: 18px; z-index: 30; padding: 12px; background: white; }
.skip:focus { top: 10px; }
.boot { margin: 18vh auto; text-align: center; color: var(--muted); }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.mark { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid #ffffff66; border-radius: 11px; background: linear-gradient(145deg, var(--brand-primary), var(--brand-primary-hover)); color: white; font-size: 12px; font-weight: 850; letter-spacing: .015em; position: relative; box-shadow: inset 0 1px #ffffff38, 0 4px 10px var(--brand-shadow); }
.mark::before { content: ''; position: absolute; inset: 4px; border: 1px solid #ffffff4a; border-radius: 7px; pointer-events: none; }
.mark.mark-logo { background: var(--paper); border-color: var(--line); overflow: hidden; }
.mark-logo::before { display: none; }
.mark-logo img { display: block; width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.brand strong { display: block; font-size: 14px; letter-spacing: -.01em; }
.brand small { display: block; margin-top: 3px; font-size: 10px; font-weight: 500; color: inherit; opacity: .72; }
.layout { display: grid; min-height: 100vh; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; background: var(--surface-page); color: var(--ink); padding: 24px 16px 16px; overflow-y: auto; }
.sidebar .brand { padding: 0 6px; }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.nav-group { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 8px 11px; list-style: none; cursor: pointer; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.nav-group::-webkit-details-marker { display: none; }
.nav-group::after { content: ''; width: 6px; height: 6px; flex: 0 0 auto; margin-right: 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); }
.nav-group:hover, details[open] > .nav-group { background: var(--brand-primary-soft); border-color: var(--line); }
details[open] > .nav-group::after { transform: rotate(45deg); }
.nav-links { display: grid; gap: 4px; padding: 5px 0 2px 6px; }
.nav-link { display: flex; gap: 11px; align-items: center; min-height: 41px; border-radius: 8px; padding: 9px 11px; color: var(--ink); text-decoration: none; font-size: .85rem; border-left: 2px solid transparent; }
.nav-link:hover { background: var(--brand-primary-soft); color: var(--accent); }
.nav-link[aria-current="page"] { background: var(--brand-primary-soft); border-left-color: var(--accent-rule); color: var(--accent); font-weight: 650; }
.glyph { width: 20px; text-align: center; font-size: .99rem; color: currentColor; opacity: .86; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 8px 0; color: var(--muted); font-size: .75rem; }
.sidebar-footer strong { display: block; color: var(--accent); font-size: .81rem; margin: 0 0 5px; }
.work { min-width: 0; }
.topbar { height: 69px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 clamp(16px, 3vw, 39px); }
.topbar .crumb { color: var(--muted); font-size: .84rem; display: flex; align-items: center; gap: 8px; }
.topbar .crumb strong { color: var(--ink); }
.topbar .identity { display: flex; align-items: center; gap: 10px; font-size: .83rem; }
.identity small { display: block; color: var(--muted); font-size: .69rem; margin-top: 2px; }
.avatar { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-primary-soft); color: var(--blue-dark); font-weight: 760; }
.topbar .text-button { margin-left: 6px; }
.page { width: min(100%, 1540px); margin: auto; padding: 27px clamp(16px, 3vw, 39px) 44px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.58rem, 2.7vw, 2.2rem); line-height: 1.16; letter-spacing: -.048em; overflow-wrap: anywhere; }
.page-head p { margin-top: 7px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.button { display: inline-flex; align-items: center; gap: 7px; border-radius: 8px; border: 1px solid transparent; padding: 10px 14px; min-height: 38px; background: var(--blue); color: white; font-weight: 650; font-size: .83rem; text-decoration: none; line-height: 1.15; white-space: nowrap; }
.button:hover { background: var(--blue-dark); }
.button.secondary { color: var(--accent); background: white; border-color: var(--control-line); }
.button.secondary:hover { background: var(--surface-soft); }
.button.danger { background: #9a3544; }
.button.danger:hover { background: #772331; }
.button.small { font-size: .76rem; min-height: 31px; padding: 7px 10px; }
.text-button { background: transparent; border: 0; color: var(--blue-dark); font-size: .8rem; font-weight: 700; padding: 7px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 22px 24px; color: var(--ink); background: var(--brand-primary-soft); border-radius: var(--radius); margin-bottom: 17px; }
.hero h2 { font-size: 1.28rem; letter-spacing: -.02em; font-weight: 680; }
.hero p { color: var(--muted); font-size: .82rem; margin-top: 6px; line-height: 1.5; }
.hero .period { color: var(--blue-dark); font-weight: 680; font-size: .82rem; white-space: nowrap; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.metric, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.metric { padding: 15px 17px 17px; }
.metric-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .77rem; font-weight: 640; }
.metric-label .glyph { background: var(--brand-primary-soft); color: var(--blue-dark); width: 25px; height: 25px; display: grid; place-items: center; border-radius: 6px; }
.metric strong { display: block; margin-top: 9px; font-size: clamp(1.15rem, 2.1vw, 1.63rem); font-variant-numeric: tabular-nums; letter-spacing: -.04em; overflow-wrap: anywhere; }
.metric p { margin-top: 5px; color: var(--muted); font-size: .72rem; }
.grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; margin-bottom: 17px; }
.panel { margin-bottom: 16px; overflow: hidden; }
.grid > .panel { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: .99rem; letter-spacing: -.014em; }
.panel-head p { margin-top: 4px; color: var(--muted); font-size: .77rem; }
.panel-body { padding: 16px 18px; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); line-height: 1.55; font-size: .86rem; }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: .82rem; }
th { text-align: left; color: var(--accent); font-weight: 650; background: var(--surface-page); white-space: nowrap; }
td, th { border-bottom: 1px solid var(--surface-page); padding: 10px 13px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: var(--surface-soft); }
td small { color: var(--muted); display: block; margin-top: 3px; }
td .button { margin: 2px 0; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; background: #eef2f6; color: #485b71; border-radius: 12px; font-size: .69rem; font-weight: 680; white-space: nowrap; }
.tag.good { background: #e2f3ed; color: #11644d; }
.tag.warn { background: #fff2d8; color: #745012; }
.tag.bad { background: #fbe8eb; color: #8e273d; }
.field { display: grid; gap: 5px; margin: 0 0 13px; font-size: .82rem; color: var(--ink); font-weight: 650; }
.field small { color: var(--muted); font-weight: 450; line-height: 1.4; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid var(--control-line); padding: 9px 10px; border-radius: 7px; background: #fff; color: var(--ink); min-height: 38px; font-weight: 450; }
input[type="month"] { width: auto; }
input[type="file"] { border-style: dashed; padding: 11px; background: var(--surface-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 13px; }
.full { grid-column: 1 / -1; }
.error { padding: 10px 12px; color: #87253b; background: #fbecef; border: 1px solid #f4ccd5; border-radius: 7px; margin-bottom: 12px; font-size: .84rem; }
.info { background: var(--brand-primary-soft); border: 1px solid var(--line); color: var(--accent); padding: 11px 13px; border-radius: 8px; font-size: .81rem; line-height: 1.55; margin-bottom: 15px; }
.migration-rows + .migration-rows { border-top: 1px solid var(--line); }
.migration-rows summary { cursor: pointer; font-size: .84rem; font-weight: 650; padding: 12px 18px; }
.migration-rows summary .tag { margin-left: 6px; }
.migration-rows .table-wrap { border-top: 1px solid var(--line); }
.stack { display: grid; gap: 10px; }
.record-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 9px 0; font-size: .83rem; }
.record-line:last-child { border-bottom: 0; }
.record-line small { display: block; margin-top: 4px; color: var(--muted); }
.notice { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: min(390px, calc(100vw - 40px)); border: 1px solid var(--control-line); border-inline-start: 4px solid var(--accent-rule); color: var(--accent); background: var(--surface-page); border-radius: 9px; box-shadow: 0 10px 40px var(--brand-shadow); padding: 13px 16px; font-size: .87rem; }
dialog { width: min(560px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 15px; padding: 0; color: var(--ink); box-shadow: 0 25px 80px #13243a50; }
dialog::backdrop { background: #0f24399c; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: 17px 20px; }
.dialog-head h2 { font-size: 1.12rem; letter-spacing: -.02em; }
.dialog-body { padding: 17px 20px 20px; }
.dialog-body > p { color: var(--muted); margin: 0 0 14px; font-size: .86rem; line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.nav-toggle { display: none; }
@media (max-width: 1080px) {
  .layout { grid-template-columns: 202px minmax(0,1fr); }
  .sidebar { padding-inline: 10px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(255px, 85vw); height: 100dvh; z-index: 10; transform: translateX(-101%); transition: transform .18s ease; overflow: auto; }
  .layout.menu-open .sidebar { transform: translateX(0); }
  .nav-toggle { display: inline-flex; align-items: center; }
  .topbar { height: 60px; }
  .identity .identity-name, .crumb span, .crumb strong { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .hero { padding: 15px; align-items: flex-start; }
  .hero h2 { font-size: 1rem; }
  .grid { grid-template-columns: 1fr; }
  .metric { padding: 12px; }
  td, th { padding: 9px 10px; }
}
@media (max-width: 410px) { .form-grid { grid-template-columns: 1fr; } .metrics { gap: 7px; } .hero { flex-direction: column; gap: 9px; } }
@media print {
  :root { background: white; }
  .sidebar, .topbar, .toolbar, dialog, .notice, .skip, .button { display: none !important; }
  .layout { display: block; }
  .page { padding: 0; }
  .panel { box-shadow: none; break-inside: avoid; }
  body { background: white; }
}
