/* EarthScape Climate Agency portal stylesheet.
   Plain CSS, no framework. Order: fonts, tokens, shell, hero, components, pages. */

@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/plus-jakarta-sans-400.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/plus-jakarta-sans-500.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/plus-jakarta-sans-600.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("../vendor/fonts/plus-jakarta-sans-700.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url("../vendor/fonts/bricolage-grotesque-600.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-display: swap; src: url("../vendor/fonts/bricolage-grotesque-700.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("../vendor/fonts/bricolage-grotesque-800.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("../vendor/fonts/jetbrains-mono-400.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("../vendor/fonts/jetbrains-mono-500.woff2") format("woff2"); }

:root {
  --bg: #f1efe8;
  --panel: #ffffff;
  --panel-2: #f8f7f2;
  --line: #e2ded2;
  --line-soft: #eeebe2;
  --text: #15232b;
  --text-2: #475861;
  --muted: #86929a;

  --brand: #0b6b66;
  --brand-ink: #074a47;
  --brand-soft: #dff0ed;
  --accent: #e8602c;
  --accent-soft: #fdebe3;

  --side: #09222a;
  --side-2: #123740;
  --side-text: #a8bcc2;
  --side-dim: #6a8890;

  --ok: #1d7a2c;
  --ok-soft: #e4f3e6;
  --warn: #8f6200;
  --warn-dot: #f2a900;
  --warn-soft: #fdf2d6;
  --crit: #b02a2a;
  --crit-dot: #d03b3b;
  --crit-soft: #fbe8e6;
  --info: #235b8f;
  --info-soft: #e5eff8;

  --r: 8px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 35, 40, .05), 0 8px 22px -10px rgba(20, 35, 40, .14);
  --display: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 400 14px/1.55 var(--sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
code, .mono { font-family: var(--mono); font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
  background: linear-gradient(180deg, var(--side) 0%, #0c2b33 100%);
  color: var(--side-text);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: #1d4650 transparent;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; color: #fff; }
.brand svg { flex: none; }
.brand b { display: block; font: 700 18px/1.1 var(--display); letter-spacing: -0.01em; }
.brand small { display: block; color: var(--side-dim); font-size: 11.5px; margin-top: 3px; letter-spacing: .03em; }
.nav { padding: 4px 12px 16px; flex: 1; }
.nav h6 {
  margin: 20px 10px 6px; font: 600 10.5px/1 var(--sans); color: var(--side-dim);
  text-transform: uppercase; letter-spacing: .12em;
}
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; margin: 1px 0; border-radius: 9px; color: var(--side-text); font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nav a svg { width: 17px; height: 17px; opacity: .85; flex: none; }
.nav a.on svg { opacity: 1; color: #ffb48f; }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 10px; font-size: 10.5px; font-weight: 700; padding: 1px 7px; }
.side-foot { margin: 0 12px 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-size: 11.5px; color: var(--side-dim); }
.side-foot b { color: #d3e2e6; font-weight: 600; display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.side-foot span { display: block; line-height: 1.6; }
.side-foot i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3fcf8e; margin-right: 7px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 58px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px;
  padding: 0 32px; position: sticky; top: 0; z-index: 60;
}
.crumb { font-size: 12.5px; color: var(--muted); }
.crumb b { color: var(--text-2); font-weight: 600; }
.top .spacer { flex: 1; }
.livepill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-2);
  background: #fff; border: 1px solid var(--line); padding: 4px 11px; border-radius: 20px;
}
.livepill i { width: 8px; height: 8px; border-radius: 50%; background: #b6bec3; }
.livepill.on i { background: #1fa65a; box-shadow: 0 0 0 4px rgba(31, 166, 90, .18); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(31, 166, 90, 0); } }
.iconbtn {
  position: relative; width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text-2); cursor: pointer; font: inherit;
}
.iconbtn:hover { background: #fff; border-color: var(--line); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn .dot {
  position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--accent); color: #fff; border-radius: 9px; font-size: 10px; line-height: 17px; font-weight: 700; text-align: center;
}
.userchip { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; text-align: left; }
.avatar {
  width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), #14948a); color: #fff;
  display: grid; place-items: center; font: 700 14px var(--display);
}
.userchip small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.1; }

/* ---------------------------------------------------------------- hero banner */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(115deg, #08262c 0%, #0b4a4c 55%, #0f7068 100%);
  padding: 30px 32px 74px;
}
.hero::before { content: ""; position: absolute; inset: 0; background: url("../img/contours.svg") center / cover no-repeat; opacity: .9; pointer-events: none; }
.hero::after {
  content: ""; position: absolute; right: -80px; top: -120px; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 96, 44, .35), rgba(232, 96, 44, 0) 70%); pointer-events: none;
}
.hero-in { position: relative; z-index: 1; max-width: 1480px; display: flex; align-items: flex-end; gap: 24px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #8fd5cb; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }
.hero h1 { font-size: 32px; line-height: 1.1; margin: 10px 0 8px; color: #fff; font-weight: 800; letter-spacing: -0.02em; }
.hero h1 .crumbs, .hero h1 .crumbs a { color: #8fd5cb; font-weight: 600; font-size: 20px; }
.hero p { margin: 0; max-width: 680px; color: #b7d3d2; font-size: 14.5px; }
.hero-stripes { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; display: flex; z-index: 1; }
.hero-stripes i { flex: 1; }

.content { padding: 0 32px 48px; max-width: 1544px; width: 100%; margin-top: -46px; position: relative; z-index: 2; }
.banner {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 32px; font-size: 13px;
  background: var(--warn-soft); border-bottom: 1px solid #ecd596; color: #5a4100;
}
.banner.active { background: var(--crit-soft); border-color: #efc2be; color: #7a1d1d; }

/* ---------------------------------------------------------------- dropdown */
.drop { position: relative; }
.drop-panel {
  position: absolute; right: 0; top: 44px; width: 380px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 44px -12px rgba(15, 30, 35, .3);
  display: none; z-index: 100; overflow: hidden;
}
.drop.open .drop-panel { display: block; }
.drop-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.drop-head b { font: 700 14px var(--display); }
.drop-list { max-height: 380px; overflow-y: auto; }
.note { display: block; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.note:hover { background: var(--panel-2); text-decoration: none; }
.note.unread { box-shadow: inset 3px 0 var(--accent); background: #fffdfa; }
.note b { font-size: 13px; display: block; }
.note p { margin: 2px 0 0; color: var(--text-2); font-size: 12.5px; }
.note time { color: var(--muted); font-size: 11.5px; }
.drop-foot { padding: 10px 16px; text-align: center; font-size: 12.5px; font-weight: 600; }

/* ---------------------------------------------------------------- grid and panels */
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-side { grid-template-columns: 330px minmax(0, 1fr); }
.span2 { grid-column: span 2; }
.mt { margin-top: 20px; }
.mb { margin-bottom: 20px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; box-shadow: var(--shadow); overflow: hidden; }
.panel-h { display: flex; align-items: center; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line-soft); }
.panel-h h3 { font-size: 15px; display: flex; align-items: center; gap: 9px; }
.panel-h h3::before { content: ""; width: 5px; height: 16px; border-radius: 3px; background: linear-gradient(180deg, var(--accent), #f39b6c); }
.panel-h .meta { color: var(--muted); font-size: 12.5px; }
.panel-h .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-b { padding: 18px 20px; }
.panel-b.flush { padding: 0; }
.panel-f { padding: 12px 20px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12.5px; background: var(--panel-2); }
.chart { position: relative; height: 290px; }
.chart.tall { height: 370px; }
.chart.short { height: 210px; }
.map { height: 390px; background: #dfe9ea; }
.map.tall { height: 530px; }
.leaflet-container { font: inherit; }
.leaflet-tooltip { font-size: 12px; border-radius: 8px; border-color: var(--line); box-shadow: 0 8px 20px rgba(15, 30, 35, .16); }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.kpi {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px 15px; box-shadow: var(--shadow); overflow: hidden; --k: var(--brand);
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--k); }
.kpi::after { content: ""; position: absolute; right: -26px; bottom: -34px; width: 96px; height: 96px; border-radius: 50%; background: var(--k); opacity: .07; }
.kpi:nth-child(6n+1) { --k: #0b6b66; }
.kpi:nth-child(6n+2) { --k: #e8602c; }
.kpi:nth-child(6n+3) { --k: #2a78d6; }
.kpi:nth-child(6n+4) { --k: #1baf7a; }
.kpi:nth-child(6n+5) { --k: #6250d6; }
.kpi:nth-child(6n+6) { --k: #eda100; }
.kpi label { display: block; font: 600 11px/1.2 var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .09em; }
.kpi .v { font: 800 30px/1.15 var(--display); font-variant-numeric: tabular-nums; margin-top: 6px; letter-spacing: -0.02em; }
.kpi .v small { font: 600 13px var(--sans); color: var(--text-2); margin-left: 3px; letter-spacing: 0; }
.kpi .sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.up { color: #c2491a; }
.down { color: #1f66b3; }

/* climate stripes card */
.stripes-card { position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff; }
.stripes-card .bars { display: flex; height: 120px; }
.stripes-card .bars i { flex: 1; transition: transform .15s; }
.stripes-card .bars i:hover { transform: scaleY(1.06); transform-origin: bottom; }
.stripes-card .cap { display: flex; align-items: center; gap: 16px; padding: 14px 20px; flex-wrap: wrap; }
.stripes-card .cap b { font: 700 15px var(--display); }
.stripes-card .cap span { color: var(--muted); font-size: 12.5px; }
.stripes-card .cap .scale { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.stripes-card .cap .scale i { width: 110px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #2a78d6, #f0efec, #d03b3b); }

/* ---------------------------------------------------------------- tables */
table { border-collapse: collapse; width: 100%; }
.tbl th, .tbl td { padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl th {
  font: 600 10.5px/1.2 var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .09em;
  background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tbody tr:hover { background: #faf9f4; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .muted { color: var(--muted); }
.scroll { max-height: 450px; overflow: auto; }
.scroll.s { max-height: 310px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  padding: 2px 10px 2px 8px; border-radius: 20px; border: 1px solid var(--line); color: var(--text-2); background: #fff; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b0b9be; }
.badge.critical { color: var(--crit); border-color: #efc5c1; background: var(--crit-soft); }
.badge.critical::before { background: var(--crit-dot); }
.badge.warning { color: var(--warn); border-color: #ecd596; background: var(--warn-soft); }
.badge.warning::before { background: var(--warn-dot); }
.badge.info { color: var(--info); border-color: #c4d8ea; background: var(--info-soft); }
.badge.info::before { background: #4f86bf; }
.badge.ok, .badge.succeeded, .badge.resolved, .badge.active { color: var(--ok); border-color: #bfdfc4; background: var(--ok-soft); }
.badge.ok::before, .badge.succeeded::before, .badge.resolved::before, .badge.active::before { background: #1fa65a; }
.badge.failed, .badge.error { color: var(--crit); border-color: #efc5c1; background: var(--crit-soft); }
.badge.failed::before, .badge.error::before { background: var(--crit-dot); }
.badge.running, .badge.in_progress, .badge.queued { color: var(--info); border-color: #c4d8ea; background: var(--info-soft); }
.badge.running::before, .badge.in_progress::before { background: #4f86bf; animation: blink 1.2s infinite; }
.badge.plain::before { display: none; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); font-family: var(--mono); }
.role { text-transform: capitalize; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------------------------------------------------------------- forms */
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date],
input[type=datetime-local], input[type=month], select, textarea {
  width: 100%; height: 38px; padding: 6px 12px; font: inherit; font-size: 13.5px; color: var(--text);
  background: #fff; border: 1px solid #d3cfc3; border-radius: var(--r);
}
textarea { height: auto; min-height: 96px; resize: vertical; }
select[multiple] { height: auto; min-height: 100px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11, 107, 102, .13); }
input[type=file] { font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 5px 0; cursor: pointer; }
.check input { margin: 0; accent-color: var(--brand); width: 15px; height: 15px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 140px; }
.filters {
  display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding: 16px 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 20px; box-shadow: var(--shadow);
}
.filters .field { margin: 0; min-width: 150px; }
.filters .field.w { min-width: 230px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; font: inherit; font-size: 13.5px;
  font-weight: 600; border-radius: var(--r); border: 1px solid #cfcabd; background: #fff; color: var(--text); cursor: pointer; white-space: nowrap;
  transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:hover { background: var(--panel-2); text-decoration: none; box-shadow: 0 2px 8px -3px rgba(20, 35, 40, .25); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #0e7c76, var(--brand)); border-color: var(--brand-ink); color: #fff; box-shadow: 0 2px 8px -2px rgba(11, 107, 102, .5); }
.btn.primary:hover { background: linear-gradient(180deg, #0b6b66, var(--brand-ink)); }
.btn.danger { color: var(--crit); border-color: #e6bab6; }
.btn.danger:hover { background: var(--crit-soft); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn.link { border: 0; background: none; color: var(--brand); padding: 0; height: auto; box-shadow: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.inline { display: inline; }

.seg { display: inline-flex; background: #ebe8dd; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 13px; cursor: pointer; color: var(--text-2); border-radius: 8px; }
.seg button.on { background: #fff; color: var(--brand-ink); box-shadow: 0 1px 3px rgba(20, 35, 40, .15); }

.tabs { display: inline-flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 20px; box-shadow: var(--shadow); }
.tabs a { padding: 8px 16px; color: var(--text-2); border-radius: 9px; font-weight: 600; font-size: 13.5px; }
.tabs a:hover { color: var(--text); text-decoration: none; background: var(--panel-2); }
.tabs a.on { color: #fff; background: var(--brand); }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; font-size: 13.5px; background: #fff; box-shadow: var(--shadow); }
.flash.success { background: var(--ok-soft); border-color: #bfdfc4; color: #1b5a27; }
.flash.error { background: var(--crit-soft); border-color: #efc5c1; color: #7a1d1d; }
.flash.info { background: var(--info-soft); border-color: #c4d8ea; color: #1f4870; }

.toasts { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  width: 360px; background: #fff; border: 1px solid var(--line); border-left: 4px solid #4f86bf;
  border-radius: 10px; padding: 12px 16px; box-shadow: 0 14px 34px -10px rgba(15, 30, 35, .35); font-size: 13px; animation: slide .2s ease-out;
}
.toast.critical { border-left-color: var(--crit-dot); }
.toast.warning { border-left-color: var(--warn-dot); }
.toast b { display: block; margin-bottom: 2px; font-family: var(--display); font-size: 14px; }
.toast p { margin: 0; color: var(--text-2); }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 9px 16px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.ph { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.ph p { margin: 0; color: var(--text-2); max-width: 780px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); }
.ph .tools { margin-left: auto; display: flex; gap: 8px; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 20px 0; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; width: 16px; }

.statline { display: flex; gap: 24px; padding: 12px 20px; border-top: 1px solid var(--line-soft); font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; background: var(--panel-2); }
.statline b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 700; margin-left: 5px; }

.matrix { border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.matrix th { font-weight: 600; color: var(--text-2); padding: 4px 6px; white-space: nowrap; }
.matrix th.rot { height: 110px; vertical-align: bottom; }
.matrix th.rot div { writing-mode: vertical-rl; transform: rotate(180deg); }
.matrix td { width: 54px; height: 36px; text-align: center; border-radius: 6px; font-variant-numeric: tabular-nums; cursor: default; font-weight: 600; }

.meter { height: 7px; background: var(--line-soft); border-radius: 4px; overflow: hidden; min-width: 60px; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }

.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.live-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; box-shadow: var(--shadow); }
.live-tile:hover { border-color: #9cb8b6; transform: translateY(-2px); }
.live-tile.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(11, 107, 102, .25), var(--shadow); }
.live-tile.alarm { border-color: #e8a29d; background: #fff9f8; }
.live-tile header { display: flex; justify-content: space-between; align-items: baseline; }
.live-tile header b { font: 700 14px var(--display); }
.live-tile header small { color: var(--muted); font-size: 11px; }
.live-tile .t { font: 800 26px/1.2 var(--display); font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.live-tile .t small { font: 600 12.5px var(--sans); color: var(--text-2); }
.live-tile dl { display: grid; grid-template-columns: 1fr 1fr; gap: 1px 8px; margin: 0; font-size: 12px; color: var(--muted); }
.live-tile dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.flashup { animation: fl .9s ease-out; }
@keyframes fl { from { background: #e6f4f1; } }

.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.msg.staff { border-color: #b4d8d3; }
.msg header { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; color: var(--text-2); background: var(--panel-2); }
.msg.staff header { background: var(--brand-soft); }
.msg header b { color: var(--text); }
.msg .body { padding: 14px 16px; white-space: pre-wrap; }

.doc { max-width: 880px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 34px 34px; box-shadow: var(--shadow); }
.doc h2 { font-size: 21px; margin: 30px 0 10px; padding-top: 6px; }
.doc h3 { font-size: 16px; margin: 20px 0 6px; }
.doc p, .doc li { color: #2b3b43; }
.doc ol, .doc ul { padding-left: 22px; }
.doc li { margin: 4px 0; }
details.faq { border-bottom: 1px solid var(--line-soft); padding: 12px 0; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { margin: 8px 0 2px; }
.toc { position: sticky; top: 78px; font-size: 13.5px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 8px; box-shadow: var(--shadow); align-self: start; }
.toc a { display: block; padding: 6px 12px; color: var(--text-2); border-radius: 8px; font-weight: 500; }
.toc a:hover { background: var(--panel-2); color: var(--brand-ink); text-decoration: none; }

/* ---------------------------------------------------------------- login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(400px, 1fr); }
.login-art {
  position: relative; overflow: hidden; color: #c4dad9; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(130deg, #08262c 0%, #0b4a4c 60%, #0f7068 100%);
}
.login-art::before { content: ""; position: absolute; inset: 0; background: url("../img/contours.svg") center / cover no-repeat; }
.login-art::after { content: ""; position: absolute; right: -120px; top: -140px; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, rgba(232, 96, 44, .4), rgba(232, 96, 44, 0) 70%); }
.login-art > * { position: relative; z-index: 1; }
.login-art h2 { color: #fff; font-size: 40px; max-width: 520px; line-height: 1.1; margin-top: 70px; font-weight: 800; letter-spacing: -0.025em; }
.login-art p { max-width: 460px; color: #a9c6c5; font-size: 15px; margin-top: 18px; }
.login-art .stripes { position: absolute; left: 0; right: 0; bottom: 0; height: 74px; display: flex; z-index: 1; }
.login-art .stripes i { flex: 1; }
.login-art footer { font-size: 12.5px; color: #8bb0b0; margin-bottom: 92px; }
.login-form { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.login-card { width: 100%; max-width: 450px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 36px 34px 30px; box-shadow: 0 24px 60px -24px rgba(15, 30, 35, .3); }
.login-card h1 { font-size: 27px; margin-bottom: 4px; font-weight: 800; }
.login-card .sub { color: var(--text-2); margin: 0 0 24px; }
.login-card .btn { width: 100%; height: 44px; font-size: 14.5px; }
.demo { margin-top: 24px; font-size: 12.5px; color: var(--text-2); border-top: 1px dashed var(--line); padding-top: 16px; }
.demo b { font-family: var(--display); }
.demo table td { padding: 3px 12px 3px 0; white-space: nowrap; }

.err { max-width: 560px; margin: 12vh auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 36px; box-shadow: var(--shadow); }
.err .code { font-family: var(--mono); color: var(--accent); font-weight: 500; }
.err h1 { font-size: 28px; margin: 6px 0 10px; }

.path { font-family: var(--mono); font-size: 12.5px; padding: 12px 20px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.path a { color: var(--text-2); }
.ico-dir { color: #c88a1a; }
.ico-file { color: var(--muted); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .g2, .g-side { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .content, .hero, .top { padding-left: 16px; padding-right: 16px; }
}
@media print {
  .side, .top, .filters, .toasts, .hero { display: none !important; }
  .shell { display: block; }
  .content { margin-top: 0; }
}
