/**
 * Reporte Ralentí — estilos autocontenidos (referencia: Ejemplo_reporte.html).
 */
@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Sora:wght@300;400;500;600;700&display=swap");

#mtr-ralenti-app,
#mtr-ralenti-demo-app {
  --mtr-bg: #0b0e14;
  --surface: #121620;
  --surface2: #1a2030;
  --border: #232d42;
  --accent: #e8a020;
  --accent2: #4ea8f0;
  --accent3: #3ecf8e;
  --text: #e2e8f4;
  --text-muted: #6b7a99;
  --text-dim: #3d4f6e;
  --danger: #f06060;

  position: relative;
  box-sizing: border-box;
  font-family: "Sora", sans-serif;
  color: var(--text);
  background: var(--mtr-bg);
  padding: 28px 32px 40px;
  border-radius: 8px;
  overflow: hidden;
  color-scheme: dark;
}

#mtr-ralenti-app::before,
#mtr-ralenti-demo-app::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

#mtr-ralenti-app > *,
#mtr-ralenti-demo-app > * {
  position: relative;
  z-index: 1;
}

#mtr-ralenti-app .mtr-demo-hero,
#mtr-ralenti-demo-app .mtr-demo-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

#mtr-ralenti-app .mtr-demo-hero h1,
#mtr-ralenti-demo-app .mtr-demo-hero h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

#mtr-ralenti-app .mtr-demo-hero p,
#mtr-ralenti-demo-app .mtr-demo-hero p {
  margin: 0;
  max-width: 56ch;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-muted);
}

#mtr-ralenti-app .mtr-demo-hero p code,
#mtr-ralenti-demo-app .mtr-demo-hero p code {
  font-family: "DM Mono", monospace;
  font-size: 0.75em;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
}

#mtr-ralenti-app .mtr-demo-pill,
#mtr-ralenti-demo-app .mtr-demo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 4px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(232, 160, 32, 0.1);
  border: 1px solid rgba(232, 160, 32, 0.28);
}

#mtr-ralenti-app .mtr-demo-pill::before,
#mtr-ralenti-demo-app .mtr-demo-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

#mtr-ralenti-app .mtr-demo-filters,
#mtr-ralenti-demo-app .mtr-demo-filters {
  margin: 0 0 28px;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(18, 22, 32, 0.85) 0%, transparent 100%);
}

#mtr-ralenti-app .mtr-demo-filters-title,
#mtr-ralenti-demo-app .mtr-demo-filters-title {
  margin-bottom: 14px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

#mtr-ralenti-app .mtr-demo-filters-grid,
#mtr-ralenti-demo-app .mtr-demo-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 14px;
  align-items: end;
}

#mtr-ralenti-app .mtr-df-field,
#mtr-ralenti-demo-app .mtr-df-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#mtr-ralenti-app .mtr-df-field > span,
#mtr-ralenti-demo-app .mtr-df-field > span {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

#mtr-ralenti-app .mtr-df-field select,
#mtr-ralenti-app .mtr-df-field input[type="datetime-local"],
#mtr-ralenti-app .mtr-df-field input[type="number"],
#mtr-ralenti-demo-app .mtr-df-field select,
#mtr-ralenti-demo-app .mtr-df-field input[type="datetime-local"],
#mtr-ralenti-demo-app .mtr-df-field input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background-color: var(--surface2);
  color: var(--text);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  line-height: 1.3;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

#mtr-ralenti-app .mtr-df-field select,
#mtr-ralenti-demo-app .mtr-df-field select {
  padding-right: 30px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'%3E%3Cpath d='M1 1.5L7 7.5L13 1.5' stroke='%236b7a99' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 6px;
}

#mtr-ralenti-app .mtr-df-field select:focus,
#mtr-ralenti-app .mtr-df-field input:focus,
#mtr-ralenti-demo-app .mtr-df-field select:focus,
#mtr-ralenti-demo-app .mtr-df-field input:focus {
  outline: none;
  border-color: var(--accent);
}

#mtr-ralenti-app .mtr-df-actions,
#mtr-ralenti-demo-app .mtr-df-actions {
  display: flex;
  align-items: flex-end;
}

#mtr-ralenti-app .mtr-df-btn,
#mtr-ralenti-demo-app .mtr-df-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--text);
  color: var(--mtr-bg);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

#mtr-ralenti-app .mtr-df-btn:hover,
#mtr-ralenti-demo-app .mtr-df-btn:hover {
  background: #fff;
  border-color: var(--accent);
}

#mtr-ralenti-app .mtr-demo-filters-hint,
#mtr-ralenti-demo-app .mtr-demo-filters-hint {
  margin-top: 12px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.5;
}

#mtr-ralenti-app .mtr-kpi-strip,
#mtr-ralenti-demo-app .mtr-kpi-strip {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
}

#mtr-ralenti-app .mtr-cols-4,
#mtr-ralenti-demo-app .mtr-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

#mtr-ralenti-app .mtr-kpi-card,
#mtr-ralenti-demo-app .mtr-kpi-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
}

#mtr-ralenti-app .mtr-kpi-card::before,
#mtr-ralenti-demo-app .mtr-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

#mtr-ralenti-app .mtr-accent-orange::before,
#mtr-ralenti-demo-app .mtr-accent-orange::before {
  background: var(--accent);
}

#mtr-ralenti-app .mtr-accent-red::before,
#mtr-ralenti-demo-app .mtr-accent-red::before {
  background: var(--danger);
}

#mtr-ralenti-app .mtr-kpi-label,
#mtr-ralenti-demo-app .mtr-kpi-label {
  margin-bottom: 8px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#mtr-ralenti-app .mtr-kpi-value,
#mtr-ralenti-demo-app .mtr-kpi-value {
  font-family: "Sora", sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 4px;
  color: var(--text);
}

#mtr-ralenti-app .mtr-kpi-plate,
#mtr-ralenti-demo-app .mtr-kpi-plate {
  font-size: 20px;
}

#mtr-ralenti-app .mtr-kpi-unit,
#mtr-ralenti-demo-app .mtr-kpi-unit {
  font-size: 16px;
  color: var(--text-muted);
}

#mtr-ralenti-app .mtr-kpi-sub,
#mtr-ralenti-demo-app .mtr-kpi-sub,
#mtr-ralenti-app .mtr-muted,
#mtr-ralenti-demo-app .mtr-muted {
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
}

#mtr-ralenti-app .mtr-kpi-card .mtr-kpi-value + .mtr-kpi-sub,
#mtr-ralenti-demo-app .mtr-kpi-card .mtr-kpi-value + .mtr-kpi-sub {
  margin-top: 6px;
}

#mtr-ralenti-app .mtr-kpi-crit,
#mtr-ralenti-demo-app .mtr-kpi-crit {
  margin-top: 6px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-dim);
  max-width: 30ch;
}

#mtr-ralenti-app .mtr-kpi-trend,
#mtr-ralenti-demo-app .mtr-kpi-trend {
  margin-top: 6px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

#mtr-ralenti-app .mtr-trend-up,
#mtr-ralenti-demo-app .mtr-trend-up {
  color: var(--danger);
}

#mtr-ralenti-app .mtr-trend-down,
#mtr-ralenti-demo-app .mtr-trend-down {
  color: var(--accent3);
}

#mtr-ralenti-app .mtr-dual-grid,
#mtr-ralenti-demo-app .mtr-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

#mtr-ralenti-app .mtr-chart-card,
#mtr-ralenti-demo-app .mtr-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
}

#mtr-ralenti-app .mtr-chart-title,
#mtr-ralenti-demo-app .mtr-chart-title {
  margin-bottom: 18px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#mtr-ralenti-app .mtr-bar-row,
#mtr-ralenti-demo-app .mtr-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 11px;
  min-height: 24px;
}

#mtr-ralenti-app .mtr-bar-label,
#mtr-ralenti-demo-app .mtr-bar-label {
  width: 80px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
}

#mtr-ralenti-app .mtr-bar-track,
#mtr-ralenti-demo-app .mtr-bar-track {
  flex: 1;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

#mtr-ralenti-app .mtr-bar-fill,
#mtr-ralenti-demo-app .mtr-bar-fill {
  height: 100%;
  border-radius: 3px;
}

#mtr-ralenti-app .mtr-fill-red,
#mtr-ralenti-demo-app .mtr-fill-red {
  background: var(--danger);
}

#mtr-ralenti-app .mtr-fill-orange,
#mtr-ralenti-demo-app .mtr-fill-orange {
  background: var(--accent);
}

#mtr-ralenti-app .mtr-fill-dim,
#mtr-ralenti-demo-app .mtr-fill-dim {
  background: var(--text-dim);
}

#mtr-ralenti-app .mtr-bar-value,
#mtr-ralenti-demo-app .mtr-bar-value {
  width: 64px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  color: var(--text);
  text-align: right;
}

#mtr-ralenti-app .mtr-spark,
#mtr-ralenti-demo-app .mtr-spark {
  width: 100%;
  display: block;
  min-height: 200px;
}

#mtr-ralenti-app .mtr-spark-wrap,
#mtr-ralenti-demo-app .mtr-spark-wrap {
  position: relative;
  margin-top: 8px;
}

#mtr-ralenti-app .mtr-spark-tip,
#mtr-ralenti-demo-app .mtr-spark-tip {
  position: absolute;
  z-index: 5;
  max-width: 220px;
  padding: 10px 12px;
  font-family: "Sora", sans-serif;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

#mtr-ralenti-app .mtr-spark-tip strong,
#mtr-ralenti-demo-app .mtr-spark-tip strong {
  font-weight: 600;
  color: var(--accent);
}

#mtr-ralenti-app .mtr-spark-tip-sub,
#mtr-ralenti-demo-app .mtr-spark-tip-sub {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: var(--text-muted);
}

#mtr-ralenti-app .mtr-spark-axis,
#mtr-ralenti-demo-app .mtr-spark-axis {
  fill: var(--text-muted);
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

#mtr-ralenti-app .mtr-spark-axis-label,
#mtr-ralenti-demo-app .mtr-spark-axis-label {
  fill: var(--text-dim);
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Gráfico horas/día: layout reporte oficial (ralenti.js, viewBox 640×248) */
#mtr-ralenti-app .mtr-chart-card--spark {
  padding-bottom: 6px;
}

#mtr-ralenti-app .mtr-spark.mtr-spark-interactive {
  min-height: 240px;
  max-height: 340px;
}

#mtr-ralenti-app .mtr-spark-axis--ticks {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 500;
}

#mtr-ralenti-app .mtr-spark-axis-label--y {
  font-family: "Sora", sans-serif;
  font-size: 9px;
  letter-spacing: 0.1em;
}

#mtr-ralenti-app .mtr-spark-hit,
#mtr-ralenti-demo-app .mtr-spark-hit {
  fill: transparent;
  stroke: transparent;
  cursor: crosshair;
}

#mtr-ralenti-app .mtr-spark-hit:hover,
#mtr-ralenti-demo-app .mtr-spark-hit:hover,
#mtr-ralenti-app .mtr-spark-hit:focus,
#mtr-ralenti-demo-app .mtr-spark-hit:focus {
  fill: rgba(232, 160, 32, 0.15);
  stroke: rgba(232, 160, 32, 0.45);
  stroke-width: 1;
}

#mtr-ralenti-app .mtr-spark-empty,
#mtr-ralenti-demo-app .mtr-spark-empty {
  fill: var(--text-muted);
  font-family: "Sora", sans-serif;
  font-size: 13px;
}

#mtr-ralenti-app .mtr-kpi-desc,
#mtr-ralenti-demo-app .mtr-kpi-desc {
  margin-top: 10px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-dim);
  max-width: 24ch;
}

#mtr-ralenti-app .mtr-grid-line,
#mtr-ralenti-demo-app .mtr-grid-line {
  stroke: var(--border);
  stroke-width: 1;
}

#mtr-ralenti-app .mtr-spark-guide,
#mtr-ralenti-demo-app .mtr-spark-guide {
  stroke: color-mix(in srgb, var(--accent) 80%, #fff 20%);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.9;
}

#mtr-ralenti-app .mtr-area,
#mtr-ralenti-demo-app .mtr-area {
  fill: rgba(232, 160, 32, 0.2);
}

#mtr-ralenti-app .mtr-line,
#mtr-ralenti-demo-app .mtr-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

#mtr-ralenti-app .mtr-line-series,
#mtr-ralenti-demo-app .mtr-line-series {
  fill: none;
  stroke-width: 2;
}

#mtr-ralenti-app .mtr-chart-head,
#mtr-ralenti-demo-app .mtr-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

#mtr-ralenti-app .mtr-plate-chips,
#mtr-ralenti-demo-app .mtr-plate-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#mtr-ralenti-app .mtr-plate-chips--global,
#mtr-ralenti-demo-app .mtr-plate-chips--global {
  margin: 4px 0 14px;
}

#mtr-ralenti-app .mtr-plate-chip,
#mtr-ralenti-demo-app .mtr-plate-chip {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  border: 2px solid;
  background: transparent;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

#mtr-ralenti-app .mtr-plate-chip:hover,
#mtr-ralenti-demo-app .mtr-plate-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

#mtr-ralenti-app .mtr-plate-chip:focus,
#mtr-ralenti-demo-app .mtr-plate-chip:focus {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

#mtr-ralenti-app .mtr-plate-chip--active,
#mtr-ralenti-demo-app .mtr-plate-chip--active {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

#mtr-ralenti-app .mtr-plate-dd,
#mtr-ralenti-demo-app .mtr-plate-dd {
  position: relative;
  min-width: 160px;
}

#mtr-ralenti-app .mtr-plate-dd-btn,
#mtr-ralenti-demo-app .mtr-plate-dd-btn {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 10px;
  text-align: left;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  cursor: pointer;
}

#mtr-ralenti-app .mtr-plate-dd-menu,
#mtr-ralenti-demo-app .mtr-plate-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: 238px;
  overflow-y: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  z-index: 20;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 65%, #fff 35%) var(--surface2);
}

#mtr-ralenti-app .mtr-plate-dd-menu::-webkit-scrollbar,
#mtr-ralenti-demo-app .mtr-plate-dd-menu::-webkit-scrollbar { width: 6px; }

#mtr-ralenti-app .mtr-plate-dd-menu::-webkit-scrollbar-thumb,
#mtr-ralenti-demo-app .mtr-plate-dd-menu::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 65%, #fff 35%);
}

#mtr-ralenti-app .mtr-plate-dd-opt,
#mtr-ralenti-demo-app .mtr-plate-dd-opt {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(35, 45, 66, 0.45);
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  cursor: pointer;
}

#mtr-ralenti-app .mtr-plate-dd-opt:hover,
#mtr-ralenti-demo-app .mtr-plate-dd-opt:hover { background: rgba(255,255,255,0.03); }

#mtr-ralenti-app .mtr-plate-dd-opt.is-active,
#mtr-ralenti-demo-app .mtr-plate-dd-opt.is-active {
  color: var(--accent);
  background: rgba(232, 160, 32, 0.1);
}

#mtr-ralenti-app .mtr-section-title,
#mtr-ralenti-demo-app .mtr-section-title {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#mtr-ralenti-app .mtr-section-title::after,
#mtr-ralenti-demo-app .mtr-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

#mtr-ralenti-app .mtr-table-wrap,
#mtr-ralenti-demo-app .mtr-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 462px;
  margin-bottom: 24px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 70%, #ffffff 30%) var(--surface2);
}

#mtr-ralenti-app .mtr-table-wrap::-webkit-scrollbar,
#mtr-ralenti-demo-app .mtr-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#mtr-ralenti-app .mtr-table-wrap::-webkit-scrollbar-track,
#mtr-ralenti-demo-app .mtr-table-wrap::-webkit-scrollbar-track {
  background: var(--surface2);
}

#mtr-ralenti-app .mtr-table-wrap::-webkit-scrollbar-thumb,
#mtr-ralenti-demo-app .mtr-table-wrap::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 70%, #ffffff 30%);
  border-radius: 999px;
}

#mtr-ralenti-app .mtr-data-table,
#mtr-ralenti-demo-app .mtr-data-table {
  width: 100%;
  border-collapse: collapse;
}

#mtr-ralenti-app .mtr-data-table thead tr,
#mtr-ralenti-demo-app .mtr-data-table thead tr {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

#mtr-ralenti-app .mtr-data-table th,
#mtr-ralenti-demo-app .mtr-data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 16px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  background: var(--surface2);
  box-shadow: 0 1px 0 var(--border);
}

#mtr-ralenti-app .mtr-data-table td.mtr-ts,
#mtr-ralenti-demo-app .mtr-data-table td.mtr-ts {
  color: var(--text);
}

#mtr-ralenti-app .mtr-data-table td,
#mtr-ralenti-demo-app .mtr-data-table td {
  padding: 11px 16px;
  font-family: "DM Mono", monospace;
  font-size: 12.5px;
  color: var(--text);
  border-bottom: 1px solid rgba(35, 45, 66, 0.5);
  vertical-align: middle;
  text-align: center;
}

#mtr-ralenti-app .mtr-data-table tbody td,
#mtr-ralenti-demo-app .mtr-data-table tbody td {
  text-align: center !important;
}

#mtr-ralenti-app .mtr-data-table tbody tr:last-child td,
#mtr-ralenti-demo-app .mtr-data-table tbody tr:last-child td {
  border-bottom: none;
}

#mtr-ralenti-app .mtr-data-table tbody tr:hover td,
#mtr-ralenti-demo-app .mtr-data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

#mtr-ralenti-app .mtr-placa,
#mtr-ralenti-demo-app .mtr-placa {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 12px;
}

#mtr-ralenti-app .mtr-badge,
#mtr-ralenti-demo-app .mtr-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

#mtr-ralenti-app .mtr-badge-orange,
#mtr-ralenti-demo-app .mtr-badge-orange {
  background: rgba(232, 160, 32, 0.12);
  color: var(--accent);
  border: 1px solid rgba(232, 160, 32, 0.25);
}

#mtr-ralenti-app .mtr-badge-blue,
#mtr-ralenti-demo-app .mtr-badge-blue {
  background: rgba(78, 168, 240, 0.12);
  color: var(--accent2);
  border: 1px solid rgba(78, 168, 240, 0.25);
}

#mtr-ralenti-app .mtr-badge-red,
#mtr-ralenti-demo-app .mtr-badge-red {
  background: rgba(240, 96, 96, 0.12);
  color: var(--danger);
  border: 1px solid rgba(240, 96, 96, 0.25);
}

#mtr-ralenti-app .mtr-summary-row,
#mtr-ralenti-demo-app .mtr-summary-row {
  display: flex;
  gap: 1px;
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--border);
}

#mtr-ralenti-app .mtr-summary-cell,
#mtr-ralenti-demo-app .mtr-summary-cell {
  flex: 1;
  padding: 12px 16px;
  text-align: center;
  background: var(--surface2);
}

#mtr-ralenti-app .mtr-summary-label,
#mtr-ralenti-demo-app .mtr-summary-label {
  margin-bottom: 4px;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

#mtr-ralenti-app .mtr-summary-val,
#mtr-ralenti-demo-app .mtr-summary-val {
  font-family: "Sora", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) #mtr-ralenti-app,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app {
    --mtr-bg: #f4f6fa;
    --surface: #ffffff;
    --surface2: #eef1f7;
    --border: #d9e1ec;
    --text: #1a1f2e;
    --text-muted: #5c6578;
    --text-dim: #64748b;
    --danger: #dc2626;
    --accent: #d97706;
    --accent2: #2563eb;
    --accent3: #16a34a;
    color-scheme: light;
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app::before,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app::before {
    opacity: 0.35;
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-demo-filters,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-demo-filters {
    background: linear-gradient(180deg, rgba(238, 241, 247, 0.9) 0%, transparent 100%);
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-kpi-card,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-kpi-card,
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-chart-card,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-chart-card,
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-table-wrap,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-table-wrap {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-bar-track,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-bar-track {
    background: #e9eef5;
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-fill-dim,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-fill-dim {
    background: #94a3b8;
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-grid-line,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-grid-line {
    stroke: #dbe3ee;
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-area,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-area {
    fill: rgba(217, 119, 6, 0.16);
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-line,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-line {
    stroke: #d97706;
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-df-btn,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-df-btn {
    background: #1a1f2e;
    color: #fff;
    border-color: #1a1f2e;
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-badge-orange,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-badge-orange {
    background: #fff4e5;
    border-color: #f8d9a7;
    color: #b45309;
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-badge-blue,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-badge-blue {
    background: #eaf1ff;
    border-color: #bfd3ff;
    color: #1d4ed8;
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-badge-red,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-badge-red {
    background: #feecec;
    border-color: #fecaca;
    color: #b91c1c;
  }
  html:not([data-theme="dark"]) #mtr-ralenti-app .mtr-data-table td,
  html:not([data-theme="dark"]) #mtr-ralenti-demo-app .mtr-data-table td {
    border-bottom: 1px solid #e4ebf4;
  }
}

html[data-theme="light"] #mtr-ralenti-app,
html[data-theme="light"] #mtr-ralenti-demo-app,
body.light-theme #mtr-ralenti-app,
body.light-theme #mtr-ralenti-demo-app {
  --mtr-bg: #f4f6fa;
  --surface: #ffffff;
  --surface2: #eef1f7;
  --border: #d9e1ec;
  --text: #1a1f2e;
  --text-muted: #5c6578;
  --text-dim: #64748b;
  --danger: #dc2626;
  --accent: #d97706;
  --accent2: #2563eb;
  --accent3: #16a34a;
  color-scheme: light;
}

html[data-theme="light"] #mtr-ralenti-app::before,
html[data-theme="light"] #mtr-ralenti-demo-app::before,
body.light-theme #mtr-ralenti-app::before,
body.light-theme #mtr-ralenti-demo-app::before {
  opacity: 0.35;
}

html[data-theme="light"] #mtr-ralenti-app .mtr-demo-filters,
html[data-theme="light"] #mtr-ralenti-demo-app .mtr-demo-filters,
body.light-theme #mtr-ralenti-app .mtr-demo-filters,
body.light-theme #mtr-ralenti-demo-app .mtr-demo-filters {
  background: linear-gradient(180deg, rgba(238, 241, 247, 0.9) 0%, transparent 100%);
}

html[data-theme="light"] #mtr-ralenti-app .mtr-df-btn,
html[data-theme="light"] #mtr-ralenti-demo-app .mtr-df-btn,
body.light-theme #mtr-ralenti-app .mtr-df-btn,
body.light-theme #mtr-ralenti-demo-app .mtr-df-btn {
  background: #1a1f2e;
  color: #fff;
  border-color: #1a1f2e;
}

html[data-theme="light"] #mtr-ralenti-app .mtr-bar-track,
html[data-theme="light"] #mtr-ralenti-demo-app .mtr-bar-track,
body.light-theme #mtr-ralenti-app .mtr-bar-track,
body.light-theme #mtr-ralenti-demo-app .mtr-bar-track {
  background: #e9eef5;
}

html[data-theme="light"] #mtr-ralenti-app .mtr-data-table td,
html[data-theme="light"] #mtr-ralenti-demo-app .mtr-data-table td,
body.light-theme #mtr-ralenti-app .mtr-data-table td,
body.light-theme #mtr-ralenti-demo-app .mtr-data-table td {
  border-bottom: 1px solid #e4ebf4;
}
