/* Dubai Traffic Intelligence. Restrained institutional design system.
   Sharp corners, hairline rules, tabular figures, status colour only for status. */

:root {
  --navy-900: #0b1f35;
  --navy-800: #12314f;
  --accent: #9c8034;

  --ink: #101820;
  --ink-2: #3d4a58;
  --ink-3: #6b7683;

  --rule: #dde2e8;
  --rule-soft: #e9edf1;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --bg: #eef1f5;

  --green: #1e7a46;
  --amber: #b26a00;
  --red: #b32020;
  --neutral: #8b96a3;

  --gap: 18px;
  --pad: 24px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  line-height: 1.5;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { margin: 0; font-weight: 500; }
p { margin: 0; }

.shell { max-width: 1660px; margin: 0 auto; padding-left: 40px; padding-right: 40px; }

.micro {
  display: block; font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500;
}

/* ------------------------------------------------------------ masthead */
.masthead { background: var(--navy-900); color: #fff; }
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px; padding-top: 26px; padding-bottom: 26px; flex-wrap: wrap;
}
.wordmark { display: flex; align-items: stretch; gap: 18px; }
.wordmark-rule { width: 3px; background: var(--accent); flex: none; }
.masthead h1 {
  font-size: 21px; letter-spacing: .19em; text-transform: uppercase; font-weight: 600; line-height: 1.1;
}
.wordmark-sub { margin-top: 7px; font-size: 12px; letter-spacing: .05em; color: #9db0c4; }

.masthead-status { display: flex; align-items: center; gap: 28px; }
.live-block { text-align: right; display: flex; flex-direction: column; gap: 5px; }
.live-flag {
  display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; color: #e8eef4;
}
.live-time { font-size: 11.5px; color: #93a7bb; }
.live-time strong { color: #e8eef4; font-weight: 500; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--neutral); flex: none; }
.live-flag .dot { background: #3f9c65; }
.live-flag .dot.stale { background: #c0873a; }
.live-flag .dot.down { background: #c05a5a; }

.btn {
  border: 1px solid rgba(255,255,255,.32); background: transparent; color: #fff;
  font: inherit; font-size: 11.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  padding: 11px 20px; cursor: pointer; border-radius: 2px;
}
.btn:hover { background: rgba(255,255,255,.09); }
.btn:disabled { opacity: .45; cursor: default; }

/* ------------------------------------------------------------- ribbon */
.ribbon { background: var(--navy-800); color: #b9c8d7; }
.ribbon-inner {
  display: flex; align-items: center; gap: 46px; flex-wrap: wrap;
  padding-top: 10px; padding-bottom: 10px; font-size: 11.5px;
}
.ribbon-item { display: flex; align-items: baseline; gap: 10px; }
.ribbon-item .micro { color: #7f95ab; }
.ribbon-conn { margin-left: auto; }
.conn { display: inline-flex; align-items: center; gap: 8px; color: #dbe4ec; }
.conn.ok .dot { background: #3f9c65; }
.conn.warn .dot { background: #c0873a; }
.conn.err .dot { background: #c05a5a; }

/* ------------------------------------------------------------- notice */
.notice { background: #fbf3f3; border-bottom: 1px solid #eed6d6; }
.notice-inner {
  display: flex; align-items: baseline; gap: 14px;
  padding-top: 11px; padding-bottom: 11px; font-size: 12.5px; color: #7d2b2b;
}
.notice-tag {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 500; color: var(--red); flex: none;
}

/* --------------------------------------------------------------- main */
.main { padding-top: 26px; padding-bottom: 56px; }
.main > .panel { margin-bottom: var(--gap); }

.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 2px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 15px var(--pad); border-bottom: 1px solid var(--rule-soft);
}
.panel-head h2 {
  font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--navy-800); font-weight: 600;
}
.panel-note { font-size: 11.5px; color: var(--ink-3); }
.panel-foot {
  padding: 12px var(--pad); border-top: 1px solid var(--rule-soft);
  font-size: 11.5px; color: var(--ink-3);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer; font: inherit;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 500; color: var(--navy-800);
}
.link-btn:hover { text-decoration: underline; }
.count {
  min-width: 24px; text-align: center; font-size: 12px; font-weight: 500;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--rule);
  border-radius: 2px; padding: 1px 8px;
}
.count.hot { color: var(--red); background: #fbf3f3; border-color: #eed6d6; }

/* ----------------------------------------------------- condition strip */
.condition {
  display: flex; align-items: center; justify-content: space-between;
  gap: 48px; padding: 24px var(--pad); flex-wrap: wrap;
}
.condition-read { min-width: 0; }
.condition-line {
  font-size: 25px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; color: var(--navy-900);
}
.condition-line.tone-amber { color: var(--amber); }
.condition-line.tone-red { color: var(--red); }
.condition-line.tone-unknown { color: var(--ink-3); }
.condition-sub { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }

.condition-figures { display: flex; align-items: stretch; gap: 0; flex: none; }
.figure {
  padding: 2px 26px; border-left: 1px solid var(--rule-soft);
  display: flex; flex-direction: column; gap: 10px; min-width: 118px;
}
.figure:first-child { border-left: 0; }
.figure .micro { display: flex; align-items: center; gap: 7px; }
.tick { width: 8px; height: 8px; flex: none; }
.tick-green { background: var(--green); }
.tick-amber { background: var(--amber); }
.tick-red { background: var(--red); }
.figure-value {
  font-size: 30px; line-height: 1; font-weight: 500; letter-spacing: -0.02em;
  color: var(--navy-900); font-variant-numeric: tabular-nums;
}
.f-green { color: var(--green); }
.f-amber { color: var(--amber); }
.f-red { color: var(--red); }

/* -------------------------------------------------------------- alerts */
.alerts-panel.has-alerts { border-color: #e3bfbf; }
.alerts-panel.has-alerts .panel-head { border-bottom-color: #f0dada; }
.alert-list { padding: 0; }
.alert-empty { padding: 18px var(--pad); font-size: 13px; color: var(--ink-3); }

.alert-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.alert {
  padding: 20px var(--pad) 22px; cursor: pointer;
  border-left: 1px solid var(--rule-soft); border-top: 1px solid var(--rule-soft);
}
.alert:first-child { border-left: 0; }
.alert-flag {
  display: flex; align-items: center; gap: 9px;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--red);
}
.alert-flag .dot { background: var(--red); border-radius: 0; width: 8px; height: 8px; }
.alert.resolved .alert-flag { color: var(--ink-3); }
.alert.resolved .alert-flag .dot { background: var(--neutral); }
.alert-road { font-size: 16px; font-weight: 500; margin: 10px 0 14px; color: var(--ink); }
.alert-headline { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.alert-delay {
  font-size: 28px; font-weight: 500; letter-spacing: -0.02em; color: var(--red);
  font-variant-numeric: tabular-nums;
}
.alert.resolved .alert-delay { color: var(--ink-2); }
.alert-times { font-size: 12.5px; color: var(--ink-3); }
.alert-rows { margin-top: 14px; display: grid; gap: 5px; font-size: 12.5px; max-width: 300px; }
.alert-row { display: flex; justify-content: space-between; gap: 16px; color: var(--ink-3); }
.alert-row b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.alert-copy {
  margin-top: 14px; padding-left: 11px; border-left: 2px solid var(--red);
  font-size: 12.5px; color: var(--ink-2); line-height: 1.55; max-width: 320px;
}
.alert.resolved .alert-copy { border-left-color: var(--neutral); }

/* --------------------------------------------------------------- status */
.status {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; white-space: nowrap;
}
.status i { width: 8px; height: 8px; flex: none; }
.status-green { color: var(--green); } .status-green i { background: var(--green); }
.status-amber { color: var(--amber); } .status-amber i { background: var(--amber); }
.status-red   { color: var(--red);   } .status-red i   { background: var(--red); }
.status-unknown { color: var(--ink-3); } .status-unknown i { background: var(--neutral); }
.status-note { font-size: 10px; letter-spacing: .1em; color: var(--ink-3); font-weight: 500; }

/* ------------------------------------------------------------------ map */
.map { width: 100%; height: 700px; background: var(--surface-2); overflow: hidden; }
.map-fallback {
  height: 700px; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 40px; background: var(--surface-2);
  color: var(--ink-2); font-size: 13px; line-height: 1.6;
}
/* Definitions bar: what each status actually means, next to where it is used. */
.keybar {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface-2); border-bottom: 1px solid var(--rule);
}
.keyitem { padding: 16px var(--pad) 18px; border-left: 1px solid var(--rule); }
.keyitem:first-child { border-left: 0; }
.keyitem-head {
  display: flex; align-items: center; gap: 9px;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
}
.keyitem:nth-child(1) .keyitem-head { color: var(--green); }
.keyitem:nth-child(2) .keyitem-head { color: var(--amber); }
.keyitem:nth-child(3) .keyitem-head { color: var(--red); }
.keyitem-range {
  margin-top: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.keyitem-note { margin-top: 5px; font-size: 12px; color: var(--ink-3); line-height: 1.55; max-width: 44ch; }

/* ---------------------------------------------------------------- table */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500; padding: 12px var(--pad);
  border-bottom: 1px solid var(--rule); white-space: nowrap;
}
td {
  padding: 14px var(--pad); border-bottom: 1px solid var(--rule-soft);
  font-size: 13.5px; color: var(--ink-2); vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.delay-col, td.delay-col { width: 132px; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr.selected td { background: #f2f6fa; }
tbody tr.selected td:first-child { box-shadow: inset 2px 0 0 var(--navy-800); }
td.road { color: var(--ink); font-weight: 500; }
td.road small {
  display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; margin-top: 3px;
}
td.delay-amber { color: var(--amber); font-weight: 500; }
td.delay-red { color: var(--red); font-weight: 600; }
.bar {
  display: block; height: 3px; background: var(--rule-soft); margin-top: 7px; margin-left: auto; width: 84px;
}
.bar-fill { display: block; height: 100%; }

/* ---------------------------------------------------------------- trend */
.trend { padding: var(--pad); }
.trend-empty { font-size: 13px; color: var(--ink-3); }
.trend-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; }
.chart { width: 100%; height: auto; display: block; }
.chart-note { margin-top: 14px; font-size: 11.5px; color: var(--ink-3); max-width: 640px; line-height: 1.6; }
.readings-title { margin-bottom: 10px; }
.readings { border-top: 1px solid var(--rule); max-height: 210px; overflow-y: auto; }
.reading {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0; border-bottom: 1px solid var(--rule-soft);
  font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink-3);
}
.reading b { font-weight: 500; color: var(--ink); }
.reading.is-amber b { color: var(--amber); }
.reading.is-red b { color: var(--red); }

/* ------------------------------------------------------------ colophon */
.colophon { margin-top: 26px; }
.colophon p { max-width: 900px; font-size: 11.5px; line-height: 1.75; color: var(--ink-3); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1240px) {
  .shell { padding-left: 24px; padding-right: 24px; }
  .condition { gap: 28px; }
  .condition-line { font-size: 22px; }
  .figure { padding: 2px 18px; min-width: 100px; }
  .trend-grid { grid-template-columns: 1fr; gap: 28px; }
  .readings { max-height: none; }
  .map, .map-fallback { height: 560px; }
}
@media (max-width: 1000px) {
  .keybar { grid-template-columns: 1fr; }
  .keyitem { border-left: 0; border-top: 1px solid var(--rule); padding-top: 14px; padding-bottom: 14px; }
  .keyitem:first-child { border-top: 0; }
}
@media (max-width: 900px) {
  .masthead-inner { padding-top: 20px; padding-bottom: 20px; }
  .masthead-status { width: 100%; justify-content: space-between; }
  .condition { flex-direction: column; align-items: flex-start; gap: 22px; }
  .condition-figures { width: 100%; }
  .figure { flex: 1; min-width: 0; padding: 2px 14px; }
  .figure:first-child { padding-left: 0; }
  .alert-grid { grid-template-columns: 1fr; }
  .alert { border-left: 0; }
  .map, .map-fallback { height: 440px; }
  .ribbon-conn { margin-left: 0; }
}
