/* Transyt-T8S Web - Corporate Engineering Design System
   Desarrollado por SCHUBIGER.CL (https://schubiger.cl)
   Dual Theme: Light Theme (Default) & Dark Theme */

/* ========================================================
   1. COLOR TOKENS & VARIABLES (SCHUBIGER BRAND PALETTE)
   ======================================================== */
:root {
  /* Schubiger Brand Colors extracted from Logo */
  --schubiger-cyan: #00b4d8;
  --schubiger-cyan-light: #90e0ef;
  --schubiger-blue: #0284c7;
  --schubiger-blue-deep: #0077b6;
  --schubiger-navy: #003566;
  --schubiger-dark: #001d3d;

  /* Level of Service / Status Colors */
  --status-green: #10b981;
  --status-yellow: #f59e0b;
  --status-red: #ef4444;
  --status-purple: #8b5cf6;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Radii & Layout */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* ========================================================
     DEFAULT: LIGHT THEME (Clean Corporate White / Slate)
     ======================================================== */
  --bg-app: #f8fafc;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --bg-card-sub: #f1f5f9;
  --bg-input: #ffffff;
  --bg-editor: #f8fafc;
  --bg-pre: #0f172a;
  --text-pre: #38bdf8;
  
  --border-main: #e2e8f0;
  --border-light: #cbd5e1;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-inverse: #ffffff;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-elevated: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-tint: #f0f9ff;
  --accent-border: #bae6fd;
}

/* ========================================================
   DARK THEME (Toggleable)
   ======================================================== */
body.theme-dark {
  --bg-app: #090e17;
  --bg-header: #0f172a;
  --bg-card: #131c2e;
  --bg-card-sub: #18243b;
  --bg-input: #0b1120;
  --bg-editor: #060a14;
  --bg-pre: #040711;
  --text-pre: #38bdf8;

  --border-main: #24344d;
  --border-light: #334460;
  --border-focus: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #0f172a;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 4px 12px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.7);

  --accent-primary: #0284c7;
  --accent-primary-hover: #0369a1;
  --accent-tint: rgba(2, 132, 199, 0.12);
  --accent-border: #0369a1;
}

/* ========================================================
   GLOBAL RESETS & BASE TYPOGRAPHY
   ======================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ========================================================
   CORPORATE HEADER & SCHUBIGER LOGO
   ======================================================== */
.corp-header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-main);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-subtle);
  transition: background-color 0.2s, border-color 0.2s;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.schubiger-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 119, 182, 0.3));
  transition: transform 0.2s ease;
}

.schubiger-logo-img:hover {
  transform: scale(1.05);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-main);
}

.brand-name .highlight {
  color: var(--schubiger-blue);
}

.version-badge {
  font-size: 9.5px;
  font-weight: 700;
  background-color: var(--accent-tint);
  color: var(--accent-primary);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--accent-border);
  letter-spacing: 0.3px;
}

.brand-byline {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-byline .sep {
  opacity: 0.4;
}

.schubiger-link {
  color: var(--schubiger-blue);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s;
}

.schubiger-link:hover {
  color: var(--schubiger-cyan);
  text-decoration: underline;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.test-data-selector {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.compact-select {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  max-width: 280px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.compact-select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--accent-tint);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Theme Toggle Button */
.btn-theme-toggle {
  background: var(--bg-card-sub);
  border: 1px solid var(--border-main);
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-theme-toggle:hover {
  background-color: var(--border-main);
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 9999px;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-main);
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-green);
}

.status-busy .dot {
  background-color: var(--status-yellow);
  animation: pulseDot 0.8s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  font-family: inherit;
  text-decoration: none;
}

.btn-compact {
  padding: 6px 14px;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 11px;
}

.btn-action {
  background: linear-gradient(135deg, #0284c7, #0077b6);
  color: #fff;
  border: 1px solid #0096c7;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

.btn-action:hover {
  background: linear-gradient(135deg, #0369a1, #0284c7);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
}

.btn-outline {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-outline:hover {
  background-color: var(--bg-card-sub);
  border-color: var(--border-focus);
}

.btn-download {
  background-color: var(--accent-tint);
  color: var(--accent-primary);
  border: 1px solid var(--accent-border);
}

.btn-download:hover {
  background-color: var(--accent-primary);
  color: #fff;
}

/* ========================================================
   ACTION RIBBON & EXPORT TOOLBAR
   ======================================================== */
.action-ribbon {
  background-color: var(--bg-card-sub);
  border-bottom: 1px solid var(--border-main);
  padding: 6px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.ribbon-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ribbon-proj-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 12px;
  background-color: var(--bg-card);
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-main);
}

.ribbon-chip {
  font-size: 11px;
  color: var(--text-muted);
  background-color: var(--bg-card);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-main);
}

.chip-model {
  color: var(--accent-primary);
  font-weight: 600;
}

.ribbon-downloads {
  display: flex;
  align-items: center;
  gap: 6px;
}

.download-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  margin-right: 4px;
}

/* ========================================================
   NAVIGATION TABS
   ======================================================== */
.nav-compact-tabs {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  padding: 0 20px;
  overflow-x: auto;
  gap: 2px;
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 9px 15px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.nav-tab:hover {
  color: var(--accent-primary);
  background-color: var(--accent-tint);
}

.nav-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  background-color: var(--accent-tint);
}

/* ========================================================
   MAIN BODY & TILES
   ======================================================== */
.main-body {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 20px;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Compact KPI Row */
.kpi-compact-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.kpi-tile {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-tile:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-elevated);
}

.kpi-tile-pi {
  border-left: 3px solid var(--schubiger-blue);
}

.kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.kpi-tag {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kpi-badge-sub {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 500;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.kpi-number {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

.kpi-unit {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.kpi-footer-note {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Analytics Compact Grid */
.analytics-compact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 900px) {
  .analytics-compact-grid {
    grid-template-columns: 1fr;
  }
}

.card-compact {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}

.card-compact-header {
  padding: 10px 16px;
  background-color: var(--bg-card-sub);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-compact-header h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.count-pill {
  font-size: 10.5px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  padding: 2px 7px;
  border-radius: 9999px;
  color: var(--text-muted);
  font-weight: 600;
}

.card-compact-body {
  padding: 14px 16px;
}

/* Saturation Bars */
.sat-summary-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.sat-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

.bullet-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot-green { background-color: var(--status-green); }
.dot-yellow { background-color: var(--status-yellow); }
.dot-red { background-color: var(--status-red); }

.compact-track {
  background-color: var(--bg-card-sub);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}

.compact-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.fill-green { background-color: var(--status-green); }
.fill-yellow { background-color: var(--status-yellow); }
.fill-red { background-color: var(--status-red); }

/* Critical Links */
.critical-links-subpanel {
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
}

.subpanel-title {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 700;
}

.compact-critical-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.compact-critical-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  font-size: 11.5px;
}

/* Cost & Fuel Dense Table */
.dense-cost-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.dense-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-main);
}

.dense-row-highlight {
  border-top: 2px solid var(--border-main);
  border-bottom: none;
  font-weight: 700;
  padding-top: 8px;
  font-size: 13px;
}

.fuel-subcard {
  margin-top: 14px;
}

.subcard-title {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 700;
}

.fuel-segmented-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background-color: var(--bg-card-sub);
  margin-bottom: 8px;
}

.f-seg {
  height: 100%;
}

.seg-cruise { background-color: var(--schubiger-blue); }
.seg-delay { background-color: var(--status-yellow); }
.seg-stops { background-color: var(--status-red); }

.fuel-dense-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.fuel-dense-legend .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
}

/* ========================================================
   COMPACT DATA TABLE & CONTROLS
   ======================================================== */
.compact-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.search-input-wrap {
  width: 250px;
}

.compact-input {
  width: 100%;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  padding: 5px 8px;
  font-size: 11.5px;
  outline: none;
}

.compact-input:focus {
  border-color: var(--border-focus);
}

.filter-chip-group {
  display: flex;
  gap: 4px;
}

.filter-chip {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-family: inherit;
}

.filter-chip:hover {
  background-color: var(--bg-card-sub);
  color: var(--text-main);
}

.filter-chip.active {
  background-color: var(--schubiger-blue);
  border-color: var(--schubiger-blue);
  color: #fff;
}

.toolbar-spacer {
  flex: 1;
}

.table-compact-wrapper {
  overflow-x: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-subtle);
}

.compact-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 11.5px;
  white-space: nowrap;
}

.compact-table th {
  background-color: var(--bg-card-sub);
  color: var(--text-muted);
  font-weight: 700;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-main);
  border-right: 1px solid var(--border-main);
  cursor: pointer;
  user-select: none;
  font-size: 11px;
}

.compact-table th:hover {
  color: var(--schubiger-blue);
}

.compact-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--border-main);
  border-right: 1px solid rgba(0, 0, 0, 0.04);
}

.compact-table tbody tr:hover {
  background-color: var(--accent-tint);
}

.sat-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 9999px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 11px;
}

.sat-pill-low { background-color: rgba(16, 185, 129, 0.15); color: #059669; }
.sat-pill-med { background-color: rgba(245, 158, 11, 0.18); color: #d97706; }
.sat-pill-high { background-color: rgba(239, 68, 68, 0.2); color: #dc2626; }

body.theme-dark .sat-pill-low { color: #34d399; }
body.theme-dark .sat-pill-med { color: #fbbf24; }
body.theme-dark .sat-pill-high { color: #f87171; }

.badge-bus {
  background-color: var(--status-purple);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 2px;
  margin-left: 4px;
}

/* ========================================================
   IMIV COMPARISON
   ======================================================== */
.imiv-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.imiv-selection-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  background-color: var(--bg-card-sub);
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-main);
}

.imiv-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 180px;
}

.imiv-field label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}

.diff-pos { color: var(--status-red); font-weight: 700; }
.diff-neg { color: var(--status-green); font-weight: 700; }

/* ========================================================
   EDITOR
   ======================================================== */
.editor-header-bar, .raw-header-bar {
  padding: 8px 14px;
  background-color: var(--bg-card-sub);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-title-row strong, .raw-title-row strong {
  font-size: 12.5px;
}

.editor-count-badge {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 8px;
}

.raw-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 8px;
}

.editor-action-group, .raw-action-group {
  display: flex;
  gap: 6px;
}

.ruler-container {
  overflow-x: auto;
  background-color: var(--bg-editor);
  border-bottom: 1px solid var(--border-main);
  padding: 4px 10px;
}

.column-ruler {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--schubiger-blue);
  white-space: pre;
}

.editor-split {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 12px;
  padding: 10px;
}

@media (max-width: 900px) {
  .editor-split {
    grid-template-columns: 1fr;
  }
}

.compact-editor-area {
  width: 100%;
  height: 480px;
  background-color: var(--bg-editor);
  color: var(--text-main);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
  white-space: pre;
  overflow-x: auto;
  outline: none;
}

.compact-editor-area:focus {
  border-color: var(--border-focus);
}

.editor-sidebar-manual {
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 480px;
  overflow-y: auto;
  font-size: 11.5px;
}

.editor-sidebar-manual h5 {
  font-size: 12px;
  color: var(--schubiger-blue);
  border-bottom: 1px solid var(--border-main);
  padding-bottom: 4px;
}

.manual-entry b {
  color: var(--schubiger-blue);
}

/* ========================================================
   RAW OUTPUT & TERMINAL
   ======================================================== */
.compact-raw-pre {
  background-color: var(--bg-pre);
  color: var(--text-pre);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.4;
  padding: 14px;
  height: 520px;
  overflow: auto;
  white-space: pre;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* ========================================================
   FRAMEWORK OVERVIEW & TECHNICAL CONTEXT CARD
   ======================================================== */
.framework-overview-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-left: 4px solid var(--schubiger-blue);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-subtle);
  transition: all 0.2s ease;
}

.framework-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--border-main);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.framework-kicker {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--schubiger-blue);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.framework-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px 0;
  line-height: 1.35;
}

.framework-summary {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.framework-toggle-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
  padding: 4px 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.framework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.framework-col {
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
}

.framework-col-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--schubiger-blue);
  margin: 0 0 8px 0;
  border-bottom: 1px solid var(--border-main);
  padding-bottom: 4px;
}

.framework-col p {
  font-size: 11.5px;
  color: var(--text-main);
  line-height: 1.6;
  margin: 0 0 8px 0;
}

.framework-col p:last-child {
  margin-bottom: 0;
}

.framework-list {
  margin: 0;
  padding-left: 16px;
  font-size: 11.5px;
  color: var(--text-main);
  line-height: 1.55;
}

.framework-list li {
  margin-bottom: 6px;
}

.framework-list li strong {
  color: var(--text-main);
}

.doc-article-header {
  border-bottom: 1px solid var(--border-main);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.doc-kicker {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--schubiger-blue);
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ========================================================
   TECHNICAL MANUAL / SEO & LEGAL SECTION
   ======================================================== */
.technical-manual-article {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 24px;
}

.technical-manual-article h2 {
  font-size: 18px;
  color: var(--text-main);
  margin-bottom: 10px;
}

.lead-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

.doc-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 900px) {
  .doc-cards-grid {
    grid-template-columns: 1fr;
  }
}

.doc-card {
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  padding: 14px;
}

.doc-card h3 {
  font-size: 13px;
  color: var(--schubiger-blue);
  margin-bottom: 6px;
}

.doc-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

.formula-box {
  background-color: var(--bg-app);
  border: 1px solid var(--border-main);
  padding: 8px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--schubiger-blue);
  border-radius: var(--radius-xs);
}

.legal-notice-box {
  margin-top: 20px;
  padding: 16px;
  background-color: var(--accent-tint);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
}

.legal-notice-box h3 {
  font-size: 13.5px;
  color: var(--accent-primary);
  margin-bottom: 6px;
}

.legal-notice-box p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 6px;
}

.doc-footer-cta {
  margin-top: 20px;
  padding: 16px;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.doc-footer-cta h4 {
  font-size: 13.5px;
  color: var(--text-main);
  margin-bottom: 3px;
}

.doc-footer-cta p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========================================================
   MODAL INITIAL FILE DROPZONE
   ======================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-compact-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  width: 92%;
  max-width: 620px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: scaleUp 0.15s ease;
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 12px 18px;
  background-color: var(--bg-card-sub);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-group h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 11px;
  color: var(--text-dim);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.btn-close-modal:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dropzone-box {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  background-color: var(--bg-card-sub);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--schubiger-blue);
  background-color: var(--accent-tint);
}

.dropzone-icon-box {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--schubiger-blue);
  background-color: var(--accent-tint);
  border: 1px solid var(--accent-border);
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
}

.dropzone-text strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
}

.dropzone-text span {
  font-size: 11.5px;
  color: var(--text-dim);
}

/* Template Downloads Box in Modal */
.template-downloads-box {
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
}

.template-downloads-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11.5px;
}

.link-tutorial {
  color: var(--schubiger-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 11px;
}

.link-tutorial:hover {
  text-decoration: underline;
}

.template-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.btn-template-download {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  text-decoration: none;
  color: var(--text-main);
  position: relative;
  transition: all 0.15s ease;
}

.btn-template-download:hover {
  border-color: var(--schubiger-blue);
  background-color: var(--accent-tint);
  transform: translateY(-1px);
}

.tpl-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
  width: fit-content;
}

.tpl-excel {
  background-color: #107c41;
  color: #ffffff;
}

.tpl-csv {
  background-color: #0284c7;
  color: #ffffff;
}

.tpl-prn {
  background-color: #6366f1;
  color: #ffffff;
}

.tpl-prt {
  background-color: #d97706;
  color: #ffffff;
}

.tpl-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
}

.tpl-desc {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.test-data-box {
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
}

.test-data-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11.5px;
}

.test-data-buttons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.test-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.test-btn:hover {
  background-color: var(--accent-tint);
  border-color: var(--schubiger-blue);
}

.modal-footer {
  padding: 10px 18px;
  background-color: var(--bg-card-sub);
  border-top: 1px solid var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.footer-credit-note a {
  color: var(--schubiger-blue);
  text-decoration: none;
  font-weight: 700;
}

/* ========================================================
   CORPORATE FOOTER
   ======================================================== */
.corp-footer {
  background-color: var(--bg-header);
  border-top: 1px solid var(--border-main);
  padding: 10px 20px;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: auto;
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-logo-small {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* ========================================================
   TOASTS & UTILITIES
   ======================================================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
}

.toast {
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-main);
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-elevated);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.2s ease;
}

.toast-success { border-left: 4px solid var(--status-green); }
.toast-error { border-left: 4px solid var(--status-red); }
.toast-info { border-left: 4px solid var(--schubiger-blue); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.empty-state { text-align: center; color: var(--text-dim); padding: 24px; font-style: italic; }
.empty-item { color: var(--text-dim); font-size: 11px; font-style: italic; }
.text-success { color: var(--status-green); }
.text-warning { color: var(--status-yellow); }
.text-danger { color: var(--status-red); }
.text-primary { color: var(--accent-primary); }
.font-mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* ========================================================
   FRAMEWORK OVERVIEW CARD & OPERATIONAL INTRODUCTION (DASHBOARD)
   Alta Legibilidad Editorial para Ingenieros de Transporte
   ======================================================== */
.framework-overview-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-subtle);
  margin-bottom: 16px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.framework-header {
  padding: 14px 20px;
  background-color: var(--bg-card-sub);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.framework-title-group {
  flex: 1;
}

.framework-kicker {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--schubiger-blue);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.framework-heading {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 6px;
}

.framework-summary {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 950px;
}

.framework-toggle-btn {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.framework-toggle-btn:hover {
  background-color: var(--accent-tint);
  border-color: var(--schubiger-blue);
  color: var(--schubiger-blue);
}

.framework-body {
  padding: 18px 20px;
  transition: max-height 0.3s ease, opacity 0.25s ease;
}

.framework-body.collapsed {
  display: none;
}

.framework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.framework-col {
  background-color: var(--bg-app);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.framework-col-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-main);
  padding-bottom: 6px;
}

.framework-col p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.55;
}

.framework-col strong {
  color: var(--text-main);
}

.framework-col code {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--schubiger-blue);
}

.framework-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-left: 0;
}

.framework-list li {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
  position: relative;
  padding-left: 14px;
}

.framework-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--schubiger-blue);
  font-weight: bold;
}

/* Compliance Card (Ley N° 21.719) */
.compliance-banner-card {
  background-color: var(--accent-tint);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--schubiger-blue);
  border-radius: var(--radius-xs);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.compliance-info {
  flex: 1;
  min-width: 280px;
}

.compliance-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.compliance-pill {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  background-color: var(--schubiger-navy);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.4px;
}

.compliance-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.compliance-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.compliance-actions {
  display: flex;
  gap: 8px;
}

/* ========================================================
   SATELLITE AUTHORITY LANDING PAGES STYLES
   ======================================================== */
.satellite-nav {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-main);
  padding: 0 20px;
}

.satellite-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.sat-link {
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sat-link:hover {
  color: var(--schubiger-blue);
  border-bottom-color: var(--schubiger-blue-deep);
}

.sat-link.active {
  color: var(--schubiger-blue);
  border-bottom-color: var(--schubiger-blue);
  font-weight: 700;
}

.sat-breadcrumb {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.sat-breadcrumb a {
  color: var(--schubiger-blue);
  text-decoration: none;
}

.sat-breadcrumb a:hover {
  text-decoration: underline;
}

.doc-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  box-shadow: var(--shadow-subtle);
}

.doc-header-banner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-main-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.doc-lead-paragraph {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 900px;
}

.doc-hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.satellite-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .satellite-grid {
    grid-template-columns: 1fr;
  }
}

.satellite-main-col {
  display: flex;
  flex-direction: column;
}

.satellite-aside-col {
  display: flex;
  flex-direction: column;
}

.doc-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-main);
  padding-bottom: 6px;
}

.doc-sub-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin: 14px 0 6px 0;
}

.doc-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.privacy-callout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 700px) {
  .privacy-callout-grid {
    grid-template-columns: 1fr;
  }
}

.privacy-callout-card {
  background-color: var(--bg-app);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-xs);
  padding: 12px 14px;
}

.privacy-callout-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.code-spec-box {
  background-color: var(--bg-pre);
  color: var(--text-pre);
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  margin: 10px 0 14px 0;
  overflow-x: auto;
  line-height: 1.5;
}

.card-spec-item {
  border-left: 3px solid var(--schubiger-blue);
  background-color: var(--bg-app);
  padding: 10px 14px;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  margin-bottom: 10px;
}

.card-spec-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.sat-text-link {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--schubiger-blue);
  text-decoration: none;
  margin-top: 6px;
}

.sat-text-link:hover {
  text-decoration: underline;
  color: var(--schubiger-blue-deep);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-tag {
  font-size: 10.5px;
  background-color: var(--bg-card-sub);
  color: var(--text-muted);
  border: 1px solid var(--border-main);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
}

/* ========================================================
   VISITOR COUNTER WIDGET (BASE 1390)
   ======================================================== */
.footer-counter-bar {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-main);
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.counter-badge-container {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-card-sub);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  box-shadow: var(--shadow-subtle);
  flex-wrap: wrap;
  justify-content: center;
}

.counter-badge-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background-color: var(--schubiger-navy);
  color: var(--schubiger-cyan-light);
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
}

.counter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.counter-number-badge {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--schubiger-blue-deep);
  background-color: var(--bg-card);
  border: 1px solid var(--border-focus);
  padding: 2px 10px;
  border-radius: var(--radius-xs);
  letter-spacing: 1px;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.15);
}

.counter-subtext {
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: var(--font-sans);
}


