/* ============================================================
   Temperature & Humidity Monitoring Report
   Design system: Enterprise Industrial SaaS
   (SAP Fiori + Microsoft Fluent + Modern QMS/MES)
   ============================================================ */

:root {
  /* Brand */
  --brand:        #0A6ED1;
  --brand-dark:   #0857A6;
  --brand-darker: #06407C;
  --brand-tint:   #EAF2FB;
  --brand-tint-2: #DCEAF9;

  /* Shell */
  --shell:        #0A6ED1;
  --shell-text:   #FFFFFF;

  /* Neutrals */
  --bg:           #F4F6F8;
  --surface:      #FFFFFF;
  --surface-2:    #FBFCFD;
  --border:       #E1E6EC;
  --border-strong:#CDD5DE;
  --text:         #1D2D3E;
  --text-2:       #4A5A6B;
  --text-muted:   #7A8794;

  /* Status */
  --success:      #107E3E;
  --success-bg:   #E7F3EB;
  --danger:       #BB0000;
  --danger-bg:    #FBE9E9;
  --warning:      #C25A00;
  --warning-bg:   #FCEFE1;

  /* Geometry */
  --radius:       8px;
  --radius-lg:    10px;
  --radius-sm:    6px;
  --sidebar-w:    248px;
  --topbar-h:     52px;

  --shadow-sm:  0 1px 2px rgba(29,45,62,.06), 0 1px 1px rgba(29,45,62,.04);
  --shadow:     0 1px 2px rgba(29,45,62,.06), 0 4px 12px rgba(29,45,62,.08);
  --shadow-pop: 0 8px 28px rgba(29,45,62,.16);

  --font-ui: "Noto Sans Thai", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
.num { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

/* ---------- Boot splash ---------- */
.boot {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  flex-direction: column; background: var(--bg);
}
.boot__spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--brand-tint-2); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Shell layout
   ============================================================ */
.shell { display: flex; min-height: 100vh; }

/* Top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  background: var(--shell); color: var(--shell-text);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; z-index: 40;
  padding-top: env(safe-area-inset-top);
}
.topbar__burger {
  display: none; background: transparent; border: 0; color: #fff;
  width: 36px; height: 36px; border-radius: var(--radius-sm); cursor: pointer;
  align-items: center; justify-content: center;
}
.topbar__burger:hover { background: rgba(255,255,255,.14); }
.topbar__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__logo {
  width: 30px; height: 30px; border-radius: 7px; background: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.topbar__logo img { width: 24px; height: 24px; }
.topbar__titles { min-width: 0; }
.topbar__title-th { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__title-en { font-size: 10.5px; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }
.topbar__spacer { flex: 1; }

.topbar__user { display: flex; align-items: center; gap: 10px; }
.topbar__user-meta { text-align: right; line-height: 1.2; }
.topbar__user-name { font-size: 13px; font-weight: 600; }
.topbar__user-role { font-size: 10.5px; opacity: .85; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; flex: none;
}
.btn-logout {
  background: rgba(255,255,255,.14); color: #fff; border: 0;
  height: 32px; padding: 0 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 6px;
}
.btn-logout:hover { background: rgba(255,255,255,.26); }

/* Sidebar */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 12px 10px; z-index: 30; overflow-y: auto;
  display: flex; flex-direction: column;
}
.nav-section { padding: 10px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .4px; color: var(--text-muted); text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer; font-size: 13.5px; font-weight: 500;
  border-left: 3px solid transparent; margin-bottom: 2px; user-select: none;
}
.nav-item svg { flex: none; opacity: .8; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active {
  background: var(--brand-tint); color: var(--brand-darker);
  border-left-color: var(--brand); font-weight: 600;
}
.nav-item.is-active svg { opacity: 1; color: var(--brand); }
.sidebar__foot { margin-top: auto; padding: 12px; font-size: 11px; color: var(--text-muted); }
.sidebar__foot code { font-family: var(--font-mono); font-size: 10.5px; }

/* Main */
.main {
  margin-left: var(--sidebar-w); margin-top: var(--topbar-h);
  flex: 1; min-width: 0; padding: 22px 24px 60px;
}
.scrim { display: none; position: fixed; inset: 0; background: rgba(29,45,62,.4); z-index: 25; }

/* ---------- Page header ---------- */
.page-head { margin-bottom: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head__title { font-size: 20px; font-weight: 600; }
.page-head__sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card__head {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card__title { font-size: 14.5px; font-weight: 600; }
.card__sub { font-size: 12px; color: var(--text-muted); }
.card__body { padding: 18px; }
.card__body--tight { padding: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-muted); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(.94); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn--ghost:hover { background: var(--brand-tint); }
.btn--sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn--icon { width: 32px; height: 32px; padding: 0; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--block { width: 100%; }

/* ============================================================
   Forms
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.label .req { color: var(--danger); margin-left: 2px; }
.hint { font-size: 11.5px; color: var(--text-muted); }

.input, .select, textarea.input {
  height: 38px; width: 100%; padding: 0 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 64px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,110,209,.15);
}
.input::placeholder { color: #9aa6b2; }
.input.is-num { font-family: var(--font-mono); }
.select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%237A8794' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input-group { display: flex; align-items: stretch; gap: 8px; }
.input-suffix {
  display: inline-flex; align-items: center; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-muted); font-size: 12.5px; font-family: var(--font-mono);
}

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2);
  background: var(--surface-2); padding: 10px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td.num, table.data th.num { font-family: var(--font-mono); text-align: right; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ============================================================
   Badges / status
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 100px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--ok   { background: var(--success-bg); color: var(--success); }
.badge--high { background: var(--danger-bg);  color: var(--danger); }
.badge--low  { background: var(--warning-bg); color: var(--warning); }
.badge--muted{ background: #EEF1F4; color: var(--text-muted); }
.badge--role-admin { background: var(--brand-tint); color: var(--brand-darker); }
.badge--role-user  { background: #EEF1F4; color: var(--text-2); }

/* ============================================================
   Data-entry rows (responsive table)
   ============================================================ */
.entry-head, .entry-row {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 0.9fr 1.5fr 1.6fr 40px;
  gap: 10px; align-items: start;
}
.entry-head {
  padding: 10px 4px; font-size: 12px; font-weight: 600; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.entry-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.entry-row {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
}
.entry-cell { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cell-label { display: none; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.entry-remove {
  align-self: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--danger);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.entry-remove:hover { background: var(--danger-bg); border-color: var(--danger); }
.humidity-cell { display: flex; align-items: center; gap: 8px; }
.humidity-cell .input { flex: 1; min-width: 0; }
.entry-status { min-width: 78px; }

.entry-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.entry-actions { display: flex; gap: 10px; }

/* ============================================================
   Master data lists
   ============================================================ */
.master-list { display: flex; flex-direction: column; }
.master-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.master-item:last-child { border-bottom: 0; }
.master-item__label { flex: 1; font-size: 13.5px; }
.master-item__label.is-mono { font-family: var(--font-mono); }
.master-add { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.master-add .input { flex: 1; }

/* ============================================================
   Login
   ============================================================ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background:
    radial-gradient(1200px 500px at 50% -10%, #EAF2FB 0%, transparent 60%), var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 30px 28px;
}
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 24px; }
.login-brand__logo {
  width: 62px; height: 62px; border-radius: 14px; background: var(--brand);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.login-brand__logo img { width: 46px; height: 46px; }
.login-brand__th { font-size: 17px; font-weight: 700; color: var(--text); }
.login-brand__en { font-size: 11.5px; color: var(--text-muted); letter-spacing: .3px; margin-top: 2px; }
.login-error {
  background: var(--danger-bg); color: var(--danger); border: 1px solid #F1C7C7;
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px;
}

/* ============================================================
   Empty / placeholder
   ============================================================ */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 54px 24px; color: var(--text-muted);
}
.empty__icon { width: 52px; height: 52px; color: var(--border-strong); margin-bottom: 12px; }
.empty__title { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.empty__text { font-size: 13px; max-width: 380px; }

/* ============================================================
   Toast
   ============================================================ */
.toast-root {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 36px);
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--text); color: #fff; padding: 11px 15px;
  border-radius: var(--radius); box-shadow: var(--shadow-pop);
  font-size: 13.5px; animation: toast-in .2s ease;
}
.toast--ok { background: var(--success); }
.toast--err { background: var(--danger); }
.toast svg { flex: none; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(29,45,62,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 55;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 460px; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
  animation: modal-in .18s ease; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
@keyframes modal-in { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal__head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal__title { font-size: 15.5px; font-weight: 600; }
.modal__close { background: transparent; border: 0; cursor: pointer; color: var(--text-muted); width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.modal__close:hover { background: var(--surface-2); color: var(--text); }
.modal__body { padding: 20px; overflow-y: auto; }
.modal__foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 13.5px; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__track { width: 38px; height: 22px; border-radius: 100px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.toggle__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.toggle input:checked + .toggle__track { background: var(--brand); }
.toggle input:checked + .toggle__track::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle__track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  :root { --sidebar-w: 260px; }
  .topbar__burger { display: flex; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-pop); }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .scrim.is-open { display: block; }
  .topbar__title-en { display: none; }

  /* stacked entry rows */
  .entry-head { display: none; }
  .entry-row { grid-template-columns: 1fr; gap: 12px; }
  .cell-label { display: block; }
  .entry-remove { align-self: stretch; width: 100%; gap: 6px; }
  .entry-remove::after { content: "ลบแถวนี้"; font-size: 12.5px; font-weight: 600; }
}
@media (max-width: 520px) {
  .main { padding: 16px 14px 50px; }
  .topbar__user-meta { display: none; }
  .card__body { padding: 14px; }
  .btn-logout span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   Dashboard
   ============================================================ */
.filter-card { margin-bottom: 16px; }
.filter-bar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.filter-field { display: flex; flex-direction: column; gap: 5px; }
.filter-field .input, .filter-field .select { min-width: 160px; }
.filter-field .label { font-size: 12px; }
.filter-presets { display: flex; gap: 6px; }
.filter-spacer { flex: 1 1 auto; }
.filter-bar .toggle { margin-bottom: 7px; }

.dash-content { display: flex; flex-direction: column; gap: 16px; }

/* summary chips */
.dash-summary { display: flex; flex-wrap: wrap; gap: 10px; }
.sum-chip {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); border-left: 3px solid var(--border-strong);
}
.sum-chip__label { font-size: 11px; color: var(--text-muted); }
.sum-chip__value { font-size: 14px; font-weight: 700; color: var(--text); }
.sum-chip--ok { border-left-color: var(--success); }
.sum-chip--warn { border-left-color: var(--danger); background: var(--danger-bg); }
.sum-chip--warn .sum-chip__value { color: var(--danger); }

/* KPI grid */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--brand);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 14px 16px;
}
.kpi--temp { border-top-color: #E8701A; }
.kpi--hum { border-top-color: #0A6ED1; }
.kpi__label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.kpi__valwrap { display: flex; align-items: baseline; gap: 4px; margin-top: 8px; }
.kpi__value { font-family: var(--font-mono); font-size: 26px; font-weight: 600; line-height: 1; color: var(--text); }
.kpi__unit { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* charts layout */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card .card__body { padding: 14px 16px 16px; }

.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 6px; }
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.chart-legend__swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.chart-legend__ax { font-style: normal; color: var(--text-muted); font-weight: 500; }

.chart { width: 100%; overflow: hidden; }
.chart-svg { width: 100%; height: auto; display: block; font-family: var(--font-ui); }
.chart-empty {
  display: flex; align-items: center; justify-content: center;
  height: 220px; color: var(--text-muted); font-size: 13px;
  border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2);
}

/* svg text/line primitives */
.ch-grid { stroke: var(--border); stroke-width: 1; }
.ch-axis-line { stroke: var(--border-strong); stroke-width: 1; }
.ch-axis { fill: var(--text-muted); font-size: 10.5px; font-family: var(--font-mono); }
.ch-axis--r { fill: var(--text-muted); }
.ch-unit { fill: var(--text-2); font-size: 10.5px; font-weight: 700; }
.ch-xlabel { fill: var(--text-2); font-size: 10.5px; }
.ch-dlabel { font-size: 10px; font-weight: 700; font-family: var(--font-mono); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.ch-band-label { fill: var(--success); font-size: 10px; font-weight: 700; opacity: .85; }
.ch-ref-label { font-size: 10px; font-weight: 700; }

/* comparison table */
table.data--compare thead th.grp { text-align: center; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--brand-tint); color: var(--brand-darker); }
table.data--compare thead tr:nth-child(2) th { top: 0; }
table.data--compare td.area-name { font-weight: 600; white-space: nowrap; }
table.data--compare td.is-out { color: var(--danger); font-weight: 700; background: var(--danger-bg); }
table.data--compare tr.row-warn td.area-name { box-shadow: inset 3px 0 0 var(--danger); }

/* responsive */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi__value { font-size: 22px; }
  .filter-field .input, .filter-field .select { min-width: 0; width: 100%; }
  .filter-field { flex: 1 1 140px; }
  .filter-spacer { display: none; }
}
