:root {
  font: 15px/1.5 "Segoe UI", Arial, sans-serif;
  color: #182938;
  background: #f4f6f9;
  --navy: #12354a;
  --teal: #056c69;
  --line: #dfe6ec;
  --muted: #536779;
  --gold: #f0be55;
  --red: #a43538;
  --white: #fff;
  --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; }
button, a, select, summary { cursor: pointer; }
a { color: var(--teal); }
button { color: inherit; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid #3f9290; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.19; letter-spacing: -.025em; }
h1 { font-size: clamp(1.85rem, 4vw, 3rem); }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.15rem; }
svg { width: 18px; height: 18px; flex: none; }
.container { width: min(1320px, calc(100% - 72px)); margin-inline: auto; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.flag { display: flex; height: 4px; }
.flag i { flex: 1; background: #f9fafb; }
.flag i:nth-child(2) { background: #ba4245; }
.flag i:nth-child(3) { background: #f4c357; }
.masthead { min-height: 84px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 13px; color: var(--navy); text-decoration: none; }
.brand img { object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.03rem; }
.brand small { color: var(--muted); font-size: .88rem; }
.account { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #e3f0f0; color: var(--teal); display: grid; place-items: center; font-weight: 700; }
.account b, .account small { display: block; }
.account small { color: var(--muted); }
.site-nav { border-top: 1px solid #edf0f3; }
.nav-inner { display: flex; gap: 24px; overflow-x: auto; }
.nav-item { min-height: 52px; padding: 12px 1px; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; text-decoration: none; font-weight: 650; color: var(--muted); border-bottom: 3px solid transparent; }
.nav-item[aria-current="page"] { color: var(--teal); border-color: var(--teal); }
#main { flex: 1; padding-block: 26px 46px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 10px; padding-block: 18px; }
.site-footer a { font-weight: 650; text-underline-offset: 3px; }
.hero { background: #102d43; background-image: linear-gradient(90deg, #0c263bf5 12%, #0c263bd9 55%, #0c263b30), url('/ct-scanner.jpg'); background-size: cover; background-position: center 53%; color: white; border-radius: 16px; padding: 34px 38px; min-height: 242px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.hero h1 { max-width: 850px; margin-block: 9px 12px; }
.hero p { color: #d4e2eb; max-width: 710px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--teal); font-size: .75rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 16px; height: 2px; background: currentColor; }
.hero .eyebrow, .login-brand .eyebrow { color: var(--gold); }
.button { min-height: 42px; border: 1px solid var(--line); background: white; text-decoration: none; color: var(--navy); padding: 8px 14px; border-radius: 8px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.button:hover { background: #eff5f8; border-color: #bfced9; }
.button.primary { color: white; background: var(--teal); border-color: var(--teal); }
.button.primary:hover { background: #045855; }
.button.gold { color: #202e34; background: #f2c667; border-color: #f2c667; }
.button.gold:hover { background: #ffda8d; }
.button.icon { padding-inline: 9px; }
.button.subtle { border-color: transparent; background: transparent; }
.button.subtle:hover { background: #eef3f6; }
.stats { margin-block: 18px 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: white; text-align: left; padding: 16px; }
.stat:hover, .stat[aria-pressed="true"] { border-color: #529592; }
.stat-summary:hover { border-color: var(--line); }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: #e9f1f7; color: #285c80; flex: none; }
.stat-icon.critical, .pill.critical { color: #983136; background: #fbe9ea; }
.stat-icon.partial, .pill.partial { color: #805614; background: #fff1d8; }
.stat-icon.full, .pill.full { color: #176b53; background: #e3f4ed; }
.stat strong { display: block; font-size: 1.65rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat small { display: block; margin-top: 5px; color: var(--muted); font-weight: 600; }
.section-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 13px; }
.section-title p, .lead, .muted { color: var(--muted); }
.section-title p { margin-top: 5px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.filters { padding: 16px; border-bottom: 1px solid var(--line); }
.filter-grid { display: grid; grid-template-columns: 1.35fr 1.15fr 1.15fr auto; align-items: end; gap: 10px; }
.filter-extra { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.advanced-filters { margin-top: 12px; }
.advanced-filters summary { width: fit-content; color: var(--teal); font-size: .87rem; font-weight: 700; }
label { display: grid; gap: 5px; color: #354b5d; font-size: .87rem; font-weight: 650; min-width: 0; }
input, select, textarea { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #cbd7e0; border-radius: 8px; background: #fff; color: #182938; padding: 8px 11px; font-weight: 400; }
input::placeholder, textarea::placeholder { color: #627485; }
input[readonly] { background: #f1f5f8; }
textarea { resize: vertical; min-height: 90px; }
.search { position: relative; }
.search svg { position: absolute; inset: 34px auto auto 11px; color: var(--muted); }
.search input { padding-left: 35px; }
.table-scroll { overflow-x: auto; }
.mobile-label { display: none; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 15px; background: #f2f6f9; color: #496075; font-weight: 700; font-size: .76rem; letter-spacing: .02em; }
td { padding: 13px 15px; border-bottom: 1px solid #e9eef2; vertical-align: middle; font-size: .88rem; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #f8fbfc; }
td b, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); font-size: .78rem; }
.record-link { border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; text-align: left; background: transparent; color: var(--teal); font-weight: 750; white-space: nowrap; }
.pill { display: inline-block; border-radius: 20px; padding: 4px 8px; font-size: .75rem; font-weight: 700; background: #e9f1f7; color: #33566e; }
.pill.urgent { margin-top: 5px; background: #fbe9ea; color: #983136; }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }
.pagination { display: flex; align-items: center; gap: 8px; }
.pagination .button { min-height: 34px; padding: 5px 9px; }
.empty, .loading { padding: 32px 18px; color: var(--muted); text-align: center; }
.demo { background: #fffaeb; color: #6f4a13; border: 1px solid #f2dfa9; padding: 9px 13px; margin-bottom: 12px; border-radius: 8px; font-size: .85rem; }
.login { margin: 15px auto; display: grid; grid-template-columns: 1.08fr 1fr; width: min(1050px, 100%); overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: white; min-height: 466px; }
.login-brand { padding: clamp(28px, 5vw, 58px); display: flex; flex-direction: column; justify-content: center; background: #102d43; background-image: linear-gradient(115deg, #102d43f2 20%, #102d43bd), url('/ct-scanner.jpg'); background-size: cover; background-position: 70% center; color: white; }
.login-brand img { margin-bottom: 24px; }
.login-brand h1 { margin-block: 10px 16px; }
.login-brand p { color: #d6e6ee; }
.login-form { padding: clamp(24px, 5vw, 50px); align-content: center; }
.login-form p { margin-block: 8px 18px; }
.login-form form { display: grid; gap: 13px; }
.login-form .demo { margin-block: 17px 0; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.demo-actions .button { min-height: 32px; font-size: .8rem; }
.content-title { margin-bottom: 20px; }
.content-title h1 { font-size: clamp(1.7rem, 4vw, 2.35rem); margin-block: 7px; }
.form-wrap { max-width: 1020px; margin-inline: auto; }
.form-section, .form-actions { padding: 20px 22px; margin-bottom: 12px; }
.form-section h2 { font-size: 1.2rem; margin-bottom: 13px; }
.step { display: inline-grid; place-items: center; margin-right: 8px; width: 27px; height: 27px; color: var(--teal); background: #e3f1ef; border-radius: 7px; font-size: .82rem; vertical-align: middle; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 8px; }
.check input { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--teal); }
.info { padding: 11px 13px; border-radius: 8px; background: #eaf5f4; color: #215550; font-size: .87rem; }
.info.alert { background: #fff0e5; color: #863915; }
.publication-note { margin: 16px 0 24px; padding: 13px 16px; border: 1px solid #c8e3e0; }
.publication-note time { white-space: nowrap; font-weight: 700; }
.document-actions { margin-top: 14px; }
.order-preview { margin-top: 12px; }
.order-preview summary { width: fit-content; color: var(--teal); font-weight: 650; padding: 9px 0; }
.order-pages { display: grid; gap: 14px; list-style: none; padding: 0; margin: 6px 0 0; }
.order-pages img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.order-steps { margin: 0 0 14px; padding-left: 22px; }
.order-steps li + li { margin-top: 9px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.error { color: #a02c36; font-size: .88rem; font-weight: 650; }
.error:empty { display: none; }
.admin-heading { align-items: center; }
.admin-heading h1 { font-size: 2rem; }
.admin-heading .eyebrow { margin-bottom: 8px; }
.profile { max-width: 750px; }
.profile .button { margin-top: 14px; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.details div { min-width: 0; }
.details dt { color: var(--muted); font-size: .79rem; font-weight: 650; }
.details dd { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
dialog { width: min(760px, calc(100% - 32px)); max-height: 90vh; border: 1px solid var(--line); border-radius: 14px; color: inherit; padding: 0; box-shadow: 0 18px 70px #112b4350; }
@supports (height: 1dvh) { dialog { max-height: 90dvh; } }
dialog::backdrop { background: #12283880; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin-top: 5px; }
.dialog-body { padding: 16px 20px 20px; }
#toast { position: fixed; bottom: 20px; right: 22px; max-width: calc(100% - 44px); z-index: 3; color: white; background: #164a47; padding: 12px 16px; border-radius: 8px; }
#print { display: none; }
@media (max-width: 1050px) {
  .container { width: calc(100% - 40px); }
  .filter-grid { grid-template-columns: 1.25fr 1fr 1fr auto; }
  .filter-extra { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat { padding: 12px; gap: 8px; }
  .stat-icon { width: 34px; height: 34px; }
  .hero { padding: 28px; }
}
@media (max-width: 760px) {
  .container { width: calc(100% - 28px); }
  .masthead { min-height: 72px; }
  .brand { gap: 8px; }
  .brand img { width: 40px; height: 40px; }
  .brand strong { font-size: .84rem; }
  .brand small { font-size: .72rem; }
  .masthead > #account .button { padding-inline: 9px; }
  .account-label { display: none; }
  .account { gap: 2px; }
  .avatar { display: none; }
  .nav-inner { gap: 4px 16px; flex-wrap: wrap; }
  .nav-item { font-size: .85rem; min-height: 45px; }
  #main { padding-top: 15px; }
  .hero { flex-direction: column; align-items: flex-start; min-height: auto; padding: 22px; background-image: linear-gradient(90deg, #0c263bf2, #0c263bc9), url('/ct-scanner.jpg'); background-position: 73% center; }
  .hero h1 { margin-block: 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filter-grid, .filter-extra { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { grid-column: 1 / -1; }
  .filters .button { justify-self: start; }
  .site-footer .container, .admin-heading { flex-direction: column; align-items: flex-start; }
  .login { grid-template-columns: 1fr; margin-block: 0; }
  .login-brand img { width: 49px; height: 49px; margin-bottom: 12px; }
  input, select, textarea { font-size: 16px; }
  .record-table, .record-table tbody, .record-table tr, .record-table td { display: block; }
  .record-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .record-table tbody { padding: 10px; display: grid; gap: 10px; background: #f4f6f9; }
  .record-table tr { border: 1px solid var(--line); background: white; border-radius: 9px; padding: 5px 11px; }
  .record-table td { border-bottom: 0; padding: 5px 0; overflow-wrap: anywhere; }
  .record-table tr:hover td { background: transparent; }
  .record-table td:first-child { border-bottom: 1px solid var(--line); margin-bottom: 3px; padding-bottom: 8px; }
  .record-table td.empty { border-bottom: 0; text-align: left; padding: 10px 0; }
  .record-table .record-link { min-height: 32px; }
  .mobile-label { display: block; font-size: .73rem; font-weight: 700; color: var(--muted); }
}
@media (max-width: 480px) {
  .form-grid, .details { grid-template-columns: 1fr; }
  .filter-grid, .filter-extra { grid-template-columns: 1fr; }
  .section-title { align-items: flex-start; }
  .form-section, .form-actions { padding: 14px; }
  .stat { gap: 7px; }
  .stat-icon { width: 29px; height: 29px; }
  .stat small { font-size: .72rem; overflow-wrap: anywhere; }
  .actions .button { white-space: normal; }
  .login-form, .login-brand { min-width: 0; }
}
@media print {
  body > :not(#print) { display: none !important; }
  html, body { background: white; color: black; }
  #print { display: block; font: 11pt/1.35 Georgia, serif; }
  #print h1 { font-size: 16pt; text-align: center; margin: 10pt 0; }
  #print p { text-align: center; margin-bottom: 9pt; }
  #print td { font-size: 10pt; border: 1px solid black; padding: 4pt; overflow-wrap: anywhere; white-space: pre-wrap; }
  #print td:first-child { width: 37%; }
  #print tr { break-inside: avoid; }
  #print tr:last-child td { border-bottom: 1px solid black; }
}
