:root {
  color: #18314f;
  background: #f3f6fa;
  font: 16px/1.5 Inter, 'Segoe UI', system-ui, sans-serif;
  --navy: #112d52;
  --muted: #52657b;
  --line: #e4eaf1;
  --border: #c9d7e7;
  --paper: #fff;
  --orange: #f58232;
  --blue: #215eae;
  --shadow: 0 3px 12px rgba(25, 55, 90, .05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--blue); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.shell { width: min(1320px, calc(100% - 80px)); margin-inline: auto; }
.masthead { background: var(--navy); color: white; border-bottom: 3px solid var(--orange); }
.masthead-inner { min-height: 83px; display: flex; align-items: center; gap: 35px; }
.masthead :focus-visible { outline-color: var(--orange); }
.brand { color: white; display: grid; justify-items: start; flex-shrink: 0; line-height: 1.1; text-decoration: none; }
.brand-wordmark { position: relative; display: flex; padding-inline-end: 15px; }
.brand-logo { position: relative; display: inline-block; width: 108px; aspect-ratio: 217 / 57; background: var(--navy); isolation: isolate; }
.brand-logo img, .brand-logo::after { position: absolute; inset: 0; display: block; width: 100%; height: 100%; mix-blend-mode: screen; }
.brand-logo img { filter: invert(1); clip-path: polygon(0 0, 100% 0, 100% 100%, 17% 100%, 17% 67%, 9.5% 67%, 9.5% 100%, 0 100%); }
.brand-logo::after { content: ''; background: center / contain no-repeat url('./logo.png'); clip-path: inset(67% 83% 0 9.5%); filter: invert(1) brightness(.6) sepia(1) saturate(25) hue-rotate(-5deg) brightness(.9); }
.brand-registered { position: absolute; inset: -4px 0 auto auto; width: 13px; height: 16px; overflow: hidden; isolation: isolate; background: var(--navy); }
.brand-registered img { position: absolute; top: -3px; right: 0; width: 86px; max-width: none; filter: invert(1); mix-blend-mode: screen; }
.brand small { color: #d4e5f7; font-size: 13px; margin-top: 5px; }
.masthead nav { align-self: stretch; display: flex; align-items: center; gap: 7px; }
.masthead nav a { color: #d4e5f7; text-decoration: none; border-radius: 9px; padding: 9px 15px; font-size: .925rem; font-weight: 600; }
.masthead nav a:hover, .masthead nav a[aria-current='page'] { color: white; background: #25456c; }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; color: #d4e5f7; font-size: .875rem; min-width: 0; }
.account span { min-width: 0; overflow-wrap: anywhere; }
main { padding-block: 32px 48px; }
.intro, .panel, .summary > div { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.intro { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; padding: 22px 25px; margin-bottom: 18px; }
h1 { color: var(--navy); font-size: clamp(1.75rem, 3.4vw, 2.35rem); line-height: 1.13; letter-spacing: -.04em; overflow-wrap: anywhere; }
h2 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -.025em; }
.intro p, .login-panel > p { margin-top: 8px; color: var(--muted); }
.actions, .dialog-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button { min-height: 42px; padding: 8px 15px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; font-size: .875rem; line-height: 1.25; font-weight: 650; cursor: pointer; text-decoration: none; }
.primary { color: var(--navy); background: var(--orange); }
.primary:hover { background: #ff9a52; }
.secondary { color: var(--navy); background: var(--paper); border-color: var(--border); }
.secondary:hover { background: #eaf3fc; }
.logout { min-height: 36px; padding: 6px 12px; color: white; background: transparent; border-color: #6883a1; }
.logout:hover { background: #25456c; }
.small { min-height: 35px; padding: 6px 10px; }
.danger { color: #963519; }
.solid-danger { color: white; background: #963519; }
.solid-danger:hover { background: #762610; }
.button:disabled { opacity: .56; cursor: default; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.summary > div { display: grid; align-content: start; gap: 3px; min-width: 0; padding: 15px 20px; }
.summary > div:last-child { background: #fff7ee; border-color: #f4d8be; box-shadow: inset 3px 0 var(--orange); }
.summary dt { color: var(--muted); font-size: .875rem; font-weight: 650; }
.summary dd { color: var(--navy); font-size: clamp(1.25rem, 2.7vw, 2rem); font-weight: 700; line-height: 1.2; letter-spacing: -.03em; overflow-wrap: anywhere; }
.summary small { color: var(--muted); font-size: .8125rem; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 13px 20px; padding: 18px 20px; }
.section-head h2 { align-self: center; }
.filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 9px; }
.filters label:first-child { min-width: min(16rem, 100%); }
.filters select { min-width: 8.5rem; }
label { display: grid; gap: 5px; font-size: .875rem; color: #263f5a; font-weight: 650; min-width: 0; }
input, select, textarea { color: var(--navy); background-color: white; border: 1px solid var(--border); border-radius: 8px; width: 100%; min-height: 42px; padding: 8px 10px; font-size: 1rem; font-weight: 400; }
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, #52657b 50%), linear-gradient(135deg, #52657b 50%, transparent 50%); background-position: right 13px center, right 8px center; background-size: 5px 6px; background-repeat: no-repeat; }
textarea { resize: vertical; min-height: 82px; }
.table-wrap { overflow-x: auto; border-radius: 0 0 14px 14px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9375rem; }
th, td { padding: 13px 17px; vertical-align: middle; }
th { background: #edf3fa; color: #3d5571; font-size: .875rem; font-weight: 650; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td { border-top: 1px solid var(--line); overflow-wrap: anywhere; }
tbody tr:hover { background: #f7fafe; }
td a { font-weight: 650; }
td .secondary-line { display: block; margin-top: 3px; color: var(--muted); font-size: .8125rem; }
td .actions { justify-content: flex-end; }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; padding: 4px 9px; border-radius: 20px; background: #edf3fa; color: #314e6e; font-size: .8125rem; font-weight: 650; white-space: nowrap; }
.tag.active { background: #e6f4ec; color: #24583d; }
.tag.soon { background: #fff0dc; color: #804608; }
.tag.expired { background: #f9e8e4; color: #873823; }
.empty { padding: 23px 20px; border-top: 1px solid var(--line); color: var(--muted); }
.empty p + .button { margin-top: 12px; }
.detail-back { display: inline-block; font-size: .875rem; font-weight: 650; margin-bottom: 12px; }
.detail-info { padding: 17px 20px 20px; margin-bottom: 18px; }
.detail-info dl { display: grid; grid-template-columns: 1.2fr 1.6fr 1fr 1fr; gap: 15px; margin-top: 14px; }
.detail-info div { min-width: 0; overflow-wrap: anywhere; }
.detail-info dt { color: var(--muted); font-size: .875rem; }
.detail-info dd { font-weight: 650; margin-top: 3px; }
.detail-info .description { margin-top: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.notice, .error, .warning { padding: 10px 13px; border-radius: 8px; overflow-wrap: anywhere; }
.notice { color: #224e3a; background: #e8f4ed; margin-bottom: 15px; }
.error { color: #79351e; background: #faeee8; }
#message.error { margin-bottom: 15px; }
.warning { color: #75440b; background: #fff2e1; margin-bottom: 15px; }
.muted, .field-help { color: var(--muted); }
.login-panel { max-width: 450px; margin: clamp(20px, 10vh, 100px) auto; padding: 26px; }
.login-panel form { display: grid; gap: 15px; margin-top: 21px; }
dialog { width: min(650px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 1px solid var(--border); border-radius: 14px; color: var(--navy); box-shadow: 0 14px 60px #112d5240; }
dialog::backdrop { background: #102c4f90; }
dialog form { padding: 21px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.dialog-actions { justify-content: flex-end; margin-top: 18px; }
.close { padding: 0; min-width: 36px; min-height: 36px; font-size: 1.3rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.span { grid-column: 1 / -1; }
.field-help { font-size: .8125rem; font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 1.05rem; min-height: 0; height: 1.05rem; }
.estimate { padding: 12px; border-radius: 8px; background: #edf3fa; color: var(--navy); font-size: .875rem; }
.estimate strong { display: block; font-size: 1.1rem; }
dialog .error { margin-top: 14px; }
@media (max-width: 900px) {
  .shell { width: calc(100% - 42px); }
  .masthead-inner { gap: 18px; }
  .detail-info dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel table { min-width: 680px; }
}
@media (max-width: 600px) {
  .shell { width: calc(100% - 24px); }
  .masthead-inner { min-height: 0; flex-wrap: wrap; gap: 0 9px; padding-block: 12px 7px; }
  .masthead nav { order: 3; flex: 1 0 100%; padding-top: 9px; }
  .masthead nav a { padding: 7px 10px; }
  .account { gap: 7px; }
  .brand-logo { width: 94px; }
  .brand small, .account { font-size: .8125rem; }
  main { padding-block: 21px 34px; }
  .intro, .section-head, .detail-info { padding: 15px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .summary > div { padding: 12px; }
  .filters { width: 100%; }
  .filters label { flex: 1 1 130px; }
  .filters label:first-child { min-width: 0; }
  .filters select { min-width: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .span { grid-column: auto; }
  dialog form { padding: 15px; }
}
