:root {
  color-scheme: light;
  --blue: #073960;
  --brand-navy: #073960;
  --brand-green: #54bf3a;
  --brand-soft-green: #bbe5a1;
  --brand-blue: #7a97b8;
  --muted: #5d7185;
  --line: #d6e1ea;
  --surface: #fff;
  --page: #f5f8f4;
  --text: #073960;
  --success: #237b35;
  --danger: #b82935;
  --warning: #875613;
  --radius: 12px;
  --shadow: 0 5px 18px rgba(7, 57, 96, .055);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font: 15px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: #237b35; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; padding: 20px 16px; background: var(--brand-navy); color: white; overflow-y: auto; overflow-x: hidden; z-index: 20; border-right: 1px solid #082f4d; }
.brand { display: block; padding: 18px 12px 14px; margin-bottom: 20px; background: white; border-radius: 10px; color: var(--blue); text-decoration: none; border-bottom: 4px solid var(--brand-green); }
.brand-logo { display: block; width: 100%; max-width: 210px; height: auto; object-fit: contain; margin: 0 auto 16px; }
.brand-product { display: block; font-size: 21px; font-weight: 750; letter-spacing: .1em; }
.brand small { display: block; font-size: 11px; letter-spacing: .03em; color: var(--muted); }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { color: #edf4fa; text-decoration: none; padding: 9px 12px; border-radius: 7px; border-left: 3px solid transparent; font-size: 14px; }
.sidebar nav a:hover { background: rgba(255,255,255,.09); }
.sidebar nav a[aria-current='page'] { border-left-color: var(--brand-green); background: var(--brand-soft-green); color: var(--brand-navy); font-weight: 650; }
.account { margin-top: 24px; border-top: 1px solid #ffffff30; padding: 16px 12px 4px; font-size: 13px; overflow-wrap: anywhere; }
.account button { margin-top: 10px; background: transparent; color: white; border: 1px solid #ffffff65; padding: 7px 13px; }
.account button:hover { background: #ffffff15; }
.workspace { margin-left: 272px; padding: 32px 36px; min-height: 100vh; }
h1 { color: var(--blue); font-size: 28px; line-height: 1.25; margin: 0 0 14px; letter-spacing: -.025em; }
.workspace > h1::after { content: ''; display: block; width: 50px; height: 4px; margin-top: 12px; border-radius: 3px; background: var(--brand-green); }
h2 { color: var(--blue); font-size: 19px; line-height: 1.4; margin-top: 0; }
.lead { color: var(--muted); max-width: 880px; margin-bottom: 24px; }
.card, .section { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 20px; }
.grid .card { border-top: 3px solid var(--brand-green); }
.grid .card:hover { border-top-color: var(--brand-green); }
.grid a { color: var(--blue); font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--blue); background: #eff4f8; font-weight: 650; font-size: 12px; letter-spacing: .025em; }
tbody tr:hover { background: #f7fafc; }
td code { display: inline-block; max-width: 100%; }
code { font-size: 12px; overflow-wrap: anywhere; color: var(--blue); }
input, select, textarea, button { font: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea { width: 100%; max-width: 520px; border: 1px solid #b5c7d6; padding: 10px 11px; border-radius: 7px; background: white; color: var(--text); transition: border-color .12s, box-shadow .12s; }
input[type=file] { padding: 8px; font-size: 13px; }
input[type=file]::file-selector-button { color: var(--blue); background: #edf3f8; border: 0; padding: 6px 9px; border-radius: 4px; margin-right: 10px; }
input[type=checkbox], input[type=radio] { accent-color: var(--success); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px #7a97b82b; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; margin-bottom: 6px; color: var(--blue); font-weight: 550; }
form p { margin-bottom: 18px; }
.helptext { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; max-width: 620px; }
button, .button { display: inline-block; background: var(--brand-green); color: var(--brand-navy); border: 1px solid var(--brand-green); padding: 9px 16px; border-radius: 7px; text-decoration: none; cursor: pointer; font-weight: 550; transition: background .12s; }
button:hover, .button:hover { background: var(--brand-soft-green); color: var(--brand-navy); border-color: var(--brand-soft-green); }
button:disabled { opacity: .5; cursor: not-allowed; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--brand-green); outline-offset: 3px; }
form.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
form.inline input { max-width: 160px; }
form.inline select { max-width: 200px; }
.notice { padding: 14px 18px; background: #edf7ed; color: #20582c; border: 1px solid #cee4cf; border-left: 4px solid var(--success); border-radius: 8px; margin-bottom: 20px; }
.notice.error, .errorlist { background: #fff0f1; color: #92212b; border-color: #e7bcc1; }
.notice.error { border-left-color: var(--danger); }
.errorlist { border-radius: 6px; padding: 8px 12px 8px 28px; }
.notice.warning { background: #fff7e9; color: #754c14; border-color: #ead8b6; border-left-color: #b57c24; }
.notice.info { color: var(--blue); background: #edf3f8; border-color: #cbdbe8; border-left-color: var(--brand-blue); }
.table-scroll { overflow: auto; }
.muted { color: var(--muted); }
.badge { display: inline-block; background: #e8eff5; color: var(--blue); padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 600; }
details summary { cursor: pointer; font-weight: 650; color: var(--blue); margin-bottom: 10px; }
details[open] > summary { padding-bottom: 13px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.mono { font-family: ui-monospace, monospace; }
.login-page { background: linear-gradient(155deg,#edf3f8 0%,#f8fafb 65%,#edf6e9 100%); min-height: 100vh; }
.login-shell { max-width: 460px; margin: 8vh auto; padding: 24px; }
.login-brand { padding: 0 25px 25px; text-align: center; }
.login-brand img { display: block; width: 100%; height: auto; margin-bottom: 20px; }
.login-brand h1 { font-size: 24px; letter-spacing: .08em; margin-bottom: 4px; }
.login-brand p { margin: 0; }
.login-shell .card { border-top: 4px solid var(--brand-green); }
.login-shell button { width: 100%; margin-top: 8px; }
.report-page { max-width: 1100px; margin: 30px auto; padding: 0 24px 32px; }
.report-brand { max-width: 245px; height: auto; display: block; margin-bottom: 25px; }
.report-page pre { white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f9fb; border: 1px solid var(--line); border-radius: 7px; padding: 14px; font-size: 12px; }
.report-page section { margin-top: 24px; }
.report-page section h2 { overflow-wrap: anywhere; }
@media(max-width:850px) {
  .sidebar { position: static; width: 100%; padding: 16px; }
  .brand { max-width: 260px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .sidebar nav a { font-size: 13px; padding: 7px 10px; }
  .workspace { margin-left: 0; padding: 24px 18px; }
  .account { margin-top: 12px; }
  .login-shell { margin-top: 4vh; }
}
@media print {
  .sidebar, button, nav { display: none; }
  .workspace { margin: 0; padding: 0; }
  .card { border: 0; box-shadow: none; }
  .report-page { max-width: none; margin: 0; padding: 0; }
  .report-page section { break-inside: avoid; }
}

/* v0.5: content must not widen the navigation or page. */
.brand { max-width: 100%; min-width: 0; }
.sidebar nav a { overflow-wrap: anywhere; }
.workspace { min-width: 0; }
.grid > * { min-width: 0; }
.grid { grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); }
.brand-logo, .login-brand img, .report-brand { max-width: 100%; }
.sidebar .account button:hover { border-color: #ffffff90; }
