/* =================================================================
   GATI-NAGPUR — dashboard.css
   Nagpur City Police · Smart Traffic Command & Control
   -----------------------------------------------------------------
   DESIGN TOKENS
   Color:
     --paper        #F5F7FB  page background, cool light slate
     --surface      #FFFFFF  card / panel surface
     --surface-2    #FAFBFD  raised surface (table head, inputs)
     --line         #E7EAF2  hairline borders
     --line-strong  #D6DCE9  hover / active borders
     --navy         #10254B  institutional navy — headings, brand
     --navy-ink     #14335F  secondary navy tint
     --accent       #2454C7  primary interactive blue (links, primary actions)
     --accent-soft  #EAF0FE  soft blue tint (icon chips, selected rows)
     --signal-red   #C81E2C  Nagpur Police red — critical accent, live tag
     --red-soft     #FBEAEA
     --ink-900      #0E1B33  primary text
     --ink-600      #4B5876  secondary text
     --ink-400      #8A93AB  tertiary / muted text
     status: --ok #178A46  --warn #B0740A  --high #C2540C  --crit #C81E2C
   Type:
     Display: 'Poppins'        — section titles, brand wordmark, numbers-with-meaning
     Body:    'Inter'          — UI copy, labels, table text
     Ledger:  'IBM Plex Mono'  — clock, coordinates, speeds, dispatch data
   Signature:
     The "Ops Ticker" — a dispatch-scanner readout under the header, set in
     ledger mono with a pulsing red LIVE tag, echoing an actual CAD feed.
     Corridor rows carry a thin left "beat bar" in the status color, the way
     a duty roster marks a beat's state at a glance.
   ================================================================= */

:root {
  --paper: #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #FAFBFD;
  --line: #E7EAF2;
  --line-strong: #D6DCE9;

  --navy: #10254B;
  --navy-ink: #14335F;
  --accent: #2454C7;
  --accent-dim: #1B3F9E;
  --accent-soft: #EAF0FE;
  --signal-red: #C81E2C;
  --red-soft: #FBEAEA;

  --ink-900: #0E1B33;
  --ink-600: #4B5876;
  --ink-400: #8A93AB;

  --ok: #178A46;
  --ok-soft: #E7F6ED;
  --warn: #B0740A;
  --warn-soft: #FDF3E1;
  --high: #C2540C;
  --high-soft: #FCEAE0;
  --crit: #C81E2C;
  --crit-soft: #FBEAEA;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(14,27,51,0.05);
  --shadow-sm: 0 1px 3px rgba(14,27,51,0.06), 0 6px 16px rgba(14,27,51,0.04);
  --shadow-md: 0 10px 28px rgba(14,27,51,0.08);

  --font-display: 'Poppins', 'IBM Plex Sans', sans-serif;
  --font-body: 'Inter', 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    linear-gradient(rgba(16,37,75,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,37,75,0.028) 1px, transparent 1px);
  background-size: 42px 42px;
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }

/* Scrollbars — thin, quiet */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }

/* Focus visibility */
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* -----------------------------------------------------------------
   Layout shell
----------------------------------------------------------------- */
.app-shell { max-width: 1680px; margin: 0 auto; padding: 0 20px 40px; }

/* -----------------------------------------------------------------
   Topbar
----------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 4px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-text h1 {
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.5px;
  font-size: 21px; margin: 0; color: var(--navy);
}
.brand-text span {
  font-size: 12px; color: var(--ink-400); letter-spacing: 0.3px; font-weight: 500;
}
.topbar-right { display: flex; align-items: center; gap: 24px; }
.clock { font-family: var(--font-mono); font-size: 13px; color: var(--ink-600); text-align: right; }
.clock strong { color: var(--ink-900); display: block; font-size: 16px; font-weight: 600; }
.conn-status {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-600); font-weight: 500;
  background: var(--ok-soft); border: 1px solid rgba(23,138,70,0.18); border-radius: 20px; padding: 6px 12px;
}
.dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(23,138,70,0.55);
  animation: radar-pulse 2.4s infinite;
}
@keyframes radar-pulse {
  0% { box-shadow: 0 0 0 0 rgba(23,138,70,0.45); }
  70% { box-shadow: 0 0 0 8px rgba(23,138,70,0); }
  100% { box-shadow: 0 0 0 0 rgba(23,138,70,0); }
}

/* -----------------------------------------------------------------
   Ops ticker (signature element — dispatch-scanner readout)
----------------------------------------------------------------- */
.ops-ticker {
  display: flex; align-items: center; gap: 12px;
  background: var(--navy); border: 1px solid var(--navy); border-radius: var(--radius);
  padding: 9px 14px; margin-bottom: 16px; overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.ops-ticker .tag {
  font-family: var(--font-display); font-weight: 600; font-size: 10.5px; letter-spacing: 1.5px;
  color: #fff; background: var(--signal-red); padding: 4px 9px; border-radius: 4px;
  flex-shrink: 0; display: flex; align-items: center; gap: 6px;
}
.ops-ticker .tag::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.7); animation: radar-pulse-white 1.8s infinite;
}
@keyframes radar-pulse-white {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.55); }
  70% { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.ticker-track { overflow: hidden; flex: 1; white-space: nowrap; position: relative; height: 18px; }
.ticker-content {
  display: inline-block; font-family: var(--font-mono); font-size: 12.5px; color: #C9D6F0;
  animation: ticker-scroll 32s linear infinite; padding-left: 100%;
}
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.ticker-content .sep { color: #3A5389; margin: 0 18px; }

/* -----------------------------------------------------------------
   Operator Console
----------------------------------------------------------------- */
.operator-console {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 18px; box-shadow: var(--shadow-xs);
}
.operator-console .tag {
  font-family: var(--font-display); font-weight: 600; font-size: 10.5px; letter-spacing: 1.5px;
  color: var(--accent); background: var(--accent-soft); padding: 4px 9px; border-radius: 4px; flex-shrink: 0;
}
.operator-console .op-hint { font-size: 12px; color: var(--ink-400); flex: 1; min-width: 180px; }
.op-select {
  background: var(--surface-2); color: var(--ink-900); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 12px; font-size: 12.5px; font-family: var(--font-body); min-width: 200px;
}
.op-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36,84,199,0.14); }
.btn.sm { padding: 8px 14px; font-size: 12px; }
.op-status { font-size: 12px; color: var(--accent); font-family: var(--font-mono); min-width: 120px; font-weight: 500; }

/* -----------------------------------------------------------------
   Summary cards
----------------------------------------------------------------- */
.cards-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; position: relative; overflow: hidden; box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.card-icon {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; background: var(--accent-soft); color: var(--accent);
}
.card-icon svg { width: 19px; height: 19px; }
.card.accent-warn .card-icon { background: var(--warn-soft); color: var(--warn); }
.card.accent-crit .card-icon { background: var(--crit-soft); color: var(--crit); }
.card.accent-ok .card-icon { background: var(--ok-soft); color: var(--ok); }
.card-label {
  font-size: 11.5px; letter-spacing: 0.4px; text-transform: uppercase; color: var(--ink-400); font-weight: 600;
  margin-bottom: 6px;
}
.card-value {
  font-family: var(--font-mono); font-size: 28px; font-weight: 600; color: var(--ink-900); line-height: 1;
}
.card-value small { font-size: 13px; color: var(--ink-600); font-weight: 500; margin-left: 4px; }
.card-sub { font-size: 12px; color: var(--ink-400); margin-top: 8px; }

/* -----------------------------------------------------------------
   Main grid: map + incident feed
----------------------------------------------------------------- */
.main-grid { display: grid; grid-template-columns: 2.2fr 1fr; gap: 14px; margin-bottom: 18px; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-xs);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font-family: var(--font-display); font-size: 14.5px; letter-spacing: 0.3px;
  margin: 0; color: var(--navy); font-weight: 600;
}
.panel-head .hint { font-size: 11.5px; color: var(--ink-400); font-family: var(--font-mono); }

#map { width: 100%; height: 560px; background: #EAF0FA; }
.map-legend {
  position: absolute; bottom: 14px; left: 14px; z-index: 5;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 13px; font-size: 11.5px; color: var(--ink-600); display: flex; gap: 14px;
  box-shadow: var(--shadow-sm); font-weight: 500;
}
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.map-wrap { position: relative; flex: 1; }

.incident-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 560px; }
.incident-item { padding: 13px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.incident-item:hover { background: var(--surface-2); }
.incident-time { font-family: var(--font-mono); font-size: 12px; color: var(--accent); flex-shrink: 0; width: 42px; padding-top: 2px; font-weight: 600; }
.incident-body .type { font-size: 13px; font-weight: 600; color: var(--ink-900); }
.incident-body .road { font-size: 12px; color: var(--ink-600); margin-top: 3px; }
.sev-badge {
  font-size: 10px; font-family: var(--font-mono); font-weight: 600; padding: 2px 7px; border-radius: 4px; margin-left: 6px;
  border: 1px solid var(--line-strong); color: var(--ink-600); text-transform: uppercase;
}
.sev-badge.High { color: var(--crit); border-color: rgba(200,30,44,0.35); background: var(--crit-soft); }
.sev-badge.Medium { color: var(--warn); border-color: rgba(176,116,10,0.35); background: var(--warn-soft); }

/* -----------------------------------------------------------------
   Corridor table
----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.corridor-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.corridor-table thead th {
  text-align: left; padding: 12px 16px; background: var(--surface-2); color: var(--ink-400);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700;
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
table.corridor-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink-900); }
table.corridor-table tbody tr { cursor: pointer; transition: background 0.1s ease; }
table.corridor-table tbody tr:hover { background: var(--surface-2); }
table.corridor-table tbody tr:last-child td { border-bottom: none; }
.mono { font-family: var(--font-mono); }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.3px;
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; }
.status-pill.green { color: var(--ok); background: var(--ok-soft); }
.status-pill.green i { background: var(--ok); }
.status-pill.yellow { color: var(--warn); background: var(--warn-soft); }
.status-pill.yellow i { background: var(--warn); }
.status-pill.orange { color: var(--high); background: var(--high-soft); }
.status-pill.orange i { background: var(--high); }
.status-pill.red { color: var(--crit); background: var(--crit-soft); }
.status-pill.red i { background: var(--crit); animation: radar-pulse-crit 1.6s infinite; box-shadow: 0 0 0 0 rgba(200,30,44,0.5) !important; }
@keyframes radar-pulse-crit {
  0% { box-shadow: 0 0 0 0 rgba(200,30,44,0.45); }
  70% { box-shadow: 0 0 0 6px rgba(200,30,44,0); }
  100% { box-shadow: 0 0 0 0 rgba(200,30,44,0); }
}

.src-badge {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--ink-400);
}
.src-badge.tomtom { color: var(--accent); border-color: rgba(36,84,199,0.35); background: var(--accent-soft); }
.src-badge.simulated { color: var(--ink-400); border-color: var(--line-strong); background: var(--surface-2); }

/* -----------------------------------------------------------------
   Dispatch panel
----------------------------------------------------------------- */
.dispatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 16px; }
.dispatch-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.dispatch-card .top-row { display: flex; justify-content: space-between; align-items: flex-start; }
.dispatch-card .alert-msg { font-size: 12.5px; color: var(--ink-600); margin: 9px 0 8px; line-height: 1.45; }
.projection-row {
  font-size: 11.5px; color: var(--ink-600); margin-bottom: 10px; padding: 7px 9px;
  border-left: 2px solid var(--line-strong); background: var(--surface-2); border-radius: 0 6px 6px 0;
}
.projection-row strong { color: var(--ink-900); }
.projection-row .proj-icon { margin-right: 4px; }
.projection-row.worsening { border-left-color: var(--crit); background: var(--crit-soft); }
.projection-row.worsening .proj-icon { color: var(--crit); }
.projection-row.improving { border-left-color: var(--ok); background: var(--ok-soft); }
.projection-row.improving .proj-icon { color: var(--ok); }
.projection-row.stable .proj-icon { color: var(--ink-400); }
.dispatch-card .officer-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-900); }
.officer-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--accent);
}
.badge {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; padding: 3px 8px; border-radius: 4px; font-weight: 700;
}
.badge.Critical { background: var(--crit-soft); color: var(--crit); }
.badge.High { background: var(--high-soft); color: var(--high); }
.badge.Medium { background: var(--warn-soft); color: var(--warn); }
.btn-row { display: flex; gap: 8px; margin-top: 11px; }
.btn {
  font-family: var(--font-body); font-size: 12px; font-weight: 600; padding: 8px 13px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-600); cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }
.btn.wa { color: #1F9C57; border-color: rgba(31,156,87,0.35); }
.btn.wa:hover { border-color: #1F9C57; background: #E8F8EF; color: #1F9C57; }
.btn.danger { color: var(--crit); border-color: rgba(200,30,44,0.35); }
.btn.danger:hover { border-color: var(--crit); background: var(--crit-soft); color: var(--crit); }

/* -----------------------------------------------------------------
   Section title row actions (e.g. "+ Add Corridor" next to a count chip)
----------------------------------------------------------------- */
.title-row-actions { display: flex; align-items: center; gap: 12px; }

/* -----------------------------------------------------------------
   Corridor add/edit form
----------------------------------------------------------------- */
.form-section { margin-bottom: 22px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
  font-family: var(--font-display); font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 13px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.two { gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-600); font-weight: 500; }
.form-field em { color: var(--crit); font-style: normal; margin-left: 3px; }
.form-field.span2 { grid-column: span 2; }
.form-field input, .form-field select {
  background: var(--surface-2); color: var(--ink-900); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 10px 12px; font-size: 13.5px; font-family: var(--font-body);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-field input.mono { font-family: var(--font-mono); font-size: 13px; }
.form-field input:focus, .form-field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36,84,199,0.14); background: var(--surface);
}
.form-field input::placeholder { color: var(--ink-400); }
.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238A93AB'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px;
}
.input-suffix { position: relative; display: flex; align-items: center; }
.input-suffix input { width: 100%; padding-right: 46px; }
.input-suffix span {
  position: absolute; right: 12px; font-size: 11.5px; color: var(--ink-400); font-family: var(--font-mono); pointer-events: none;
}
.endpoint-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.endpoint-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.endpoint-label {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--ink-900);
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 12px;
}
.endpoint-label .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.endpoint-label .dot.start { background: var(--ok); box-shadow: 0 0 6px rgba(23,138,70,0.5); }
.endpoint-label .dot.end { background: var(--crit); box-shadow: 0 0 6px rgba(200,30,44,0.5); }
.form-hint { font-size: 11.5px; color: var(--ink-400); margin-top: 12px; }
.form-error {
  display: none; color: var(--crit); font-size: 12.5px; background: var(--crit-soft);
  border: 1px solid rgba(200,30,44,0.25); border-radius: 8px; padding: 10px 12px; margin-top: 18px;
}
.form-error:not(:empty) { display: block; }

/* -----------------------------------------------------------------
   Charts
----------------------------------------------------------------- */
.charts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.chart-card { padding: 16px; height: 240px; }
.chart-card canvas { max-height: 190px; }

/* -----------------------------------------------------------------
   Modal (WhatsApp preview + corridor detail)
----------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(14,27,51,0.45); display: none;
  align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  width: 380px; max-width: 92vw; overflow: hidden; box-shadow: var(--shadow-md);
}
.modal-box.wide { width: 720px; }
.modal-close { position: absolute; top: 10px; right: 14px; cursor: pointer; color: var(--ink-400); font-size: 20px; }
.modal-close:hover { color: var(--ink-900); }

.modal-box.corridor-modal { display: flex; flex-direction: column; max-height: 88vh; }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 22px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.modal-head h2 {
  font-family: var(--font-display); font-size: 16.5px; letter-spacing: 0.2px;
  margin: 0 0 4px; color: var(--navy); font-weight: 600;
}
.modal-subtitle { margin: 0; font-size: 12px; color: var(--ink-400); }
.modal-head .modal-close { position: static; line-height: 1; padding: 2px; flex-shrink: 0; }
.modal-scroll { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px; border-top: 1px solid var(--line); flex-shrink: 0; background: var(--surface-2);
}
.footer-actions { display: flex; gap: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--line-strong); color: var(--ink-600); background: var(--surface); }
.btn.primary:disabled:hover { background: var(--accent); color: #fff; }

.wa-phone { background: #0B141A; padding: 0; }
.wa-header { background: #005C4B; color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.wa-body { padding: 16px; min-height: 160px; }
.wa-bubble {
  background: #005C4B; color: #E9EDEF; border-radius: 8px; padding: 10px 12px; font-size: 13px;
  line-height: 1.5; max-width: 90%; box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.wa-bubble .wa-title { font-weight: 700; margin-bottom: 4px; }
.wa-bubble .wa-time { font-size: 10px; color: rgba(233,237,239,0.6); text-align: right; margin-top: 6px; }
.wa-nav-btn {
  display: block; text-align: center; margin-top: 10px; background: rgba(255,255,255,0.08);
  border-top: 1px solid rgba(255,255,255,0.15); padding: 8px; color: #53BDEB; font-size: 13px; font-weight: 600; cursor: pointer;
}

/* -----------------------------------------------------------------
   Section spacing / headers reused
----------------------------------------------------------------- */
.section-title-row { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 12px; }
.section-title-row h2 {
  font-family: var(--font-display); font-size: 16px; letter-spacing: 0.2px; font-weight: 600;
  margin: 0; color: var(--navy);
}
.section-title-row .count-chip {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent); border: 1px solid var(--line-strong);
  background: var(--accent-soft); border-color: rgba(36,84,199,0.25);
  padding: 3px 10px; border-radius: 20px; font-weight: 600;
}

footer.footnote {
  text-align: center; color: var(--ink-400); font-size: 11px; margin-top: 30px; font-family: var(--font-mono);
}

/* -----------------------------------------------------------------
   Advisory / demo-module banners (Signal Timing, Challan Desk)
----------------------------------------------------------------- */
.advisory-banner {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--warn-soft); border: 1px solid rgba(176,116,10,0.28); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 12px; font-size: 12.5px; color: var(--ink-600);
}
.advisory-banner strong {
  color: var(--warn); text-transform: uppercase; font-size: 11px; letter-spacing: 0.4px;
  background: var(--surface); border: 1px solid rgba(176,116,10,0.3); border-radius: 4px; padding: 2px 7px;
}

/* -----------------------------------------------------------------
   Challan slip (printable)
----------------------------------------------------------------- */
.slip-box { position: relative; padding: 26px; background: var(--surface); overflow: hidden; }
.slip-watermark {
  position: absolute; top: 48%; left: 50%; transform: translate(-50%, -50%) rotate(-22deg);
  font-family: var(--font-display); font-size: 76px; font-weight: 700; letter-spacing: 8px;
  color: rgba(200,30,44,0.07); pointer-events: none; z-index: 0; white-space: nowrap;
}
.slip-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; position: relative; z-index: 1; }
.slip-header img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); flex-shrink: 0; }
.slip-title { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--navy); }
.slip-subtitle { font-size: 11.5px; color: var(--crit); font-weight: 600; margin-top: 3px; }
.slip-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; position: relative; z-index: 1;
  padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.slip-grid > div { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.slip-grid span { color: var(--ink-400); text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.4px; }
.slip-grid strong { color: var(--ink-900); font-size: 13.5px; }
.slip-notes { margin-top: 14px; font-size: 12.5px; position: relative; z-index: 1; }
.slip-notes span { color: var(--ink-400); text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.4px; display: block; margin-bottom: 4px; }
.slip-notes p { margin: 0; color: var(--ink-600); word-break: break-word; }
.slip-footer {
  margin-top: 16px; font-size: 11px; color: var(--ink-400); position: relative; z-index: 1;
  border-top: 1px dashed var(--line-strong); padding-top: 10px;
}

@media print {
  body * { visibility: hidden; }
  #challanSlipModal, #challanSlipModal * { visibility: visible; }
  #challanSlipModal { position: absolute; inset: 0; background: #fff; display: block; }
  #challanSlipModal .modal-close,
  #challanSlipModal .modal-footer { display: none; }
}

/* -----------------------------------------------------------------
   Responsive
----------------------------------------------------------------- */
@media (max-width: 1200px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .main-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .modal-box.wide { width: 94vw; }
  .form-grid, .form-grid.two, .endpoint-grid { grid-template-columns: 1fr; }
  .form-field.span2 { grid-column: span 1; }
  .modal-footer { flex-direction: column-reverse; align-items: stretch; }
  .footer-actions { justify-content: stretch; }
  .footer-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dot-live, .ops-ticker .tag::before, .status-pill.red i, .ticker-content { animation: none; }
}