* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-page: #eef1fb;
  --bg-primary: #eef1fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e8ecf8;
  --border: #e2e8f4;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-deep: #1e3a8a;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ec4899;
  --purple: #8b5cf6;
  --selected-bg: #e8efff;
  --selected-border: #2563eb;
  --shadow: 0 10px 28px rgba(37, 99, 235, 0.08);
  --radius-card: 18px;
  --radius-pill: 999px;
  --hero: linear-gradient(90deg, #1d4ed8 0%, #2563eb 48%, #3b82f6 100%);
  --assistant-width: min(400px, 42vw);
}
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}
.shell { display: flex; align-items: stretch; min-height: calc(100vh - 76px); }
.page {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 18px 24px 32px;
  max-width: none;
  margin: 0;
}
.assistant-drawer {
  width: 0;
  overflow: hidden;
  background: #ffffff;
  border-left: 0;
  box-shadow: none;
  transition: width 0.2s ease;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100vh;
  max-height: 100vh;
  z-index: 25;
  flex-shrink: 0;
  display: flex;
  isolation: isolate;
}
body.assistant-open .assistant-drawer {
  width: var(--assistant-width);
  overflow: hidden;
  background: #ffffff;
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 28px rgba(15, 23, 42, 0.14);
}
body.assistant-resizing,
body.assistant-resizing * {
  cursor: ew-resize !important;
  user-select: none !important;
}
body.assistant-resizing .assistant-drawer,
body.assistant-resizing .assistant-toggle {
  transition: none;
}
.assistant-drawer-body {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 16px;
  background: #ffffff;
}
.assistant-resize {
  display: none;
}
body.assistant-open .assistant-resize {
  display: block;
  flex: 0 0 8px;
  width: 8px;
  cursor: ew-resize;
  touch-action: none;
  position: relative;
  z-index: 2;
  background: transparent;
}
.assistant-resize::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 2px;
  height: 40px;
  margin-top: -20px;
  border-radius: 2px;
  background: var(--border);
}
.assistant-resize:hover::after,
.assistant-resize:focus-visible::after,
body.assistant-resizing .assistant-resize::after {
  background: var(--accent);
}
.assistant-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.assistant-last,
.assistant-progress {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
  margin: 8px 0 12px;
  line-height: 1.4;
}
.assistant-last { margin-bottom: 0; }
.assistant-progress-email {
  margin-top: 2px;
}
.assistant-close, .assistant-toggle {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
}
.assistant-close {
  background: var(--bg-page);
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 12px;
}
.assistant-toggle {
  position: fixed;
  right: 20px;
  bottom: 22px;
  top: auto;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  writing-mode: horizontal-tb;
  transform: none;
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
  border: 2px solid transparent;
  transition: right 0.2s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.assistant-toggle:hover {
  background: var(--accent-hover);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.42);
  transform: translateY(-1px);
}
.assistant-toggle:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 3px;
}
body.assistant-open .assistant-toggle {
  right: calc(var(--assistant-width) + 16px);
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
body.assistant-open .assistant-toggle:hover {
  background: var(--selected-bg);
}
.version-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: calc(100% - 32px);
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.version-banner[hidden] { display: none; }
.version-banner p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.version-banner button {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.hero {
  background: var(--hero);
  color: #fff;
  padding: 18px 28px 22px;
  border-bottom-right-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.03em;
}
.dash-title {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.dash-version {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.62);
}
.dash-commit {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}
.btn-load-data {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.btn-load-data:hover { background: rgba(255, 255, 255, 0.26); }
.btn-load-data:disabled {
  opacity: 0.6;
  cursor: wait;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.hero-actions form { margin: 0; }
.login-main {
  display: flex;
  justify-content: center;
  padding: 48px 24px 32px;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
  display: grid;
  gap: 14px;
}
.login-card h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.login-card label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.login-card input {
  font: inherit;
  font-weight: 500;
  color: var(--text-primary);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.login-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.login-error {
  display: none;
  margin: 0;
  color: var(--error);
  font-size: 13px;
  font-weight: 600;
}
html[data-err="1"] .login-error[data-err="1"],
html[data-err="locked"] .login-error[data-err="locked"] {
  display: block;
}
/* The margin reset above beats the browser's dialog centering, and an
   explicit width then sticks the box to the top left. */
dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  overflow: auto;
}
.load-data-dialog {
  width: min(420px, 94vw);
  border: 0;
  border-radius: var(--radius-card);
  padding: 16px 18px 18px;
  box-shadow: var(--shadow);
}
.load-data-dialog::backdrop { background: rgba(15, 23, 42, 0.35); }
.heures-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
}
.heures-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--chip-bg, #f1f5f9);
  border-radius: 10px;
  font-size: 13px;
}
.heures-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.heures-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.heures-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--accent-deep);
  cursor: pointer;
  text-decoration: none;
}
.heures-btn:hover { background: var(--selected-bg); }
.heures-btn-danger { color: #b91c1c; }
.heures-btn-danger:hover { background: #fef2f2; }
.heures-drop {
  display: grid;
  place-items: center;
  min-height: 96px;
  padding: 16px;
  border: 1.5px dashed var(--border);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.heures-drop.on {
  border-color: var(--accent);
  background: #eff6ff;
  color: var(--accent);
}
.load-data-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 8px;
}
.cal-nav-btn {
  font: inherit;
  font-size: 20px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--bg-page);
  color: var(--accent);
  cursor: pointer;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}
.cal-dow {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 0;
}
.cal-day {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 8px 0;
  background: transparent;
  color: var(--text-primary);
}
.cal-day.ok { background: #fff; cursor: pointer; box-shadow: inset 0 0 0 1px var(--border); }
.cal-day.ok:hover { background: var(--selected-bg); }
.cal-day.loaded { background: #bfdbfe; color: var(--accent-deep); cursor: pointer; }
.cal-day.loaded:hover { background: #93c5fd; }
.cal-day.sel { background: var(--accent); color: #fff; cursor: pointer; }
.cal-day.off { color: var(--text-tertiary); }
.load-token { display: grid; gap: 6px; margin: 8px 0; }
.load-token[hidden] { display: none; }
.load-token label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.load-token input {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.load-data-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.dash { background: transparent; border: 0; font-size: 13px; max-width: 1400px; }
.dash-top {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 0 14px;
  background: transparent;
  border: 0;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter {
  font-size: 13px;
  color: var(--text-secondary);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.filter b { color: var(--text-primary); font-weight: 600; }
.filter select, .filter input[type="date"] {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: 0;
  padding: 0 16px 0 0;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%2364748b' d='M1.2 1.2 6 6l4.8-4.8'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0 center;
  cursor: pointer;
}
.filter input[type="date"] {
  background-image: none;
  padding-right: 0;
  font-variant-numeric: tabular-nums;
}
.filter-dates { position: relative; }
.dates-range-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.dates-cal {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: 292px;
  padding: 10px 12px 12px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.cal-day.in-range { background: var(--selected-bg); color: var(--text-primary); cursor: pointer; }
.cal-day.ok.in-range:hover { background: #dbe7ff; }
.dates-cal .cal-day.sel { background: var(--accent); color: #fff; }
.dates-cal .cal-day:disabled {
  cursor: default;
  opacity: 0.45;
}
.dates-cal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.dates-cal-actions .btn-primary {
  padding: 6px 14px;
}
.filter-dates-hint {
  margin: 8px 0 6px;
  padding: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
}
.dates-clear {
  margin: 0;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--bg-page);
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.dates-clear:hover:not(:disabled) {
  background: var(--selected-bg);
  color: var(--accent);
}
.dates-clear:disabled {
  opacity: 0.35;
  cursor: default;
}
.filter input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}
.filter-multi { position: relative; }
.multi-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0 16px 0 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%2364748b' d='M1.2 1.2 6 6l4.8-4.8'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0 center;
}
.multi-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 180px;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
}
.multi-all {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--bg-page);
  color: var(--accent);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  margin-bottom: 6px;
}
.multi-opts label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}
.tabs {
  display: flex;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 0 0 16px;
  overflow-x: auto;
}
.tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}
.tab:hover { background: #fff; color: var(--text-primary); }
.tab.on {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}
.body { padding: 0; }
.cols3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .cols3, .cols2 { grid-template-columns: 1fr; } }
.panel {
  background: var(--bg-secondary);
  border: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.panel h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 16px 18px 4px;
  border-bottom: 0;
  margin: 0;
}
table.mini {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
table.mini th {
  text-align: left;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-secondary);
  font-weight: 600;
  padding: 10px 16px 10px;
  border-bottom: 1px solid #eef1fb;
  background: #f7f8fd;
}
table.mini th:first-child { padding-left: 18px; }
table.mini th:last-child { padding-right: 18px; }
table.mini td {
  padding: 11px 16px;
  border-bottom: 1px solid #eef1fb;
  vertical-align: middle;
  color: var(--text-primary);
}
table.mini td:first-child { padding-left: 18px; }
table.mini td:last-child { padding-right: 18px; }
table.mini tbody tr:last-child td { border-bottom: none; }
table.mini tbody tr:hover td { background: #f8faff; }
table.mini tr.sel td { background: var(--selected-bg); }
table.mini tr.hot td {
  background: transparent;
  box-shadow: inset 3px 0 0 var(--accent);
}
table.mini tr.hot:hover td { background: #f8faff; }
table.mini td.ok,
table.mini td.bad,
table.mini td.warn {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}
.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: var(--bg-page);
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 700;
}
tr.hot .rank {
  background: var(--accent);
  color: #fff;
}
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi-row.k3 { grid-template-columns: repeat(3, 1fr); }
.kpi-row.k6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1400px) { .kpi-row.k6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .kpi-row, .kpi-row.k3, .kpi-row.k6 { grid-template-columns: 1fr 1fr; } }
.kpi {
  background: var(--bg-secondary);
  border: 0;
  border-radius: var(--radius-card);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  min-height: 92px;
}
.kpi .k {
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-secondary);
  font-weight: 600;
}
.kpi .k.long { text-transform: none; letter-spacing: 0; line-height: 1.3; min-height: 2.4em; font-size: 12px; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -0.04em; margin-top: 6px; }
.kpi-tone-white { background: #fff; color: var(--text-primary); }
.kpi-tone-blue { background: var(--accent); color: #fff; }
.kpi-tone-light { background: #93c5fd; color: var(--accent-deep); }
.kpi-tone-navy { background: var(--accent-deep); color: #fff; }
.kpi-tone-teal { background: var(--success); color: #fff; }
.kpi-tone-amber { background: var(--warning); color: #fff; }
.kpi-tone-purple { background: var(--purple); color: #fff; }
.kpi-tone-blue .k,
.kpi-tone-navy .k,
.kpi-tone-teal .k,
.kpi-tone-amber .k,
.kpi-tone-purple .k { color: rgba(255, 255, 255, 0.82); }
.kpi-tone-light .k { color: var(--accent-deep); opacity: 0.75; }
.kpi-tone-blue .muted,
.kpi-tone-navy .muted,
.kpi-tone-teal .muted,
.kpi-tone-amber .muted,
.kpi-tone-purple .muted { color: rgba(255, 255, 255, 0.78); }
.kpi-tone-light .muted { color: var(--accent-deep); opacity: 0.75; }
.ok { color: var(--success); }
.bad { color: var(--error); }
.warn { color: var(--warning); }
.kpi-tone-blue .ok, .kpi-tone-blue .bad, .kpi-tone-blue .warn,
.kpi-tone-light .ok, .kpi-tone-light .bad, .kpi-tone-light .warn,
.kpi-tone-navy .ok, .kpi-tone-navy .bad, .kpi-tone-navy .warn,
.kpi-tone-teal .ok, .kpi-tone-teal .bad, .kpi-tone-teal .warn,
.kpi-tone-amber .ok, .kpi-tone-amber .bad, .kpi-tone-amber .warn,
.kpi-tone-purple .ok, .kpi-tone-purple .bad, .kpi-tone-purple .warn { color: inherit; }
.muted { color: var(--text-tertiary); font-size: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 4px; }
.dot.g { background: var(--success); }
.dot.n { background: #dc2626; }
.dot.c { background: var(--warning); }
.dot.r { background: #dc2626; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 8px; border-radius: 99px; font-weight: 600; }
.chip.g { background: color-mix(in srgb, var(--success) 16%, #fff); color: #047857; }
.chip.r { background: color-mix(in srgb, var(--error) 14%, #fff); color: #be185d; }
.chip.a { background: color-mix(in srgb, var(--warning) 18%, #fff); color: #b45309; }
.chip.n { background: var(--bg-tertiary); color: var(--text-secondary); }
.trip {
  border: 0;
  border-radius: var(--radius-card);
  padding: 16px 18px;
  margin-top: 12px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow);
}
.trip-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.course-pie {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 6px #fff, 0 0 0 3px #e2e8f4;
}
.course-pie-alert {
  box-shadow: inset 0 0 0 6px #fff, 0 0 0 3px #dc2626;
}
.trip-id { font-weight: 700; }
.trip-od { font-weight: 600; }
.trip-run { --bead-w: 82px; display: flex; flex-direction: column; width: max-content; max-width: 100%; overflow-x: auto; }
.beads { display: flex; gap: 0; flex-wrap: nowrap; padding-bottom: 6px; }
.bead { width: var(--bead-w); min-width: var(--bead-w); flex-shrink: 0; text-align: center; padding: 0; }
.bead .name { font-weight: 600; font-size: 10px; white-space: nowrap; }
.bead .t { font-variant-numeric: tabular-nums; font-size: 10px; color: var(--text-secondary); }
.bead .e { font-variant-numeric: tabular-nums; font-size: 10px; }
.bead .delta { font-variant-numeric: tabular-nums; font-size: 10px; font-weight: 650; min-height: 15px; }
.bead .mark {
  width: 100%;
  height: 16px;
  border-radius: 0;
  margin: 4px 0 2px;
  border: 0;
  border-right: 1px solid #fff;
  background: transparent;
  box-sizing: border-box;
}
.bead:first-child .mark { border-radius: 4px 0 0 4px; }
.bead:last-child .mark { border-right: 0; border-radius: 0 4px 4px 0; }
.bead:only-child .mark { border-radius: 4px; }
.bead.g .mark { background: var(--success); }
.bead.r .mark { background: #dc2626; }
.bead.c .mark { background: var(--warning); }
.bead.c .e { color: #b45309; font-weight: 700; white-space: nowrap; }
.bead .mark.radio { height: 10px; margin-top: 2px; }
.bead .mark.radio.g { background: var(--success); }
.bead .mark.radio.r { background: #dc2626; }
.bead .radio-lab {
  font-size: 9px;
  font-weight: 600;
  color: #dc2626;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.2;
  margin-top: 2px;
  min-height: 11px;
}
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; color: var(--text-secondary); margin-top: 8px; }
.swatch { display: inline-block; width: 16px; height: 4px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.swatch.planned { height: 6px; background: #94a3b8; opacity: 0.55; }
.swatch.missed { height: 5px; background: #f59e0b; opacity: 0.85; }
.swatch.on { background: #10b981; }
.swatch.off { background: #dc2626; }
.pin { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 4px; vertical-align: middle; }
.pin.start { background: #1e293b; }
.pin.end { background: #fff; box-shadow: inset 0 0 0 1.5px #1e293b; }
.coverage-legend { flex-direction: column; align-items: stretch; gap: 6px; background: var(--bg-secondary); border-radius: var(--radius-card); padding: 12px 16px; box-shadow: var(--shadow); margin: 0 0 4px; }
.legend-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.legend-row > b { min-width: 48px; color: var(--text-primary); font-weight: 650; }
.trip-visuals { display: flex; align-items: center; gap: 12px; }
.route-thumb-btn {
  display: block;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: zoom-in;
  line-height: 0;
}
.route-thumb-btn:hover,
.route-thumb-btn:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}
.route-thumb {
  display: block;
  width: 180px;
  height: 120px;
  border-radius: 10px;
  background: var(--bg-primary);
}
.route-preview {
  width: min(960px, 96vw);
  max-height: 94vh;
  border: 0;
  border-radius: var(--radius-card);
  padding: 12px 14px 14px;
  box-shadow: var(--shadow);
}
.route-preview::backdrop { background: rgba(15, 23, 42, 0.45); }
.route-preview img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(94vh - 64px);
  object-fit: contain;
  background: var(--bg-primary);
  border-radius: 10px;
}
.archive-dialog { width: min(480px, 94vw); }
.archive-dialog .load-data-actions { margin-bottom: 12px; }
.archive-range {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
}
.archive-range label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 650;
}
.archive-range input {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 10px;
}
.skel {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, #fff 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.2s ease-in-out infinite;
}
.skel-chip, .skel-line, .skel-kpi { display: inline-block; vertical-align: middle; }
.skel-chip { width: 88px; height: 18px; border-radius: 99px; }
.skel-chip.wide { width: 148px; }
.skel-line { width: 160px; height: 12px; border-radius: 6px; }
.skel-kpi { width: 84px; height: 28px; border-radius: 8px; }
.route-thumb.skel { background: linear-gradient(90deg, var(--bg-tertiary) 25%, #fff 50%, var(--bg-tertiary) 75%); background-size: 200% 100%; }
.leg.skel { background: var(--bg-tertiary); color: transparent; }
@keyframes skel-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skel, .route-thumb.skel { animation: none; }
}
.route-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.legs { display: flex; padding-left: calc(var(--bead-w) / 2); margin-top: 2px; }
.leg {
  width: var(--bead-w);
  min-width: var(--bead-w);
  flex-shrink: 0;
  height: 16px;
  font-size: 9px;
  font-weight: 650;
  line-height: 16px;
  text-align: center;
  color: #fff;
  font-variant-numeric: tabular-nums;
  border-right: 1px solid #fff;
}
.leg:first-child { border-radius: 4px 0 0 4px; }
.leg:last-child { border-right: 0; border-radius: 0 4px 4px 0; }
.leg:only-child { border-radius: 4px; }
.leg.g { background: var(--success); }
.leg.a { background: var(--warning); }
.leg.r { background: #dc2626; }
.leg.n { background: var(--bg-tertiary); color: var(--text-secondary); }
.heatwrap {
  background: #ececec;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
}
.heatwrap img { width: min(100%, 820px); display: block; }
.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  margin: 8px 0 10px;
  color: var(--text-secondary);
}
.course-cell { line-height: 1.25; }
.course-cell .id { font-variant-numeric: tabular-nums; }
.course-cell .od { color: var(--text-secondary); font-size: 11px; }
.coverage-sort-row { margin: 4px 0 2px; }
.att-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 12px;
}
.att-sort-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 4px;
}
.att-sort-btn {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  border: 0;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--text-secondary);
}
.att-sort-btn.on {
  color: var(--accent-deep);
  background: var(--selected-bg);
}
.pie-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: center;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 18px;
}
@media (max-width: 700px) { .pie-wrap { grid-template-columns: 1fr; } }
.pie-chart {
  position: relative;
  width: 200px;
  height: 200px;
}
.pie {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 0;
  box-shadow: 0 0 0 3px #e2e8f4;
}
.pie-center {
  position: absolute;
  inset: 27%;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 0 0 1px #e2e8f4;
}
.pie-total {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.pie-total-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th-sort:hover { color: var(--text-primary); }
.sort-ind {
  display: inline-block;
  min-width: 0.9em;
  margin-left: 4px;
  color: var(--accent);
  font-size: 11px;
}
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.table-hscroll {
  overflow-x: auto;
  max-width: 100%;
}
.table-hscroll table.mini {
  width: max-content;
  min-width: 100%;
}
.table-hscroll th,
.table-hscroll td {
  white-space: nowrap;
}
.scroll-table { max-height: 280px; overflow-y: auto; }
.pds-all { margin-top: 28px; }
.pds-all-table { max-height: 420px; }
.scroll-table thead th {
  position: sticky;
  top: 0;
  background: #f7f8fd;
  z-index: 1;
}
.pie-wrap table.mini th { background: transparent; padding-top: 0; }
.pie-wrap table.mini td { padding-top: 10px; padding-bottom: 10px; }
.assistant { display: grid; gap: 12px; }
.assistant-q {
  width: 100%;
  min-height: 88px;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: #fff;
  color: var(--text-primary);
  resize: vertical;
  box-shadow: var(--shadow);
  outline: none;
}
.assistant-q:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
.btn-primary {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 0;
  background: var(--accent-deep);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(30, 58, 138, 0.28);
}
.btn-primary:hover { background: #152e75; }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}
.btn-primary:disabled:hover { background: var(--accent-deep); }
.btn-secondary {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--accent-deep);
  cursor: pointer;
}
.btn-secondary:hover { background: var(--selected-bg); }
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
.assistant-answer {
  padding: 14px 16px;
  white-space: pre-wrap;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
}
.btn-detail {
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-page);
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-detail:hover { background: var(--selected-bg); }
.alarm-detail-dialog {
  width: min(720px, 92vw);
  max-height: 80vh;
  border: 0;
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--shadow);
}
.alarm-detail-dialog::backdrop {
  background: rgba(15, 23, 42, 0.35);
}
.alarm-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.sim-jump { margin-left: 8px; vertical-align: middle; display: inline-block; text-decoration: none; }
.alarm-id-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.alarm-id-link:hover { color: var(--accent-deep); }
.alarm-json {
  margin: 0;
  padding: 12px 14px;
  background: #f8fafc;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  overflow: auto;
  max-height: 60vh;
  white-space: pre;
}
.att-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.att-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.att-list { display: grid; gap: 10px; }
.att-row {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
  border-left: 4px solid var(--accent);
}
.att-row[data-kind="avance"] { border-left-color: var(--warning); }
.att-row[data-kind="miss"] { border-left-color: var(--error); }
.att-row[data-kind="trunc"] { border-left-color: #f97316; }
.att-row[data-kind="cancel"] { border-left-color: var(--warning); }
.att-row[data-kind="dev"] { border-left-color: var(--purple); }
.att-row[data-kind="radio"] { border-left-color: var(--accent-deep); }
.att-main {
  width: 100%;
  text-align: left;
  font: inherit;
  background: transparent;
  border: 0;
  padding: 14px 18px 12px;
  cursor: pointer;
  color: inherit;
}
.att-row.open .att-main { background: #f8faff; }
.att-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.att-gap {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  margin-left: auto;
}
.chip.avance { background: color-mix(in srgb, var(--warning) 18%, #fff); color: #b45309; }
.chip.miss { background: color-mix(in srgb, var(--error) 14%, #fff); color: #be185d; }
.chip.trunc { background: #ffedd5; color: #c2410c; }
.chip.cancel { background: color-mix(in srgb, var(--warning) 18%, #fff); color: #b45309; }
.chip.dev { background: color-mix(in srgb, var(--purple) 16%, #fff); color: #6d28d9; }
.chip.radio { background: #dbeafe; color: #1e3a8a; }
.chip.pattern { background: var(--bg-page); color: var(--text-secondary); }
.att-why { font-size: 13px; margin: 4px 0 2px; }
.att-detail {
  display: none;
  padding: 0 18px 16px;
  border-top: 1px solid #eef1fb;
  min-width: 0;
  max-width: 100%;
}
.att-row.open .att-detail { display: block; }
.att-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.att-row .trip { box-shadow: none; padding: 12px 0 0; margin-top: 0; min-width: 0; max-width: 100%; }
.att-row .trip-run,
.rec-row .trip-run {
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
}
.rec-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: start;
  padding: 14px 18px;
  min-width: 0;
}
.rec-row + .rec-row { border-top: 1px solid #eef1fb; }
.rec-visual {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}
.rec-example { min-width: 0; max-width: 100%; }
.rec-example .trip { padding-top: 6px; }
.rec-row .trip {
  box-shadow: none;
  padding: 8px 0 0;
  margin-top: 0;
  background: transparent;
}
.bead.hl .name { text-decoration: underline; }
.bead.hl .mark { box-shadow: 0 0 0 3px #fda4af; }
.rec-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-deep);
  white-space: nowrap;
}
.att-smart {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.att-smart-panel {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
  margin: 0 0 16px;
}
.att-smart-panel[hidden] { display: none; }
.att-smart-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.att-smart-panel .assistant-answer { box-shadow: none; padding: 0; }
@media (max-width: 700px) {
  .rec-row { grid-template-columns: minmax(0, 1fr); }
  .att-gap { margin-left: 0; }
}

/* Ctrl+P omits backgrounds unless this is exact, which drops the F1 bars,
   chips, stop marks and the fill of the course pies (only their ring remains). */
@media print {
  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .skel, .route-thumb.skel { animation: none; }
}
