:root {
  --ink: #122730;
  --muted: #66767d;
  --paper: #f4f7f6;
  --card: #ffffff;
  --line: #dfe7e5;
  --navy: #102f3b;
  --navy-2: #173f4a;
  --teal: #147565;
  --teal-light: #dff2ed;
  --orange: #d96a32;
  --orange-light: #fff0e7;
  --red: #b63e42;
  --red-light: #fcebed;
  --gold: #c49022;
  --shadow: 0 14px 40px rgba(17, 48, 59, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; background: white; }
.login-visual { position: relative; overflow: hidden; min-height: 100vh; padding: 64px; display: flex; flex-direction: column; justify-content: space-between; color: white; background: radial-gradient(circle at 70% 25%, #256c72 0, #174552 35%, #102f3b 75%); }
.visual-copy { position: relative; z-index: 2; max-width: 620px; margin-bottom: 6vh; }
.visual-copy h1 { max-width: 600px; margin: 10px 0 20px; font-family: Georgia, serif; font-size: clamp(44px, 5vw, 76px); line-height: .98; font-weight: 500; letter-spacing: -.045em; }
.visual-copy p:last-child { max-width: 510px; color: #cbe2e2; font-size: 18px; line-height: 1.65; }
.signal-orbit { position: absolute; border: 1px solid rgba(190, 235, 228, .18); border-radius: 50%; }
.orbit-one { width: 620px; height: 620px; right: -140px; top: 8%; }
.orbit-two { width: 980px; height: 980px; right: -320px; top: -8%; }
.signal-dot { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #80d5c7; box-shadow: 0 0 0 9px rgba(128, 213, 199, .13), 0 0 45px #80d5c7; }
.dot-one { top: 25%; right: 155px; }
.dot-two { top: 62%; right: 410px; }
.login-panel { display: grid; place-items: center; padding: 44px; }
.login-card { width: min(420px, 100%); }
.login-card h2 { margin: 8px 0 10px; font-family: Georgia, serif; font-size: 42px; font-weight: 500; letter-spacing: -.025em; }
.login-card form { display: grid; gap: 18px; margin-top: 32px; }
.login-card label, .report-form label, .dialog-card label { display: grid; gap: 8px; color: #30464e; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cad8d6; border-radius: 9px; background: white; padding: 13px 14px; color: var(--ink); outline: none; transition: .2s border, .2s box-shadow; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 117, 101, .12); }
.form-error { min-height: 18px; margin: -4px 0 0; color: var(--red); font-size: 13px; }
.demo-note { margin-top: 22px; padding: 13px 15px; display: grid; gap: 5px; border: 1px solid #cae4df; border-radius: 9px; background: #f0faf7; font-size: 13px; }
.demo-note span { color: var(--muted); }
.legal-copy { margin-top: 24px; color: #7a898f; font-size: 12px; line-height: 1.55; }
.mobile-brand, .brand { display: flex; align-items: center; gap: 11px; }
.login-panel > .mobile-brand { display: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px 2px 11px 2px; background: var(--teal); color: white; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); font-size: 11px; font-weight: 900; letter-spacing: .05em; }
.brand-mark-large { width: 54px; height: 54px; background: rgba(27, 130, 115, .72); backdrop-filter: blur(8px); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 250px; display: flex; flex-direction: column; padding: 26px 17px 18px; color: white; background: var(--navy); }
.brand { padding: 0 10px; color: white; text-decoration: none; }
.brand > div:last-child { display: grid; gap: 2px; }
.brand small, .profile-button small { color: #91abb2; font-size: 11px; }
.sidebar nav { display: grid; gap: 5px; margin-top: 46px; }
.sidebar nav a { min-height: 45px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border-radius: 8px; color: #b8cbd0; text-decoration: none; font-size: 14px; transition: .18s; }
.sidebar nav a:hover, .sidebar nav a.active { color: white; background: rgba(255,255,255,.08); }
.sidebar nav a.active { box-shadow: inset 3px 0 var(--teal); }
.sidebar nav a span { width: 18px; color: #7cb6ad; font-size: 18px; }
.sidebar nav a b { margin-left: auto; min-width: 23px; padding: 3px 6px; border-radius: 12px; background: var(--orange); color: white; text-align: center; font-size: 10px; }
.boundary-card { margin-top: auto; display: flex; gap: 10px; padding: 14px 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.045); }
.boundary-card div { display: grid; gap: 5px; }
.boundary-card strong { font-size: 11px; letter-spacing: .02em; }
.boundary-card small { color: #91abb2; font-size: 10px; line-height: 1.45; }
.status-pulse { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; background: #62cbbb; box-shadow: 0 0 0 4px rgba(98,203,187,.12); }
.profile-button { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; margin-top: 13px; padding: 12px 10px; border: 0; border-top: 1px solid rgba(255,255,255,.08); color: white; background: transparent; text-align: left; }
.profile-button > span:nth-child(2) { display: grid; gap: 2px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #d8ece8; color: #195e53; font-size: 11px; font-weight: 800; }
.workspace { min-height: 100vh; margin-left: 250px; padding: 46px 44px 80px; }
.mobile-header { display: none; }
.view { display: none; max-width: 1440px; margin: 0 auto; animation: enter .25s ease; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.page-heading h1 { margin: 5px 0 5px; font-family: Georgia, serif; font-size: clamp(35px, 4vw, 48px); line-height: 1.05; font-weight: 500; letter-spacing: -.035em; }
.page-heading p { margin-bottom: 0; }
.eyebrow { margin: 0; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.light { color: #9ed5cc; }
.muted { color: var(--muted); }
.primary, .secondary { min-height: 42px; border-radius: 8px; padding: 0 16px; font-size: 13px; font-weight: 750; transition: .18s; }
.primary { border: 1px solid var(--teal); background: var(--teal); color: white; box-shadow: 0 6px 18px rgba(20,117,101,.16); }
.primary:hover { background: #0e695b; transform: translateY(-1px); }
.secondary { border: 1px solid #c7d7d4; background: white; color: var(--teal); }
.secondary:hover { border-color: var(--teal); }
.full { width: 100%; }
.text-button, .back-button { padding: 5px; border: 0; color: var(--teal); background: transparent; font-size: 12px; font-weight: 750; }
.back-button { margin: 0 0 12px -5px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 8px; font-size: 20px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.metric { min-height: 122px; padding: 21px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 7px 24px rgba(17,48,59,.045); }
.metric-top { display: flex; justify-content: space-between; gap: 10px; }
.metric-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--teal-light); color: var(--teal); }
.metric-value { margin: 13px 0 2px; font-family: Georgia, serif; font-size: 31px; }
.metric-label { color: var(--muted); font-size: 12px; }
.metric.attention .metric-icon { color: var(--orange); background: var(--orange-light); }
.metric.high .metric-icon { color: var(--red); background: var(--red-light); }
.skeleton { background: linear-gradient(110deg,#fff 30%,#edf3f1 45%,#fff 60%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position-x: -300%; } }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, .8fr); gap: 18px; margin-bottom: 18px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 7px 24px rgba(17,48,59,.045); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-heading h2, .report-form h2 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
.data-label { padding: 6px 9px; border-radius: 20px; color: #65777d; background: #eef3f2; font-size: 10px; white-space: nowrap; }
.map-canvas { position: relative; overflow: hidden; height: 295px; border-radius: 9px; background: #e6efec; }
.map-grid { position: absolute; inset: 0; opacity: .34; background-image: linear-gradient(#c4d8d3 1px, transparent 1px), linear-gradient(90deg,#c4d8d3 1px,transparent 1px); background-size: 42px 42px; transform: rotate(-8deg) scale(1.2); }
.map-road { position: absolute; height: 3px; border-radius: 5px; background: rgba(255,255,255,.95); box-shadow: 0 0 0 1px rgba(173,196,190,.35); transform-origin: left; }
.road-a { width: 120%; left: -8%; top: 44%; transform: rotate(-9deg); }
.road-b { width: 96%; left: 15%; top: 15%; transform: rotate(68deg); }
.road-c { width: 95%; left: -2%; top: 78%; transform: rotate(-26deg); }
.road-d { width: 65%; right: -11%; top: 67%; transform: rotate(16deg); }
.map-label { position: absolute; color: #829590; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.label-denver { top: 49%; left: 47%; }
.map-marker { position: absolute; z-index: 3; width: 22px; height: 22px; display: grid; place-items: center; border: 3px solid white; border-radius: 50% 50% 50% 4px; background: var(--teal); color: white; box-shadow: 0 5px 14px rgba(17,48,59,.25); transform: rotate(-45deg); }
.map-marker span { font-size: 7px; transform: rotate(45deg); }
.map-marker.stale { background: var(--orange); }
.map-marker.marker-0 { left: 32%; top: 27%; }
.map-marker.marker-1 { left: 58%; top: 61%; }
.map-marker.marker-2 { left: 69%; top: 33%; }
.map-marker.marker-3 { left: 41%; top: 72%; }
.map-marker.marker-4 { left: 77%; top: 55%; }
.map-marker.marker-5 { left: 22%; top: 62%; }
.map-marker::after { content: attr(data-label); position: absolute; left: 22px; top: -4px; width: max-content; padding: 5px 7px; border-radius: 5px; color: var(--ink); background: rgba(255,255,255,.9); box-shadow: 0 2px 8px rgba(17,48,59,.08); font-size: 9px; font-weight: 700; transform: rotate(45deg); }
.map-legend { display: flex; gap: 15px; align-items: center; margin-top: 12px; color: #76868c; font-size: 10px; }
.map-legend > span:last-child { margin-left: auto; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; }
.active-dot { background: var(--teal); }.stale-dot { background: var(--orange); }
.stack-list { display: grid; gap: 8px; }
.alert-row { width: 100%; display: grid; grid-template-columns: 7px 1fr auto; gap: 11px; align-items: start; padding: 13px; border: 1px solid transparent; border-radius: 8px; background: #f7f9f8; color: inherit; text-align: left; transition: .18s; }
.alert-row:hover, .alert-row.selected { border-color: #bfd8d3; background: #f0f7f5; }
.severity-line { width: 4px; min-height: 40px; border-radius: 4px; background: var(--gold); }
.severity-line.high { background: var(--red); }.severity-line.low { background: var(--teal); }
.alert-row strong { display: block; margin-bottom: 4px; font-size: 12px; }
.alert-row small { color: var(--muted); font-size: 10px; }
.alert-row time { color: #839197; font-size: 9px; white-space: nowrap; }
.stack-list.large .alert-row { padding: 17px 15px; }
.stack-list.large .alert-row strong { font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 9px 11px; border-bottom: 1px solid var(--line); color: #7d8c91; font-size: 9px; letter-spacing: .09em; text-align: left; text-transform: uppercase; }
td { padding: 14px 11px; border-bottom: 1px solid #edf1f0; font-size: 12px; }
tbody tr:last-child td { border-bottom: 0; }
.person-cell { display: grid; gap: 3px; }.person-cell small { color: var(--muted); }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 20px; background: var(--teal-light); color: var(--teal); font-size: 9px; font-weight: 800; text-transform: capitalize; }
.status-chip.offline, .status-chip.review { color: var(--orange); background: var(--orange-light); }
.status-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.battery { width: 52px; height: 6px; overflow: hidden; border: 0; border-radius: 5px; background: #e5ebea; }
.battery::-webkit-progress-bar { background: #e5ebea; border-radius: 5px; }
.battery::-webkit-progress-value { background: var(--teal); border-radius: 5px; }
.battery::-moz-progress-bar { background: var(--teal); border-radius: 5px; }
.battery.low::-webkit-progress-value, .battery.low::-moz-progress-bar { background: var(--orange); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
.search-field { width: min(380px, 100%); display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid #d6e0de; border-radius: 8px; }
.search-field input { border: 0; box-shadow: none; padding-left: 0; }
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.case-card { display: grid; gap: 16px; padding: 19px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; }
.case-card:hover { border-color: #b9d4cf; box-shadow: 0 8px 23px rgba(17,48,59,.06); }
.case-card header { display: flex; justify-content: space-between; gap: 10px; }
.case-card h3 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.case-card header small { color: var(--muted); }
.case-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.case-stats div { padding: 9px; border-radius: 7px; background: white; }
.case-stats strong { display: block; margin-bottom: 4px; font-size: 12px; }
.case-stats small { color: var(--muted); font-size: 9px; }
.case-card footer { display: flex; align-items: center; justify-content: space-between; }
.notice { display: flex; gap: 8px; margin-bottom: 18px; padding: 13px 15px; border-left: 3px solid var(--teal); border-radius: 6px; background: #eaf6f3; color: #3d5b61; font-size: 12px; }
.notice.compact { display: grid; margin: 0; }
.alerts-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; }
.detail-panel { min-height: 390px; }
.empty-state { height: 100%; min-height: 340px; display: grid; align-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-state > span { font-size: 28px; color: #8ab7af; }
.empty-state h3 { margin: 12px 0 4px; color: var(--ink); }
.empty-state p { max-width: 320px; font-size: 12px; line-height: 1.5; }
.alert-detail h2 { font-family: Georgia, serif; font-weight: 500; font-size: 29px; }
.alert-detail dl { display: grid; grid-template-columns: 120px 1fr; gap: 11px; padding: 16px 0; border-block: 1px solid var(--line); font-size: 12px; }
.alert-detail dt { color: var(--muted); }.alert-detail dd { margin: 0; font-weight: 650; }
.alert-detail label { display: grid; gap: 7px; margin-top: 18px; color: #30464e; font-size: 12px; font-weight: 700; }
.report-builder { display: grid; grid-template-columns: .8fr 1.2fr; overflow: hidden; padding: 0; }
.report-illustration { min-height: 460px; display: grid; place-items: center; position: relative; background: linear-gradient(140deg,#173e49,#1c5c60); color: white; }
.report-illustration span { width: 150px; height: 190px; display: grid; place-items: center; border-radius: 8px; background: #f8fbfa; color: var(--teal); box-shadow: 16px 20px 50px rgba(0,0,0,.25); font-size: 52px; transform: rotate(-4deg); }
.report-illustration i { position: absolute; width: 90px; height: 1px; background: rgba(123,209,194,.38); }
.report-illustration i:nth-child(2) { top: 22%; left: 12%; transform: rotate(22deg); }
.report-illustration i:nth-child(3) { bottom: 25%; right: 8%; transform: rotate(-31deg); }
.report-form { display: grid; align-content: center; gap: 17px; padding: 48px; }
.button-row { display: flex; gap: 10px; margin-top: 5px; }
.integrity-badge { padding: 8px 11px; border-radius: 20px; color: #61757a; background: #e8eeee; font-size: 11px; }
.integrity-badge.valid { color: var(--teal); background: var(--teal-light); }
.timeline { position: relative; display: grid; gap: 4px; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 1px; background: #d6e4e1; }
.timeline-entry { position: relative; display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; padding: 11px 0; }
.timeline-dot { z-index: 1; width: 27px; height: 27px; display: grid; place-items: center; border: 5px solid white; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 1px #c9ddd9; color: white; font-size: 7px; }
.timeline-entry strong { display: block; margin-bottom: 3px; font-size: 12px; }
.timeline-entry p, .timeline-entry time { margin: 0; color: var(--muted); font-size: 10px; }
.timeline-entry time { white-space: nowrap; }
.subject-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; }
.detail-list { display: grid; gap: 12px; }
.event-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 11px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf1f0; }
.event-item:last-child { border: 0; }
.event-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--teal); background: var(--teal-light); font-size: 12px; }
.event-item strong { display: block; margin-bottom: 3px; font-size: 12px; }
.event-item small, .event-item time { color: var(--muted); font-size: 10px; }

dialog { width: min(520px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 28px 80px rgba(5,28,36,.28); }
dialog::backdrop { background: rgba(9,31,39,.64); backdrop-filter: blur(3px); }
.dialog-card { padding: 26px; }
.dialog-heading { display: flex; justify-content: space-between; margin-bottom: 24px; }
.dialog-heading h2 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 27px; font-weight: 500; }
#enrollment-fields { display: grid; gap: 17px; }
.enrollment-result { display: grid; justify-items: center; gap: 11px; text-align: center; }
.enrollment-result h3 { margin: 2px 0 0; }
.enrollment-result p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.enrollment-result code { width: 100%; padding: 13px; border-radius: 7px; background: #eef5f3; color: var(--teal); word-break: break-all; }
.enrollment-result small { color: var(--muted); }
.success-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-light); color: var(--teal); font-size: 23px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; max-width: min(420px, calc(100% - 30px)); padding: 12px 16px; border-radius: 8px; background: var(--navy); color: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .22s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.public-links { margin: 12px 0 0; text-align: center; }
.public-links a { color: var(--teal); font-size: 11px; font-weight: 750; text-decoration: none; }
.public-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.public-links span { display: inline-block; margin-left: 4px; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 28px; align-content: center; }
  .login-panel > .mobile-brand { display: flex; position: absolute; top: 24px; left: 28px; }
  .sidebar { width: min(280px, 84vw); transform: translateX(-105%); transition: .23s; box-shadow: 15px 0 45px rgba(5,28,36,.25); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { position: sticky; top: 0; z-index: 15; min-height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
  .mobile-header .brand-mark { width: 30px; height: 30px; }
  .workspace { margin-left: 0; padding: 26px 17px 60px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .page-heading h1 { font-size: 36px; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric { min-height: 110px; padding: 16px; }
  .map-canvas { height: 250px; }
  .map-legend > span:last-child { display: none; }
  .panel { padding: 17px; }
  .case-grid, .alerts-layout, .subject-grid { grid-template-columns: 1fr; }
  .report-builder { grid-template-columns: 1fr; }
  .report-illustration { min-height: 190px; }
  .report-illustration span { width: 85px; height: 110px; font-size: 32px; }
  .report-form { padding: 28px 22px; }
  .button-row { flex-direction: column; }
}

@media (max-width: 430px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-label { font-size: 10px; }
  .map-marker::after { display: none; }
}

@media print {
  .sidebar, .mobile-header, button { display: none !important; }
  .workspace { margin: 0; padding: 0; }
  .panel { box-shadow: none; break-inside: avoid; }
}
