/* ── Design Tokens ─────────────────────────────────────────────────────── */
:root {
  --bg:       #0d0f14;  --surface:  #141720;  --surface2: #1c2030;  --surface3: #232840;
  --border:   #2a2f42;  --text:     #e2e8f0;  --muted:    #64748b;  --muted2:   #94a3b8;
  --accent:   #38bdf8;  --green:    #34d399;  --yellow:   #fbbf24;
  --red:      #f87171;  --purple:   #a78bfa;  --orange:   #fb923c;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'IBM Plex Sans', sans-serif;
  --radius: 10px;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 14px; line-height: 1.5;
  min-height: 100vh;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(56,189,248,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,.025) 1px, transparent 1px);
  background-size: 40px 40px;
}
a { color: inherit; text-decoration: none; }

/* ── Manager Layout ────────────────────────────────────────────────────── */
.layout        { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar       { width: 220px; flex-shrink: 0; background: var(--surface);
                 border-right: 1px solid var(--border); padding: 24px 16px;
                 display: flex; flex-direction: column; gap: 24px;
                 position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.main          { flex: 1; padding: 28px 24px; overflow-x: hidden; min-width: 0; }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.brand h1      { font-family: var(--mono); font-size: 9px; color: var(--accent);
                 letter-spacing: .2em; text-transform: uppercase; margin-bottom: 4px; }
.brand h2      { font-size: 16px; font-weight: 700; line-height: 1.2; }
.sync-info     { font-family: var(--mono); font-size: 9px; color: var(--muted); line-height: 1.7; }
.sync-dot      { display: inline-block; width: 6px; height: 6px; border-radius: 50%;
                 background: var(--green); margin-right: 4px; vertical-align: middle;
                 animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

.nav-section   { display: flex; flex-direction: column; gap: 4px; }
.nav-label     { font-family: var(--mono); font-size: 9px; color: var(--muted);
                 text-transform: uppercase; letter-spacing: .12em; margin-bottom: 4px; }
.nav-btn       { display: block; padding: 7px 12px; border-radius: 6px; font-size: 12px;
                 color: var(--muted2); cursor: pointer; border: none; background: none;
                 text-align: left; width: 100%; transition: all .15s; }
.nav-btn:hover { background: var(--surface2); color: var(--text); }
.nav-btn.active{ background: var(--surface3); color: var(--accent); font-weight: 600; }

.sidebar-footer { margin-top: auto; }

.filter-group  { display: flex; flex-direction: column; gap: 8px; }
.filter-label  { font-family: var(--mono); font-size: 9px; color: var(--muted);
                 text-transform: uppercase; letter-spacing: .12em; }

select, input[type="date"], input[type="text"] {
  width: 100%; padding: 7px 10px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 6px; color: var(--text);
  font-family: var(--mono); font-size: 11px; appearance: none; cursor: pointer;
}
select:focus, input[type="date"]:focus, input[type="text"]:focus { outline: none; border-color: var(--accent); }

.preset-row    { display: flex; flex-wrap: wrap; gap: 4px; }
.preset-grid   { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.preset-btn    { padding: 4px 4px; border-radius: 4px; font-family: var(--mono);
                 font-size: 10px; background: var(--surface2); border: 1px solid var(--border);
                 color: var(--muted); cursor: pointer; transition: all .15s;
                 white-space: nowrap; overflow: hidden; text-align: center; }
.preset-btn:hover  { border-color: var(--accent); color: var(--accent); }
.preset-btn.active { background: var(--accent); border-color: var(--accent);
                     color: #0d0f14; font-weight: 600; }

.gran-row      { display: flex; gap: 4px; }
.gran-btn      { flex: 1; padding: 5px 0; border-radius: 5px; font-family: var(--mono);
                 font-size: 10px; background: var(--surface2); border: 1px solid var(--border);
                 color: var(--muted); cursor: pointer; text-align: center; transition: all .15s; }
.gran-btn:hover  { border-color: var(--accent); color: var(--accent); }
.gran-btn.active { background: var(--accent); border-color: var(--accent);
                   color: #0d0f14; font-weight: 600; }

/* ── Sections ──────────────────────────────────────────────────────────── */
.section       { display: none; flex-direction: column; gap: 18px; }
.section.active{ display: flex; }
.section-header{ display: flex; align-items: center; gap: 12px;
                 margin-bottom: 4px; padding-bottom: 14px;
                 border-bottom: 1px solid var(--border); }
.section-header h3 { font-size: 18px; font-weight: 700; }
.section-header .sub { font-family: var(--mono); font-size: 10px; color: var(--muted); }

/* ── Cards & Grids ─────────────────────────────────────────────────────── */
.card          { background: var(--surface); border: 1px solid var(--border);
                 border-radius: var(--radius); padding: 20px; }
.card-title    { font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
                 text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }
.g2            { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.g3            { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.g4            { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.g5            { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; }

/* ── KPI Cards ─────────────────────────────────────────────────────────── */
.kpi           { background: var(--surface); border: 1px solid var(--border);
                 border-radius: var(--radius); padding: 18px 16px;
                 position: relative; overflow: hidden;
                 animation: fadeUp .4s ease both; }
.kpi::before   { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
                 background: var(--kpi-c, var(--accent)); }
.kpi-label     { font-family: var(--mono); font-size: 9px; color: var(--muted);
                 text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; }
.kpi-value     { font-family: var(--mono); font-size: 32px; font-weight: 700;
                 color: var(--kpi-c, var(--accent)); line-height: 1; }
.kpi-sub       { font-size: 11px; color: var(--muted); margin-top: 5px; }
.kpi-row       { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }

/* ── Gauges ────────────────────────────────────────────────────────────── */
.gauges        { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 14px; }
.gauge         { background: var(--surface2); border-radius: 8px; padding: 14px 10px; text-align: center; }
.gval          { font-family: var(--mono); font-size: 24px; font-weight: 700; line-height: 1; }
.glabel        { font-size: 10px; color: var(--muted); margin-top: 5px; line-height: 1.3; }
.gstatus       { font-family: var(--mono); font-size: 9px; font-weight: 600;
                 letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; }

/* ── Signals ───────────────────────────────────────────────────────────── */
.sig-list      { display: flex; flex-direction: column; gap: 8px; }
.sig-row       { display: flex; justify-content: space-between; align-items: flex-start;
                 gap: 14px; padding: 10px 14px; background: var(--surface2);
                 border-radius: 8px; font-size: 13px; }
.sig-row strong{ display: block; margin-bottom: 2px; }
.sig-desc      { color: var(--muted); font-size: 11px; line-height: 1.4; }

/* ── Pills & Chips ─────────────────────────────────────────────────────── */
.pill          { display: inline-block; padding: 3px 10px; border-radius: 5px;
                 font-family: var(--mono); font-size: 10px; font-weight: 600;
                 white-space: nowrap; flex-shrink: 0; }
.pill-ok       { background: rgba(52,211,153,.15); color: var(--green); }
.pill-warn     { background: rgba(251,191,36,.15);  color: var(--yellow); }
.pill-bad      { background: rgba(248,113,113,.15); color: var(--red); }
.pill-info     { background: rgba(56,189,248,.15);  color: var(--accent); }
.chip          { display: inline-block; padding: 3px 10px; border-radius: 4px;
                 background: var(--surface3); font-family: var(--mono);
                 font-size: 10px; color: var(--muted); margin: 2px; }
.chips         { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }

/* ── People bars ───────────────────────────────────────────────────────── */
.dev-row       { display: flex; align-items: center; gap: 12px; padding: 10px 0;
                 border-bottom: 1px solid var(--border); }
.dev-row:last-child { border-bottom: none; }
.dev-name      { font-size: 13px; font-weight: 600; min-width: 130px;
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-wrap      { flex: 1; background: var(--surface2); border-radius: 4px; height: 8px; overflow: hidden; }
.bar-fill      { height: 100%; border-radius: 4px;
                 background: var(--bar-color, var(--accent));
                 transition: width 1s cubic-bezier(.4,0,.2,1); }
.dev-count     { font-family: var(--mono); font-size: 13px; font-weight: 600;
                 color: var(--bar-color, var(--text)); min-width: 28px; text-align: right; }
.dev-meta      { font-family: var(--mono); font-size: 11px; color: var(--muted);
                 min-width: 80px; text-align: right; }
.insight       { background: var(--surface2); border-radius: 8px; padding: 14px 16px;
                 margin-top: 12px; font-size: 13px; line-height: 1.6; color: var(--muted);
                 border-left: 2px solid var(--accent); }
.insight strong { color: var(--text); }

/* ── Table ─────────────────────────────────────────────────────────────── */
.table-wrap    { overflow-x: auto; }
table          { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th       { font-family: var(--mono); font-size: 9px; text-transform: uppercase;
                 letter-spacing: .1em; color: var(--muted); padding: 10px 12px;
                 border-bottom: 1px solid var(--border); text-align: left;
                 white-space: nowrap; cursor: pointer; user-select: none; }
thead th:hover { color: var(--accent); }
tbody tr       { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: var(--surface2); }
tbody td       { padding: 9px 12px; vertical-align: middle; }
.name-with-filter { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.name-with-filter-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-with-filter-sub { margin-top: 2px; font-size: 10px; color: var(--muted); }
.row-filter-btn {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  opacity: .55;
  transition: all .12s ease;
}
.row-filter-icon {
  font-size: 9px;
  line-height: 1;
  pointer-events: none;
}
tbody tr:hover .row-filter-btn,
.row-filter-btn:focus-visible {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(56, 189, 248, .08);
}
.td-key        { font-family: var(--mono); font-size: 11px; color: var(--accent); white-space: nowrap; }
.td-key a      { color: inherit; text-decoration: none; }
.td-key a:hover{ text-decoration: underline; }
.td-summary    { max-width: 320px; overflow: hidden; text-overflow: ellipsis;
                 white-space: nowrap; color: var(--muted2); }
.td-lt         { font-family: var(--mono); font-size: 11px; text-align: right; white-space: nowrap; }
.ta-r          { text-align: right; }
.loading-cell  { padding: 20px; text-align: center; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.status-badge  { display: inline-block; padding: 2px 8px; border-radius: 4px;
                 font-family: var(--mono); font-size: 10px;
                 background: var(--surface3); color: var(--muted2); }
.pagination    { display: flex; align-items: center; justify-content: space-between;
                 padding: 12px 0; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.pg-btn        { padding: 5px 14px; border-radius: 6px; font-family: var(--mono); font-size: 11px;
                 background: var(--surface2); border: 1px solid var(--border);
                 color: var(--muted); cursor: pointer; transition: all .15s; }
.pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pg-btn:disabled { opacity: .3; cursor: not-allowed; }
.table-filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.table-filters select { width: auto; flex: 1; min-width: 140px; }

/* ── Chart ─────────────────────────────────────────────────────────────── */
canvas         { max-height: 240px; }
.chart-note    { font-family: var(--mono); font-size: 10px; color: var(--muted);
                 margin-top: 8px; padding: 8px 12px; background: var(--surface2);
                 border-radius: 6px; border-left: 2px solid var(--accent); }
.rw-cross-links { margin-top: 6px; display: grid; gap: 10px; }
.rw-cross-item  { background: var(--surface2); border: 1px solid var(--border);
                  border-radius: 8px; padding: 10px; }
.rw-cross-head  { display: flex; align-items: baseline; justify-content: space-between;
                  gap: 12px; margin-bottom: 8px; }
.rw-cross-head-title { font-family: var(--mono); font-size: 11px; color: var(--text);
                       letter-spacing: .04em; text-transform: uppercase; }
.rw-cross-head-total { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.rw-cross-bar   { height: 12px; border-radius: 999px; overflow: hidden;
                  border: 1px solid var(--border); background: var(--surface3); display: flex; }
.rw-cross-bar > span { height: 100%; }
.rw-cross-fill--linked { background: #34d399; }
.rw-cross-fill--unlinked { background: #f87171; }
.rw-cross-meta  { margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rw-cross-meta-item { background: rgba(13, 15, 20, .25); border: 1px solid var(--border);
                      border-radius: 6px; padding: 7px 8px; }
.rw-cross-clickable { cursor: pointer; transition: filter .12s ease, border-color .12s ease, transform .12s ease; }
.rw-cross-clickable:hover { filter: brightness(1.08); }
.rw-cross-meta-item.rw-cross-clickable:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.rw-cross-meta-label { display: flex; align-items: center; gap: 6px;
                       font-family: var(--mono); font-size: 10px; color: var(--muted2); }
.rw-cross-dot   { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.rw-cross-dot--linked { background: #34d399; }
.rw-cross-dot--unlinked { background: #f87171; }
.rw-cross-meta-value { margin-top: 5px; font-family: var(--mono); font-size: 15px;
                       color: var(--text); font-weight: 700; line-height: 1; }
.rw-cross-meta-pct { margin-top: 4px; font-family: var(--mono); font-size: 10px; color: var(--accent); }
.rw-cross-empty { font-family: var(--mono); font-size: 10px; color: var(--muted);
                  margin-top: 8px; }

/* Customers page — chart wrappers (override max-height via position:relative) */
.c-chart-wrap       { position: relative; height: 300px; }
.c-chart-wrap--sm   { height: 240px; }
.c-chart-wrap canvas { max-height: none; width: 100% !important; height: 100% !important; }

/* ── Loading / Empty ───────────────────────────────────────────────────── */
.loading       { color: var(--muted); font-family: var(--mono); font-size: 12px;
                 padding: 32px; text-align: center; }
.empty         { color: var(--muted); font-size: 12px; padding: 24px; text-align: center; }

/* ── Animations ────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kpi:nth-child(1) { animation-delay: .05s; }
.kpi:nth-child(2) { animation-delay: .10s; }
.kpi:nth-child(3) { animation-delay: .15s; }
.kpi:nth-child(4) { animation-delay: .20s; }
.kpi:nth-child(5) { animation-delay: .25s; }

/* ── User chip (sidebar footer) ────────────────────────────────────────── */
.user-chip    { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
                border-radius: 8px; background: var(--surface2);
                border: 1px solid var(--border); margin-top: 8px; }
.user-avatar  { width: 28px; height: 28px; border-radius: 50%; background: var(--accent);
                color: #0d0f14; font-family: var(--mono); font-size: 12px; font-weight: 700;
                display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-info    { flex: 1; min-width: 0; }
.user-name    { display: block; font-size: 12px; font-weight: 600; color: var(--text);
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-name:hover { color: var(--accent); }
.user-role    { font-family: var(--mono); font-size: 9px; color: var(--muted);
                text-transform: uppercase; letter-spacing: .08em; }
.user-logout  { font-size: 14px; color: var(--muted); cursor: pointer; flex-shrink: 0;
                transition: color .15s; }
.user-logout:hover { color: var(--red); }

/* ── Forms (shared: login + profile) ───────────────────────────────────── */
.form-group   { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-label   { font-family: var(--mono); font-size: 9px; color: var(--muted);
                text-transform: uppercase; letter-spacing: .12em; }
.form-input   { width: 100%; padding: 9px 12px; background: var(--surface2);
                border: 1px solid var(--border); border-radius: 6px; color: var(--text);
                font-family: var(--sans); font-size: 13px; transition: border-color .15s; }
.form-input:focus   { outline: none; border-color: var(--accent); }
.form-input:disabled{ opacity: .5; cursor: not-allowed; }

/* ── Drill-down modal ───────────────────────────────────────────────────── */
.drill-overlay  { display: none; position: fixed; inset: 0; z-index: 1000;
                  background: rgba(0,0,0,.7); backdrop-filter: blur(3px);
                  align-items: center; justify-content: center; padding: 24px; }
.drill-overlay.open { display: flex; }
.drill-box      { background: var(--surface); border: 1px solid var(--border);
                  border-radius: var(--radius); width: 100%; max-width: 1100px;
                  max-height: 85vh; display: flex; flex-direction: column;
                  box-shadow: 0 24px 64px rgba(0,0,0,.6); }
.drill-header   { display: flex; align-items: center; justify-content: space-between;
                  padding: 14px 18px; border-bottom: 1px solid var(--border);
                  font-family: var(--mono); font-size: 12px; font-weight: 600;
                  color: var(--accent); flex-shrink: 0; }
.drill-close    { background: none; border: none; color: var(--muted); font-size: 16px;
                  cursor: pointer; padding: 2px 6px; border-radius: 4px; line-height: 1; }
.drill-close:hover { color: var(--text); background: var(--surface2); }
.drill-back-btn { background: none; border: 1px solid var(--border); color: var(--muted2);
                  font-family: var(--mono); font-size: 11px; cursor: pointer;
                  padding: 3px 10px; border-radius: 5px; transition: all .15s; }
.drill-back-btn:hover { border-color: var(--accent); color: var(--accent); }
.drill-body     { overflow-y: auto; padding: 0; flex: 1;
                  scrollbar-width: thin; scrollbar-color: var(--surface3) transparent; }
.drill-body::-webkit-scrollbar       { width: 6px; }
.drill-body::-webkit-scrollbar-track { background: transparent; }
.drill-body::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
.drill-body::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.drill-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
.drill-body thead th { position: sticky; top: 0; background: var(--surface2);
                       padding: 8px 12px; text-align: left; font-family: var(--mono);
                       font-size: 10px; color: var(--muted); border-bottom: 1px solid var(--border); }
.drill-body tbody td { padding: 7px 12px; border-bottom: 1px solid var(--border);
                       color: var(--muted2); vertical-align: top; }
.drill-body tbody tr:last-child td { border-bottom: none; }
.drill-body tbody tr:hover td { background: var(--surface2); }
.drill-footer   { display: flex; align-items: center; justify-content: space-between;
                  padding: 8px 18px; border-top: 1px solid var(--border);
                  font-family: var(--mono); font-size: 10px; color: var(--muted);
                  flex-shrink: 0; gap: 12px; }
.drill-pg       { display: flex; align-items: center; gap: 10px; }

/* ── Login page ─────────────────────────────────────────────────────────── */
.auth-wrap    { position: relative; z-index: 1; min-height: 100vh;
                display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card    { width: 100%; max-width: 400px; background: var(--surface);
                border: 1px solid var(--border); border-radius: 16px; padding: 40px 36px; }
.auth-brand        { margin-bottom: 32px; }
.auth-brand-tag    { font-family: var(--mono); font-size: 9px; color: var(--accent);
                     letter-spacing: .2em; text-transform: uppercase; margin-bottom: 6px; }
.auth-brand-title  { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.auth-notice  { background: rgba(56,189,248,.1); border: 1px solid rgba(56,189,248,.3);
                border-left: 3px solid var(--accent); border-radius: 8px;
                padding: 12px 16px; margin-bottom: 20px; font-size: 13px; color: var(--muted2); }
.auth-notice strong { color: var(--accent); }
.auth-alert   { padding: 10px 14px; border-radius: 7px; font-size: 13px; margin-bottom: 16px; }
.auth-alert-error   { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.3);
                      color: var(--red); }
.auth-alert-success { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3);
                      color: var(--green); }
.auth-form    { display: flex; flex-direction: column; }
.auth-btn     { margin-top: 8px; padding: 11px; background: var(--accent); color: #0d0f14;
                border: none; border-radius: 8px; font-family: var(--mono); font-size: 13px;
                font-weight: 700; cursor: pointer; letter-spacing: .05em;
                transition: opacity .15s; }
.auth-btn:hover { opacity: .88; }
.auth-footer  { margin-top: 28px; text-align: center; font-family: var(--mono);
                font-size: 10px; color: var(--muted); }

/* ── Profile page ───────────────────────────────────────────────────────── */
.profile-form  { display: flex; flex-direction: column; }
.profile-btn   { align-self: flex-start; margin-top: 4px; padding: 9px 22px;
                 background: var(--accent); color: #0d0f14; border: none; border-radius: 7px;
                 font-family: var(--mono); font-size: 12px; font-weight: 700;
                 cursor: pointer; letter-spacing: .04em; transition: opacity .15s; }
.profile-btn:hover { opacity: .88; }
.profile-alert { padding: 10px 16px; border-radius: 8px; font-size: 13px;
                 margin-bottom: 20px; }
.profile-alert-error   { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.3);
                         color: var(--red); }
.profile-alert-success { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3);
                         color: var(--green); }

/* ── Select2 (dark theme override) ─────────────────────────────────────── */
.select2-container--default .select2-selection--single {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  height: 30px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 28px;
  padding-left: 10px;
  padding-right: 52px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 28px;
  right: 4px;
}
.select2-container--default .select2-selection--single .select2-selection__clear {
  position: absolute;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  opacity: .55;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .12s ease;
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover,
.select2-container--default .select2-selection--single .select2-selection__clear:focus-visible {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(56, 189, 248, .08);
  outline: none;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--muted2) transparent transparent transparent;
}
.select2-container--default.select2-container--open
  .select2-selection--single .select2-selection__arrow b {
  border-color: transparent transparent var(--muted2) transparent;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open  .select2-selection--single {
  border-color: var(--accent);
  outline: none;
}

.select2-container--open .select2-dropdown { margin-top: 2px; }
.select2-dropdown {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  overflow: hidden;
}

.select2-container--default .select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  padding: 6px 8px;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--accent);
  outline: none;
}

.select2-container--default .select2-results__options { padding: 4px 0; }
.select2-container--default .select2-results__option {
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  padding: 8px 12px;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.select2-container--default .select2-results__option[aria-selected=true],
.select2-container--default .select2-results__option--selected {
  background: var(--surface3);
  color: var(--accent);
  font-weight: 600;
}
.select2-container--default .select2-results > .select2-results__options {
  max-height: 320px;
}
.select2-results__option--selectable { cursor: pointer; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) { .g5 { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 900px)  {
  .sidebar { width: 180px; }
  .gauges  { grid-template-columns: 1fr 1fr; }
  .g4,.g5  { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px)  {
  .layout  { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static;
             flex-direction: row; flex-wrap: wrap; gap: 16px; padding: 16px; }
  .main    { padding: 16px; }
  .g2,.g3,.g4,.g5,.gauges,.kpi-row { grid-template-columns: 1fr; }
  .rw-cross-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .rw-cross-meta { grid-template-columns: 1fr; }
  .dheader { flex-direction: column; align-items: flex-start; }
}
