:root {
  --ink: #102a2d;
  --ink-soft: #486165;
  --paper: #f5f1e8;
  --card: #fffdf8;
  --line: #dcdad0;
  --sage: #719b83;
  --mint: #b7d3c1;
  --gold: #ebb24d;
  --coral: #e76b5d;
  --blue: #6a9cc1;
  --purple: #8778c7;
  --display: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.shell { margin: 0 auto; max-width: 1640px; padding: 30px clamp(16px, 4vw, 62px) 56px; }
.topbar, .brand, .top-actions, .hero, .hero-actions, .panel-title, .filter-row, .legend, .detail-heading, .meta, .actions { align-items: center; display: flex; }
.topbar { justify-content: space-between; margin-bottom: 54px; }
.brand { gap: 12px; }
.brand-mark { align-items: center; background: var(--ink); border-radius: 13px; color: var(--gold); display: inline-flex; font-size: 19px; font-weight: 800; height: 42px; justify-content: center; width: 42px; }
.brand-name { font-size: 12px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.brand-context { border-left: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; margin-left: 4px; padding-left: 16px; }
.top-actions, .hero-actions, .actions { gap: 9px; }
.button, .filter, .search { border-radius: 999px; font-size: 12px; }
.button { background: var(--ink); border: 1px solid var(--ink); color: #fffdf8; font-weight: 800; padding: 11px 17px; }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.button:hover, .button:focus-visible { background: #1e4a4c; }
.button.secondary:hover, .button.secondary:focus-visible { background: var(--card); }

.hero { align-items: flex-end; gap: 26px; justify-content: space-between; margin-bottom: 32px; }
.eyebrow, .kicker { color: var(--sage); font-size: 11px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow { margin: 0 0 13px; }
h1 { font-family: var(--display); font-size: clamp(38px, 5vw, 68px); font-weight: 400; letter-spacing: -.06em; line-height: .96; margin: 0; max-width: 680px; }
h1 em { color: var(--sage); }
.hero-copy { color: var(--ink-soft); font-size: 14px; line-height: 1.6; margin: 19px 0 0; max-width: 580px; }
.hero-actions { flex-shrink: 0; }

.metrics { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.metric, .panel, .insight { background: var(--card); border: 1px solid rgba(16, 42, 45, .09); border-radius: 24px; }
.metric { min-height: 140px; overflow: hidden; padding: 20px; position: relative; }
.metric::after { border: 1px solid currentColor; border-radius: 50%; content: ""; height: 108px; opacity: .12; position: absolute; right: -32px; top: -42px; width: 108px; }
.metric:nth-child(1) { color: var(--ink); } .metric:nth-child(2) { color: var(--sage); } .metric:nth-child(3) { color: var(--coral); } .metric:nth-child(4) { color: var(--purple); }
.metric-label { color: var(--ink-soft); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.metric-value { color: var(--ink); display: block; font-family: var(--display); font-size: 42px; letter-spacing: -.08em; line-height: 1; margin: 21px 0 8px; }
.metric-value small { font-family: var(--sans); font-size: 14px; letter-spacing: 0; }
.metric-note { color: var(--ink-soft); font-size: 11px; }

.workspace { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.58fr) minmax(330px, .72fr); margin-bottom: 18px; }
.map-panel { min-width: 0; padding: 23px; }
.detail-panel { min-height: 688px; padding: 25px; }
.panel-title { justify-content: space-between; margin-bottom: 17px; }
.panel-title h2, .insight h3 { font-size: 17px; letter-spacing: -.03em; margin: 4px 0 0; }
.search { background: var(--paper); border: 1px solid transparent; color: var(--ink); outline: 0; padding: 9px 13px; width: 170px; }
.search:focus { border-color: var(--mint); }
.filter-row { gap: 7px; margin-bottom: 14px; overflow-x: auto; }
.filter { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); flex-shrink: 0; font-weight: 800; padding: 8px 12px; }
.filter.active, .filter:hover, .filter:focus-visible { background: var(--ink); border-color: var(--ink); color: #fffdf8; }
.map-wrap { border-radius: 18px; height: 570px; overflow: hidden; position: relative; }
#map { background: #d7e2da; height: 100%; overflow: hidden; position: relative; width: 100%; }
.vector-canvas { height: 100%; inset: 0; pointer-events: none; position: absolute; width: 100%; z-index: 450; }
.map-note, .legend { background: rgba(255, 253, 248, .94); border-radius: 11px; bottom: 12px; font-size: 10px; position: absolute; z-index: 500; }
.map-note { color: var(--ink-soft); left: 12px; padding: 7px 10px; }
.legend { gap: 10px; padding: 9px 11px; right: 12px; }
.legend-item { align-items: center; color: var(--ink-soft); display: flex; gap: 5px; white-space: nowrap; }
.dot { border-radius: 50%; display: inline-block; height: 8px; width: 8px; }
.dot.multisensor { background: var(--coral); } .dot.sentinel2 { background: var(--gold); } .dot.sentinel1 { background: var(--blue); } .dot.normal { background: var(--sage); }
.zone-swatch { border: 1px solid currentColor; border-radius: 3px; display: inline-block; height: 9px; opacity: .85; width: 13px; }
.zone-swatch.multisensor { background: rgba(231, 107, 93, .35); color: var(--coral); } .zone-swatch.sentinel2 { background: rgba(235, 178, 77, .35); color: var(--gold); } .zone-swatch.sentinel1 { background: rgba(106, 156, 193, .35); color: var(--blue); } .zone-swatch.normal { background: rgba(113, 155, 131, .3); color: var(--sage); }
.legend-help { border-left: 1px solid var(--line); color: var(--ink-soft); padding-left: 10px; white-space: nowrap; }

.empty, .login-card { background: var(--paper); border-radius: 18px; }
.empty { align-items: flex-start; color: var(--ink-soft); display: flex; flex-direction: column; justify-content: flex-end; min-height: 270px; padding: 22px; }
.empty-mark { color: var(--gold); font-size: 34px; margin-bottom: auto; }
.empty strong { color: var(--ink); font-size: 16px; margin-bottom: 7px; }
.empty p { font-size: 12px; line-height: 1.55; margin: 0; }
.detail-id { color: var(--sage); font-size: 11px; font-weight: 900; letter-spacing: .12em; margin: 0 0 7px; text-transform: uppercase; }
.detail-heading { align-items: flex-start; justify-content: space-between; }
.detail-heading h2 { font-family: var(--display); font-size: 34px; font-weight: 400; letter-spacing: -.055em; line-height: 1; margin: 0; }
.badge { border-radius: 999px; font-size: 10px; font-weight: 900; padding: 7px 9px; text-transform: uppercase; }
.badge.multisensor { background: #fae0d8; color: #9e3f36; } .badge.sentinel2 { background: #fbedc8; color: #87601b; } .badge.sentinel1 { background: #dcebf7; color: #2c628b; } .badge.normal { background: #dfeee3; color: #3f7655; }
.meta { color: var(--ink-soft); flex-wrap: wrap; font-size: 11px; gap: 7px 14px; margin: 14px 0 24px; }
.meta span::before { color: var(--gold); content: "•"; margin-right: 5px; }
.section-title { border-bottom: 1px solid var(--line); color: var(--sage); font-size: 10px; font-weight: 900; letter-spacing: .13em; margin: 0 0 12px; padding-bottom: 9px; text-transform: uppercase; }
.index-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 22px; }
.index { background: var(--paper); border-radius: 12px; padding: 12px; }
.index-label { color: var(--ink-soft); display: block; font-size: 10px; margin-bottom: 7px; }
.index-value { color: var(--ink); font-family: var(--display); font-size: 23px; }
.actions .button { flex: 1; text-align: center; }
.inspection { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 20px; }
.inspection[hidden], .detail[hidden] { display: none; }
.inspection label { color: var(--ink-soft); display: block; font-size: 11px; font-weight: 800; margin-bottom: 7px; }
.inspection select, .inspection textarea { background: var(--paper); border: 1px solid transparent; border-radius: 10px; color: var(--ink); font-size: 12px; margin-bottom: 13px; padding: 10px; width: 100%; }
.inspection textarea { min-height: 70px; resize: vertical; }
.status { color: var(--sage); font-size: 11px; line-height: 1.5; margin: 9px 0 0; }

.insights { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.insight { padding: 22px 24px; }
.insight-head { align-items: baseline; display: flex; justify-content: space-between; margin-bottom: 20px; }
.insight-head span { color: var(--ink-soft); font-size: 11px; }
.bars { display: grid; gap: 12px; }
.bar-row { align-items: center; display: grid; gap: 10px; grid-template-columns: 104px 1fr 48px; }
.bar-label, .bar-value { color: var(--ink-soft); font-size: 11px; } .bar-value { font-weight: 900; text-align: right; }
.bar-track { background: var(--paper); border-radius: 999px; height: 9px; overflow: hidden; } .bar-fill { border-radius: inherit; height: 100%; min-width: 5px; }
.bar-fill.multisensor { background: var(--coral); } .bar-fill.sentinel2 { background: var(--gold); } .bar-fill.sentinel1 { background: var(--blue); } .bar-fill.normal { background: var(--sage); }
.footnote { color: var(--ink-soft); font-size: 11px; line-height: 1.6; margin: 18px 0 0; } .footnote strong { color: var(--ink); }

.login-shell { align-items: center; display: flex; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { background: var(--card); border: 1px solid rgba(16, 42, 45, .09); max-width: 440px; padding: 40px; width: 100%; }
.login-card h1 { font-size: 46px; margin: 20px 0 0; } .login-card p { color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.login-card label { color: var(--ink-soft); display: block; font-size: 11px; font-weight: 800; margin: 17px 0 7px; }
.login-card input { background: var(--paper); border: 1px solid transparent; border-radius: 11px; color: var(--ink); padding: 12px; width: 100%; }
.login-card input:focus { border-color: var(--mint); outline: 0; }
.login-card .button { margin-top: 21px; width: 100%; }
.login-error { color: var(--coral); font-size: 12px; min-height: 18px; }
.offline-note { color: var(--sage); font-size: 11px; margin-top: 12px; }

@media (max-width: 1120px) { .workspace { grid-template-columns: 1fr; } .detail-panel { min-height: auto; } }
@media (max-width: 760px) {
  .shell { padding: 20px 14px 36px; } .topbar { margin-bottom: 38px; } .brand-context { display: none; }
  .hero { align-items: flex-start; flex-direction: column; } .hero-actions { width: 100%; } .hero-actions .button { flex: 1; }
  .metrics, .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); } .metric { min-height: 122px; padding: 16px; } .metric-value { font-size: 32px; }
  .map-panel, .detail-panel, .insight { padding: 17px; } .map-wrap { height: 450px; } .legend { align-items: flex-start; flex-direction: column; gap: 5px; }
  .map-note { bottom: auto; top: 12px; } .panel-title { align-items: flex-start; flex-direction: column; gap: 12px; } .search { width: 100%; }
  .bar-row { grid-template-columns: 78px 1fr 40px; } .login-card { padding: 28px 22px; }
}
