/* ============================================================
   TRANSPORTES DIGITAIS · Design System
   República de Moçambique · MTC · INATTER · DTrD
   v0.3 · Abril 2026
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Serif:wght@400;500;600&display=swap');

:root {
  /* ── Brand: Cobalt road-sign blue ─────────────────────── */
  --cobalt-900: #0F2A52;
  --cobalt-800: #163A6E;
  --cobalt-700: #1E4A8C;  /* PRIMARY · sinalética rodoviária */
  --cobalt-600: #2A5DA8;
  --cobalt-500: #4577C2;
  --cobalt-300: #93B2DA;
  --cobalt-200: #B9CDE5;
  --cobalt-100: #DCE7F3;
  --cobalt-50:  #EEF3FA;

  /* ── Co-anchor 1: Asphalt charcoal (estrada/sinal) ───── */
  --asphalt-900: #0E1116;
  --asphalt-800: #1A1F26;
  --asphalt-700: #2A2E33;
  --asphalt-500: #4A4F57;
  --asphalt-300: #8B8F96;
  --asphalt-100: #DCDEE2;

  /* ── Co-anchor 2: Amber sign yellow (cuidado/aviso) ──── */
  --amber-900: #5C3F00;
  --amber-700: #8C5F00;
  --amber-600: #B8851A;
  --amber-500: #D69E1A;
  --amber-300: #ECCB6E;
  --amber-100: #F8EBC3;
  --amber-50:  #FCF6E2;

  /* ── Hi-vis (PRM-Trânsito acessório) ─────────────────── */
  --hivis-yellow: #FFEC1F;
  --hivis-black: #0E1116;

  /* ── Sectoral semantic ───────────────────────────────── */
  --good-700: #1F6B45;
  --good-100: #DCEDDF;
  --good-500: #2E8254;
  --amber-c-700: #8B5800;   /* cuidado · pendente */
  --amber-c-100: #FBEFC9;
  --red-700: #9A2A1F;
  --red-500: #C73E2E;
  --red-100: #F5DEDA;
  --red-50: #FCEFEC;

  /* ── Modos de transporte (chips) — 8 fechados ────────── */
  --mode-ligeiro:    #2A5DA8; /* automóvel ligeiro */
  --mode-pesado:     #5C3A24; /* camião */
  --mode-passageiro: #0E7A4D; /* machibombo */
  --mode-chapa:      #C73E2E; /* chapa-100 (semicolectivo) */
  --mode-taxi:       #D69E1A; /* táxi */
  --mode-moto:       #7A4A8C; /* motociclo */
  --mode-ferrov:     #62697A; /* CFM ferroviário */
  --mode-marit:      #0E5C6B; /* marítimo / fluvial */

  /* ── Surfaces · cool road-grey canvas ────────────────── */
  --bg:   #F4F6F9;   /* canvas sob neutro frio · estrada */
  --bg-2: #ECF0F5;
  --paper: #FFFFFF;

  /* ── Type · ink scale on cool grey ───────────────────── */
  --ink:    #0E1116;
  --ink-2:  #2A2E33;
  --ink-3:  #5A6068;
  --ink-4:  #8B9098;
  --ink-5:  #B0B5BC;

  /* ── Lines ───────────────────────────────────────────── */
  --line:   #D8DDE5;
  --line-2: #E8ECF1;
  --line-3: #F0F3F7;

  /* ── Type families ───────────────────────────────────── */
  --f-sans: 'IBM Plex Sans', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --f-serif: 'IBM Plex Serif', serif;

  /* ── Radii · sharp authority ─────────────────────────── */
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 8px;
  --r-4: 12px;

  /* ── Shadows ─────────────────────────────────────────── */
  --sh-1: 0 1px 2px rgba(15, 42, 82, 0.06);
  --sh-2: 0 2px 8px rgba(15, 42, 82, 0.08);
  --sh-3: 0 8px 24px rgba(15, 42, 82, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cobalt-700); text-decoration: none; }
a:hover { text-decoration: underline; }

hr.hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* ── Government strip ─────────────────────────────────── */
.govstrip {
  background: var(--cobalt-900);
  color: #DCE7F3;
  font-size: 11px;
  font-family: var(--f-mono);
  padding: 6px 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  letter-spacing: 0.02em;
}
.govstrip .sep { color: rgba(220, 231, 243, 0.4); }

/* ── Hi-vis stripe (PRM-Trânsito accent · 8px) ────────── */
.hivis {
  height: 8px;
  background: repeating-linear-gradient(
    -45deg,
    var(--hivis-yellow) 0 12px,
    var(--hivis-black) 12px 24px
  );
}

/* ── Top bar ──────────────────────────────────────────── */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
}
.topbar .brand:hover { text-decoration: none; }
.topbar .brand .mark {
  width: 28px;
  height: 28px;
  background: var(--cobalt-700);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}
/* Brand mark: stylized road sign — diamond/octagon */
.topbar .brand .mark::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid #fff;
  transform: rotate(45deg);
}
.topbar .brand .mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 2px;
  background: #fff;
  transform: translate(-50%, -50%);
}
.topbar .brand .stack {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.topbar .brand .stack small {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 400;
}
.topbar .nav {
  display: flex;
  gap: 4px;
  flex: 1;
}
.topbar .nav a {
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink-2);
  border-radius: 2px;
  font-weight: 500;
}
.topbar .nav a:hover { background: var(--bg-2); text-decoration: none; }
.topbar .nav a.active {
  background: var(--cobalt-100);
  color: var(--cobalt-800);
  font-weight: 600;
}
.topbar .right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.topbar .conn {
  font-size: 11px;
  color: var(--good-700);
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--f-mono);
}
.topbar .conn .d { width: 6px; height: 6px; background: var(--good-500); border-radius: 50%; }
.topbar .conn.amber { color: var(--amber-c-700); }
.topbar .conn.amber .d { background: var(--amber-500); }

.idbadge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.idbadge .who { line-height: 1.2; font-size: 12px; }
.idbadge .who b { display: block; font-weight: 600; }
.idbadge .who span { color: var(--ink-3); font-size: 11px; }

/* ── Avatars ──────────────────────────────────────────── */
.av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cobalt-100);
  color: var(--cobalt-800);
  font-weight: 600;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.av.sm { width: 24px; height: 24px; font-size: 10px; }
.av.lg { width: 48px; height: 48px; font-size: 14px; }

/* ── Type ─────────────────────────────────────────────── */
.t-overline {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 600;
}
.t-h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.t-h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.25; }
.t-h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.t-body { font-size: 14px; line-height: 1.55; }
.t-meta { font-size: 12px; color: var(--ink-3); }

.mono { font-family: var(--f-mono); }
.serif { font-family: var(--f-serif); }

/* ── Layout helpers ───────────────────────────────────── */
.row { display: flex; align-items: center; gap: 8px; }
.row.spread { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid.g-2 { grid-template-columns: repeat(2, 1fr); }
.grid.g-3 { grid-template-columns: repeat(3, 1fr); }
.grid.g-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: var(--cobalt-700);
  color: #fff;
  border: 0;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover { background: var(--cobalt-800); text-decoration: none; }
.btn.lg { height: 44px; padding: 0 18px; font-size: 14px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn.secondary {
  background: var(--paper);
  color: var(--cobalt-700);
  border: 1px solid var(--cobalt-300);
}
.btn.secondary:hover { background: var(--cobalt-50); border-color: var(--cobalt-700); }
.btn.ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: var(--bg-2); }
.btn.danger { background: var(--red-700); color: #fff; }
.btn.danger:hover { background: var(--red-500); }
.btn.success { background: var(--good-700); color: #fff; }
.btn.warn {
  background: var(--amber-500);
  color: var(--asphalt-900);
}
.btn.warn:hover { background: var(--amber-600); }
.btn-icon { width: 36px; padding: 0; }

/* ── Inputs ───────────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--cobalt-700);
  box-shadow: 0 0 0 3px var(--cobalt-100);
}
.input.lg { height: 44px; font-size: 14px; }
.textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 11px; color: var(--ink-3); }

/* ── Badges ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--cobalt-100);
  color: var(--cobalt-800);
  border: 1px solid var(--cobalt-200);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 500;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--good-100); color: var(--good-700); border-color: #BDDFCB; }
.badge.amber { background: var(--amber-c-100); color: var(--amber-c-700); border-color: #E5D08A; }
.badge.red { background: var(--red-100); color: var(--red-700); border-color: #E5B7AE; }
.badge.cobalt { background: var(--cobalt-100); color: var(--cobalt-800); border-color: var(--cobalt-200); }
.badge.asphalt { background: var(--asphalt-100); color: var(--asphalt-700); border-color: #C8CCD2; }

/* ── Modes (transport mode chips) ─────────────────────── */
.mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid;
}
.mode.ligeiro { background: var(--cobalt-100); color: var(--cobalt-800); border-color: var(--cobalt-200); }
.mode.pesado { background: #EEE2D9; color: #4A2D1A; border-color: #C8AB91; }
.mode.passageiro { background: #DCEDE0; color: #0E5C3A; border-color: #A8D2B4; }
.mode.chapa { background: var(--red-100); color: var(--red-700); border-color: #E5B7AE; }
.mode.taxi { background: var(--amber-c-100); color: var(--amber-c-700); border-color: #E5D08A; }
.mode.moto { background: #E8DDF0; color: #4A2A5C; border-color: #C8B0DC; }
.mode.ferrov { background: var(--asphalt-100); color: var(--asphalt-700); border-color: #C8CCD2; }
.mode.marit { background: #D2E5E8; color: #0E3A45; border-color: #98C0C8; }

/* ── Banners ──────────────────────────────────────────── */
.banner {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 2px;
  border-left: 3px solid;
  font-size: 13px;
  align-items: flex-start;
  line-height: 1.5;
}
.banner .ic {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background: currentColor;
  mask: radial-gradient(circle, transparent 5px, currentColor 6px) center/100% 100% no-repeat;
  margin-top: 1px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.banner.cobalt { background: var(--cobalt-50); border-color: var(--cobalt-700); color: var(--cobalt-900); }
.banner.amber, .banner.warn { background: var(--amber-50); border-color: var(--amber-500); color: var(--amber-900); }
.banner.green { background: var(--good-100); border-color: var(--good-500); color: var(--good-700); }
.banner.red { background: var(--red-50); border-color: var(--red-500); color: var(--red-700); }
.banner.hivis {
  background: var(--amber-50);
  border-left: 3px solid var(--hivis-yellow);
  color: var(--asphalt-900);
}

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
}
.card .bd { padding: 14px 16px; }

/* ── Driver card (carta hero) ─────────────────────────── */
.driver-card {
  background: linear-gradient(135deg, var(--cobalt-900) 0%, var(--cobalt-700) 100%);
  color: #fff;
  border-radius: var(--r-3);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.driver-card::before {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}
.driver-card .lbl {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cobalt-200);
  font-weight: 600;
}
.driver-card .num {
  font-family: var(--f-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.driver-card .ti {
  font-size: 15px;
  font-weight: 500;
  margin-top: 12px;
}
.driver-card .meta {
  font-size: 11px;
  color: var(--cobalt-200);
  margin-top: 2px;
}
.driver-card .qr {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: #fff;
  padding: 4px;
  border-radius: 2px;
}

/* ── Vehicle plate (matrícula MZ) ─────────────────────── */
.plate {
  display: inline-flex;
  align-items: stretch;
  border: 2px solid var(--asphalt-900);
  border-radius: 3px;
  background: var(--paper);
  font-family: var(--f-mono);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 16px;
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.plate .country {
  background: var(--cobalt-900);
  color: var(--amber-500);
  width: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  padding: 4px 0;
  letter-spacing: 0;
}
.plate .country::before {
  content: "★";
  font-size: 10px;
  color: var(--amber-500);
  line-height: 1;
}
.plate .num {
  padding: 6px 10px;
  color: var(--asphalt-900);
  background: linear-gradient(180deg, #fff 0%, #F4F6F9 100%);
}
.plate.lg { font-size: 22px; }
.plate.lg .country { width: 34px; font-size: 9px; }
.plate.lg .num { padding: 8px 14px; }
.plate.sm { font-size: 13px; }
.plate.sm .country { width: 20px; font-size: 7px; }
.plate.sm .num { padding: 4px 8px; }

/* ── Carta de Condução serifada (auto serifado) ───────── */
.licence {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  font-family: var(--f-serif);
}
.licence .hd {
  background: linear-gradient(180deg, var(--cobalt-900) 0%, var(--cobalt-700) 100%);
  color: #fff;
  padding: 14px 18px;
  position: relative;
}
.licence .hd .ti {
  font-family: var(--f-serif);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.licence .hd .sub {
  font-size: 11px;
  color: var(--cobalt-200);
  font-family: var(--f-mono);
  margin-top: 2px;
}
.licence .bd {
  padding: 18px 22px;
  font-size: 13px;
  line-height: 1.7;
}
.licence .ft {
  border-top: 1px solid var(--line-2);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--bg-2);
}
.licence .seal {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cobalt-700);
  border: 2px solid var(--cobalt-700);
  padding: 4px 8px;
  border-radius: 50%;
  transform: rotate(-4deg);
  font-family: var(--f-sans);
}

/* ── Auto de Notícia (PRM-Trânsito) ───────────────────── */
.auto {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
}
.auto .hd {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}
.auto .hd .ti {
  font-weight: 600;
  font-size: 14px;
}
.auto .bd {
  padding: 16px 20px;
  font-family: var(--f-serif);
  font-size: 13px;
  line-height: 1.7;
}
.auto .ft {
  background: var(--bg-2);
  border-top: 1px solid var(--line-2);
  padding: 12px 16px;
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.auto .ft .seal {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cobalt-700);
  border: 2px solid var(--cobalt-700);
  padding: 4px 10px;
  border-radius: 2px;
  transform: rotate(-3deg);
  font-family: var(--f-sans);
}
.auto .ft .seal.hivis {
  background: var(--hivis-yellow);
  border-color: var(--hivis-black);
  color: var(--hivis-black);
  height: auto;
}

/* ── KPI cards ────────────────────────────────────────── */
.kpi {
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.kpi .lbl {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.kpi .num {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 4px;
  font-family: var(--f-mono);
}
.kpi .delta {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
}

/* ── Tables ───────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
}
.table th {
  background: var(--bg-2);
  font-weight: 600;
  color: var(--ink-2);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table tbody tr:hover { background: var(--bg-2); }
.table .num { text-align: right; font-family: var(--f-mono); }

/* ── Steppers ─────────────────────────────────────────── */
.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stepper .step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 11px;
  color: var(--ink-3);
}
.stepper .step .n {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 10px;
  font-family: var(--f-mono);
}
.stepper .step.done .n { background: var(--good-500); color: #fff; }
.stepper .step.done { color: var(--good-700); }
.stepper .step.active .n { background: var(--cobalt-700); color: #fff; }
.stepper .step.active { color: var(--cobalt-800); font-weight: 600; }
.stepper .ln {
  width: 24px;
  height: 1px;
  background: var(--line);
}

/* ── Bars / progress ──────────────────────────────────── */
.bar {
  height: 6px;
  background: var(--bg-2);
  border-radius: 2px;
  overflow: hidden;
}
.bar .fill {
  height: 100%;
  background: var(--cobalt-700);
  border-radius: 2px;
}

/* ── Timeline ─────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 14px;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--line);
}
.timeline .ev {
  display: flex;
  gap: 12px;
  position: relative;
}
.timeline .ev .dot {
  position: absolute;
  left: -14px;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line);
}
.timeline .ev.done .dot { background: var(--good-500); border-color: var(--good-500); }
.timeline .ev.now .dot { background: var(--cobalt-700); border-color: var(--cobalt-700); }
.timeline .ev.now .dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 2px solid var(--cobalt-700);
  border-radius: 50%;
  opacity: 0.3;
}
.timeline .ev.amber .dot { background: var(--amber-500); border-color: var(--amber-500); }
.timeline .ev.red .dot { background: var(--red-500); border-color: var(--red-500); }
.timeline .ev .body { flex: 1; padding-left: 4px; }

/* ── Risk meter ───────────────────────────────────────── */
.risk {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}
.risk .level {
  display: flex;
  gap: 3px;
}
.risk .level span {
  width: 8px;
  height: 18px;
  border-radius: 1px;
  background: var(--bg-2);
}
.risk.low .level span:nth-child(1) { background: var(--good-500); }
.risk.med .level span:nth-child(1),
.risk.med .level span:nth-child(2) { background: var(--amber-500); }
.risk.high .level span:nth-child(1),
.risk.high .level span:nth-child(2),
.risk.high .level span:nth-child(3) { background: var(--red-500); }
.risk.critical .level span { background: var(--red-700); }

/* ── Speedometer (PRM-Trânsito · velocidade radar) ────── */
.speedo {
  width: 140px;
  height: 80px;
  position: relative;
}
.speedo svg { width: 100%; height: 100%; }
.speedo .val {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--f-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--cobalt-800);
}
.speedo .unit { font-size: 10px; color: var(--ink-3); display: block; text-align: center; }

/* ── Phone frame (Condutor PWA) ───────────────────────── */
.phone {
  width: 360px;
  height: 720px;
  background: var(--asphalt-900);
  border-radius: 32px;
  padding: 8px;
  box-shadow: var(--sh-3);
  flex: 0 0 auto;
}
.phone .screen {
  width: 100%;
  height: 100%;
  background: var(--paper);
  border-radius: 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.phone .statusbar {
  background: var(--paper);
  padding: 8px 16px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-family: var(--f-mono);
  font-weight: 600;
  color: var(--ink);
}
.phone .statusbar .icons { display: flex; gap: 4px; align-items: center; font-size: 9px; }
.phone .nav-bottom {
  display: flex;
  justify-content: space-around;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 8px 4px;
}
.phone .nav-bottom a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 500;
}
.phone .nav-bottom a.active { color: var(--cobalt-700); }
.phone .nav-bottom .ic {
  width: 20px;
  height: 20px;
  background: currentColor;
  mask: radial-gradient(circle, transparent 4px, currentColor 5px) center/100% 100% no-repeat;
}

/* ── Tablet frame (PRM-Trânsito) ──────────────────────── */
.tablet {
  width: 980px;
  height: 680px;
  background: var(--asphalt-900);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--sh-3);
  flex: 0 0 auto;
}
.tablet .screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Worker card / kv pairs ───────────────────────────── */
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv .k {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.kv .v {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

/* ── QR fake square ───────────────────────────────────── */
.qr-square {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px;
  background: #fff;
  padding: 4px;
  border-radius: 2px;
}
.qr-square span {
  aspect-ratio: 1;
  background: #fff;
}
.qr-square span.b { background: var(--asphalt-900); }

/* ── Currency mzn ─────────────────────────────────────── */
.mzn {
  font-family: var(--f-mono);
  font-weight: 600;
}
.mzn small {
  font-size: 0.7em;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: 2px;
}

/* ── Modal ────────────────────────────────────────────── */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 42, 82, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--paper);
  border-radius: var(--r-3);
  width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-3);
}
.modal .hd {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.modal .hd b { font-size: 15px; }
.modal .bd {
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
}
.modal .ft {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Add/deduct rows on slips ─────────────────────────── */
.payslip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  overflow: hidden;
  font-family: var(--f-mono);
  font-size: 12px;
}
.payslip .row {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.payslip .row:last-child { border-bottom: 0; }
.payslip .row.add { color: var(--good-700); }
.payslip .row.deduct { color: var(--red-700); }
