:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1a2a31;
  background: #f3f6f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #1a2a31;
  --muted: #71818a;
  --line: #e3eaed;
  --brand: #155990;
  --brand-dark: #10436d;
  --accent: #d9574f;
  --surface: #fff;
  --nav: #123c5c;
  --shadow: 0 14px 42px #2337400c;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

#app { min-height: 100vh; }
#login {
  width: min(100% - 32px, 1080px);
  min-height: min(680px, calc(100vh - 48px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  border: 1px solid #dce6e9;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 28px 90px #20384118;
}
.login-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(30px, 5vw, 58px);
  color: #fff;
  background: radial-gradient(circle at 90% 12%, #00c2ff55, transparent 34%), linear-gradient(145deg, #103e65, #155990 62%, #1b6ba0);
}
.login-aside::before { position: absolute; inset: 0 0 auto; height: 7px; background: linear-gradient(to right, #155990 15%, #00c2ff 15% 30%, #fbbb1c 30% 45%, #0d933f 45% 67%, #e02831 67% 85%, #f47912 85%); content: ""; }
.login-aside::after {
  position: absolute;
  right: -90px;
  bottom: -145px;
  width: 430px;
  height: 430px;
  border: 1px solid #ffffff20;
  border-radius: 50%;
  box-shadow: 0 0 0 44px #ffffff0a, 0 0 0 90px #ffffff08;
  content: "";
}
.brand-lockup { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.municipal-crest { display: block; width: 190px; height: auto; padding: 8px; border-radius: 10px; background: #fff; }
.municipal-crest.compact { width: 86px; padding: 4px; }
.brand-lockup .product-name { font-size: 14px; font-weight: 650; letter-spacing: .01em; }
.product-name strong { display: block; color: #fff; font-size: 19px; }
.login-message { position: relative; z-index: 1; max-width: 440px; margin: 60px 0; }
.login-message .eyebrow { color: #d4edff; }
.login-message h2 { max-width: 400px; margin: 0 0 16px; font-size: clamp(32px, 4vw, 48px); line-height: 1.07; letter-spacing: -.055em; }
.login-message p:last-child { max-width: 360px; margin: 0; color: #d0e3df; font-size: 15px; line-height: 1.7; }
.login-footnote { position: relative; z-index: 1; color: #c4d9d5; font-size: 11px; }
.login-form-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 6vw, 72px); }
.eyebrow { margin: 0 0 10px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.login-form-panel h1 { margin: 0 0 9px; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.045em; }
.muted { color: var(--muted); line-height: 1.65; }
.login-form-panel > .muted { margin: 0; font-size: 14px; }
.login-form-panel form { display: grid; gap: 17px; margin-top: 32px; }
.login-card label, .field { display: grid; gap: 8px; color: #43545b; font-size: 12px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid #d8e2e6;
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, select:focus, textarea:focus { border-color: #00a4db; box-shadow: 0 0 0 3px #00a4db24; }
input::placeholder, textarea::placeholder { color: #a4afb4; }
.button {
  min-height: 40px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .nav-link:focus-visible { outline: 3px solid #00c2ff70; outline-offset: 2px; }
.button:disabled { cursor: wait; opacity: .56; transform: none; }
.primary { background: var(--brand); color: #fff; box-shadow: 0 5px 12px #15599020; }
.primary:hover { background: var(--brand-dark); }
.outline { border-color: var(--line); background: #fff; color: var(--ink); }
.outline:hover { background: #f6f9fa; }
.subtle { background: transparent; color: inherit; }
.form-error { min-height: 20px; margin: 0; color: #ac3937; font-size: 12px; }

.shell { display: grid; min-height: 100vh; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 24px 14px 16px;
  background: var(--nav);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 5px 23px; color: #fff; text-decoration: none; font-size: 12px; font-weight: 650; line-height: 1.3; }
.brand strong { display: block; color: #b9e8ff; font-size: 15px; }
#navigation { display: grid; gap: 4px; overflow: auto; }
.nav-link { display: flex; min-height: 42px; align-items: center; gap: 11px; padding: 9px 11px; border: 0; border-radius: 9px; background: transparent; color: #b6c8cc; text-align: left; font-size: 12px; font-weight: 600; }
.nav-link:hover, .nav-link.selected { background: #ffffff12; color: #fff; }
.nav-link.selected { box-shadow: inset 3px 0 #00c2ff; }
.nav-link:hover .nav-icon, .nav-link.selected .nav-icon { color: #70d3ff; }
.nav-icon { display: grid; width: 21px; height: 21px; flex: 0 0 21px; place-items: center; color: #a7c9dc; }
.nav-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.sidebar-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 14px 9px 0; border-top: 1px solid #ffffff1c; color: #d7e2e3; font-size: 11px; }
.sidebar-bottom #user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; height: 86px; align-items: center; justify-content: space-between; padding: 16px clamp(20px, 4vw, 56px); border-bottom: 1px solid var(--line); background: #ffffffed; backdrop-filter: blur(12px); }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.topbar .eyebrow { margin-bottom: 4px; font-size: 9px; }
.connection { display: inline-flex; align-items: center; gap: 8px; color: #526c67; font-size: 11px; font-weight: 650; }
.connection i { width: 8px; height: 8px; border-radius: 50%; background: #35a672; box-shadow: 0 0 0 4px #35a6721c; }
.menu-toggle { display: none; border: 0; border-radius: 9px; padding: 9px; background: #edf4f4; }
.menu-toggle svg { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.content { width: 100%; max-width: 1500px; margin: 0 auto; padding: clamp(20px, 4vw, 50px); }

.welcome { position: relative; overflow: hidden; margin-bottom: 22px; padding: clamp(22px, 3vw, 34px); border: 1px solid #c9e1ef; border-radius: 17px; background: radial-gradient(circle at 95% 5%, #d9effa 0, transparent 35%), linear-gradient(110deg, #fff, #f1f8fc); }
.welcome::after { position: absolute; right: 8%; bottom: -48px; width: 210px; height: 210px; border: 1px solid #15599015; border-radius: 50%; box-shadow: 0 0 0 28px #15599008; content: ""; }
.welcome h2 { position: relative; z-index: 1; margin: 0 0 9px; font-size: clamp(20px, 2.4vw, 28px); letter-spacing: -.045em; }
.welcome p:last-child { position: relative; z-index: 1; max-width: 680px; margin: 0; font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.metric { display: grid; min-height: 130px; gap: 10px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.metric-label { color: #596d74; font-size: 11px; font-weight: 700; }
.metric-value { color: #1c3c40; font-size: 30px; font-weight: 800; letter-spacing: -.06em; }
.small { font-size: 10px; }
.quick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 22px; padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.quick-actions h3 { width: 100%; margin: 0 0 3px; font-size: 14px; letter-spacing: -.02em; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-heading p { margin: 0; font-size: 12px; }
.section-heading .heading-copy { display: grid; gap: 3px; }
.section-heading h2 { margin: 0; font-size: 19px; letter-spacing: -.035em; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.search-input { width: min(290px, 100%); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.data-table { width: 100%; min-width: 650px; border-collapse: collapse; text-align: left; }
.data-table th, .data-table td { padding: 13px 15px; border-bottom: 1px solid #edf1f2; font-size: 11px; vertical-align: top; }
.data-table th { position: sticky; top: 0; background: #f6f9fa; color: #718087; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.data-table tr:hover td { background: #fafcfc; }
.data-table tr:last-child td { border-bottom: 0; }
.record-list { display: grid; gap: 11px; }
.record-card { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.record-card h3 { margin: 0; font-size: 14px; letter-spacing: -.025em; }
.record-card p { margin: 9px 0 0; font-size: 12px; line-height: 1.55; }
.record-top, .record-actions, .poc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; }
.record-actions { justify-content: flex-start; margin-top: 14px; }
.attachment-gallery { display: flex; flex-wrap: wrap; gap: 9px; width: 100%; }
.attachment-link { display: grid; width: 126px; gap: 6px; color: #365a5c; font-size: 10px; text-decoration: none; }
.attachment-link img { width: 126px; height: 84px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #f4f7f8; }
.badge { display: inline-flex; align-items: center; min-height: 23px; padding: 4px 8px; border-radius: 20px; background: #eef2f3; color: #596a70; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.badge.requested, .badge.pending { background: #fff2d4; color: #8c641a; }
.badge.in_progress, .badge.approved, .badge.ready { background: #ddf3e9; color: #1a6849; }
.badge.rejected, .badge.cancelled, .badge.external { background: #fbe7e8; color: #a33440; }
.badge.partial { background: #fff0dc; color: #93631d; }
.notice { padding: 13px 15px; border: 1px solid #c9e1ef; border-radius: 10px; background: #f0f8fc; color: #365a70; font-size: 12px; line-height: 1.6; }
.telemetry-notice { margin: 14px 0; }
.notice.warning { margin: 0 0 14px; border-color: #efd9a6; background: #fff8e8; color: #77591f; }
.notice.error { border-color: #f1cece; background: #fff1f1; color: #9e2b35; }
.empty-state, .loading { padding: 38px; border: 1px dashed #d5e0e3; border-radius: 13px; background: #fff; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 14px; }
.modal-backdrop { position: fixed; z-index: 20; display: grid; overflow: auto; place-items: center; padding: 20px; background: #10262cb8; inset: 0; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 23px; border: 1px solid #e1e9ec; border-radius: 16px; background: #fff; box-shadow: 0 28px 100px #0004; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-header h2 { margin: 0; font-size: 18px; letter-spacing: -.035em; }
.modal-header .button { padding: 2px 10px; font-size: 22px; }
.record-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.record-form .field { min-width: 0; }
.record-form .field:has(textarea), .record-form .field:has(.signature), .record-form .form-actions, .record-form .field.full { grid-column: 1 / -1; }
.health-fields { display: contents; }
.health-fields[hidden] { display: none; }
textarea { min-height: 90px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.signature { width: 100%; height: 140px; border: 1px solid #dce4e0; border-radius: 10px; background: repeating-linear-gradient(0deg, #fff 0 34px, #edf1ef 35px); touch-action: none; }
.checklist { display: grid; grid-column: 1/-1; gap: 8px; }
.checklist-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(150px, .8fr); align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfc; font-size: 11px; font-weight: 700; }
.poc-intro { margin: 22px 0; }
.poc-intro h2 { margin: 0 0 8px; font-size: 23px; letter-spacing: -.04em; }
.poc-intro p:last-child { max-width: 860px; margin-bottom: 0; font-size: 12px; }
.poc-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.poc-summary article { display: flex; align-items: center; justify-content: space-between; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.poc-summary strong { font-size: 22px; }
.poc-summary span { color: var(--muted); font-size: 10px; font-weight: 700; }
.poc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.poc-card { padding: 17px; border: 1px solid var(--line); border-left: 4px solid #93a09b; border-radius: 12px; background: #fff; }
.poc-card.ready { border-left-color: #31966d; }
.poc-card.partial { border-left-color: #d59831; }
.poc-card.external { border-left-color: #bc3b47; }
.poc-card h3 { margin: 13px 0 7px; font-size: 13px; line-height: 1.5; }
.poc-card p { margin: 0; font-size: 11px; line-height: 1.6; }
.poc-id { color: #53655e; font-size: 10px; font-weight: 800; }
.status-line { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #d49b33; }
.inspection-items { display: grid; gap: 5px; margin-top: 12px; }
.inspection-items span { color: #52656b; font-size: 11px; }
@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shell { grid-template-columns: 224px minmax(0, 1fr); }
  .sidebar { padding-right: 10px; padding-left: 10px; }
  .content { padding: 28px; }
}
@media (max-width: 860px) {
  #login { width: min(100% - 32px, 720px); min-height: 0; grid-template-columns: 1fr; }
  .login-aside { min-height: 290px; padding: 34px; }
  .login-message { margin: 34px 0; }
}
@media (max-width: 760px) {
  #login { width: min(100% - 20px, 520px); min-height: 0; grid-template-columns: 1fr; margin: 10px auto; border-radius: 19px; }
  .login-aside { min-height: 215px; padding: 22px; }
  .login-message { margin: 28px 0 14px; }
  .login-message h2 { max-width: 420px; font-size: 27px; }
  .login-message p:last-child, .login-footnote { display: none; }
  .municipal-crest { width: 150px; }
  .municipal-crest.compact { width: 72px; }
  .login-form-panel { padding: 26px 22px 30px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -270px; width: 252px; transition: left .2s ease; box-shadow: 12px 0 35px #0d171544; }
  .sidebar.open { left: 0; }
  .topbar { min-height: 74px; height: auto; justify-content: flex-start; gap: 12px; padding: 11px 15px; }
  .topbar > div { min-width: 0; }
  .menu-toggle { display: block; flex: 0 0 auto; }
  .topbar h1 { font-size: 18px; }
  .connection { margin-left: auto; font-size: 0; }
  .content { padding: 18px 13px; }
  .welcome { padding: 20px; }
  .welcome h2 { font-size: 20px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { min-height: 110px; padding: 13px; }
  .metric-value { font-size: 25px; }
  .poc-list { grid-template-columns: 1fr; }
  .poc-summary { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .section-heading .button { white-space: normal; }
  .record-form { grid-template-columns: 1fr; }
  .record-form .field { grid-column: 1/-1; }
  .checklist-row { grid-template-columns: 1fr; }
  .form-actions { flex-wrap: wrap; }
  .modal-backdrop { padding: 9px; }
  .modal { max-height: calc(100vh - 18px); padding: 16px; }
  .quick-actions { align-items: stretch; }
  .quick-actions .button { flex: 1 1 45%; }
}
@media (max-width: 420px) {
  #login { width: calc(100% - 16px); margin: 8px auto; }
  .login-aside { min-height: 190px; padding: 18px; }
  .brand-lockup { gap: 10px; }
  .municipal-crest { width: 126px; padding: 5px; }
  .brand-lockup .product-name { font-size: 12px; }
  .product-name strong { font-size: 17px; }
  .login-message { margin: 24px 0 8px; }
  .login-message h2 { font-size: clamp(22px, 7vw, 26px); }
  .login-form-panel { padding: 22px 18px 24px; }
  .content { padding-right: 10px; padding-left: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
