/* ==========================================================================
   Fijate Tools - Calculadora de Almacenamiento CCTV y Ancho de Banda NVR
   Estilos visuales, rack interactivo de discos y diseño responsive multidispositivo
   ========================================================================== */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Paleta corporativa Midnight Slate */
  --bg-app: #0b0f17;
  --bg-card: #111827;
  --bg-card-alt: #1a2333;
  --bg-input: #0d131f;
  --border-color: #222f44;
  --border-focus: #0284c7;

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

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.25);

  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-alt: #f8fafc;
  --bg-input: #ffffff;
  --border-color: #cbd5e1;
  --border-focus: #0284c7;

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

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.15);
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6,
.brand-title,
.section-title,
.card-title {
  font-family: var(--font-heading);
}

.mono,
.kpi-num,
.stat-pill-val,
.bay-spec,
code {
  font-family: var(--font-mono);
}

.tool-layout {
  max-width: 1240px;
  margin: 1rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* --------------------------------------------------------------------------
   Cabecera de la herramienta e introducción
   -------------------------------------------------------------------------- */
.tool-intro-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.tool-intro-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan), var(--accent-emerald));
}

.intro-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.intro-text-wrap {
  flex: 1 1 300px;
}

.intro-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.intro-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

.intro-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

/* --------------------------------------------------------------------------
   Selector de modo (Pestañas principales)
   -------------------------------------------------------------------------- */
.calc-mode-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.35rem;
  border-radius: var(--radius-md);
}

.tab-btn {
  flex: 1 1 0%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-alt);
}

.tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* --------------------------------------------------------------------------
   Barra de Presets rápidos
   -------------------------------------------------------------------------- */
.presets-strip-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.presets-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.presets-pills-wrap {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.preset-pill {
  white-space: nowrap;
  padding: 0.5rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-pill:hover {
  border-color: var(--primary);
  background: var(--bg-input);
}

.preset-pill.active {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Cuadrícula de trabajo (Grupos vs Resultados)
   -------------------------------------------------------------------------- */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
  align-items: start;
}

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

/* Tarjeta de configuración global */
.global-settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-title-sm {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.global-params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 600px) {
  .global-params-grid {
    grid-template-columns: 1fr;
  }
}

.slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-val-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: var(--bg-card-alt);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.range-styled {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
}

.range-styled::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 8px var(--primary-glow);
  transition: transform 0.15s ease;
}

.range-styled::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* --------------------------------------------------------------------------
   Tarjetas de Grupos de Cámaras
   -------------------------------------------------------------------------- */
.camera-group-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.camera-group-card:hover {
  border-color: #3b4c68;
}

.camera-group-header {
  padding: 0.85rem 1.25rem;
  background: var(--bg-card-alt);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.group-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 0%;
  min-width: 0;
}

.group-number-badge {
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.input-group-name {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  flex: 1 1 0%;
  min-width: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.input-group-name:focus {
  background: var(--bg-input);
  border-color: var(--border-focus);
  outline: none;
}

.group-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-group-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-group-action:hover {
  background: var(--bg-app);
  color: var(--text-main);
}

.btn-group-action.text-danger:hover {
  color: var(--accent-rose);
  border-color: var(--accent-rose);
}

.camera-group-body {
  padding: 1.25rem;
}

.group-controls-grid {
  display: grid;
  grid-template-columns: 140px 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

@media (max-width: 860px) {
  .group-controls-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .group-controls-grid {
    grid-template-columns: 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Control numérico contador */
.counter-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  height: 40px;
  overflow: hidden;
}

.btn-counter {
  width: 38px;
  height: 100%;
  background: var(--bg-card-alt);
  border: none;
  color: var(--text-main);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-counter:hover {
  background: var(--primary);
  color: #ffffff;
}

.input-cam-count {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  outline: none;
}

/* Selects canónicos */
select,
.select-resolution,
.select-codec,
.select-fps {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 40px 0 0.75rem;
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.88rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease;
  text-overflow: ellipsis;
  white-space: nowrap;
}

select:focus {
  border-color: var(--border-focus);
}

select option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* Fila de modo de grabación y audio */
.group-mode-row {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.radio-toggle-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.radio-toggle-pill {
  flex: 1 1 180px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-toggle-pill input {
  display: none;
}

.radio-toggle-pill.active {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--text-main);
  font-weight: 600;
}

.motion-slider-wrap {
  padding: 0.5rem 0.25rem;
}

.range-motion {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: var(--border-color);
  border-radius: 3px;
  margin-top: 0.4rem;
}

.range-motion::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-amber);
  cursor: pointer;
}

/* Checkbox personalizado */
.checkbox-custom-label {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: var(--text-main);
  cursor: pointer;
}

.checkbox-custom-label input {
  display: none;
}

.checkbox-indicator {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card);
  position: relative;
  transition: all 0.15s ease;
}

.checkbox-custom-label input:checked + .checkbox-indicator {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-custom-label input:checked + .checkbox-indicator::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Tira de estadísticas del grupo */
.group-stats-strip {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-color);
}

.stat-pill {
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-pill-label {
  color: var(--text-dim);
}

.stat-pill-val {
  font-weight: 600;
  color: var(--text-main);
}

/* Botón para añadir grupo */
.btn-add-group-wrap {
  margin-top: 1rem;
}

.btn-add-dashed {
  width: 100%;
  padding: 0.85rem;
  border: 2px dashed var(--border-color);
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-add-dashed:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
}

/* --------------------------------------------------------------------------
   Panel de Resultados Técnicos (Columna Lateral)
   -------------------------------------------------------------------------- */
.results-card-sticky {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: sticky;
  top: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.kpi-main-block {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(6, 182, 212, 0.05));
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.kpi-main-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
  margin-bottom: 0.35rem;
}

.kpi-main-value-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
}

.kpi-num-hero {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.kpi-unit-hero {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.kpi-main-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Lista de métricas secundarias */
.kpi-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.metric-label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
}

.metric-value-highlight {
  font-weight: 700;
  color: var(--text-main);
}

/* Semáforo de switch */
.switch-indicator-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin: 1rem 0;
}

.switch-bar-track {
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin: 0.5rem 0 0.35rem 0;
}

.switch-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.fill-green { background: var(--accent-emerald); }
.fill-yellow { background: var(--accent-amber); }
.fill-red { background: var(--accent-rose); }

.badge-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.badge-status.success { color: var(--accent-emerald); }
.badge-status.warning { color: var(--accent-amber); }
.badge-status.danger { color: var(--accent-rose); }

/* Cumplimiento AEPD */
.aepd-compliance-box {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin: 1rem 0;
}

.badge-compliance {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.badge-compliance.success { color: var(--accent-emerald); }
.badge-compliance.alert { color: var(--accent-rose); }

.compliance-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-dim);
  margin: 0;
}

/* Botones de informe y exportación */
.report-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.btn-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
  min-height: 42px;
}

.btn-action-primary:hover {
  background: var(--primary-hover);
}

.btn-action-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 42px;
}

.btn-action-secondary:hover {
  background: var(--bg-card-alt);
  border-color: var(--primary);
}

/* --------------------------------------------------------------------------
   Visualizador: Rack NVR interactivo
   -------------------------------------------------------------------------- */
.rack-visualizer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.nvr-chassis {
  background: #070a10;
  border: 2px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.nvr-front-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.nvr-brand {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.nvr-status-leds {
  display: flex;
  gap: 0.75rem;
}

.led-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
}

.led-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #334155;
}

.led-dot.green {
  background: var(--accent-emerald);
  box-shadow: 0 0 6px var(--accent-emerald);
}

.led-dot.blue {
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

.rack-bays-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.85rem;
}

.rack-bay-slot {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  position: relative;
  transition: all 0.2s ease;
}

.rack-bay-slot.occupied {
  border-color: var(--primary);
  background: linear-gradient(180deg, #131d31, #0b1120);
}

.bay-handle {
  width: 6px;
  height: 42px;
  background: #334155;
  border-radius: 2px;
}

.rack-bay-slot.occupied .bay-handle {
  background: var(--primary);
}

.bay-content {
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
}

.bay-led {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #334155;
  margin-bottom: 0.25rem;
}

.bay-led.active {
  background: var(--accent-emerald);
  box-shadow: 0 0 4px var(--accent-emerald);
}

.bay-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
}

.bay-spec {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.bay-model {
  font-size: 0.65rem;
  color: var(--accent-cyan);
}

.rack-summary-footer {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Sección Modo Inverso
   -------------------------------------------------------------------------- */
.reverse-calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.reverse-inputs-flex {
  display: flex;
  gap: 1.25rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
}

.reverse-results-hero {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  text-align: center;
}

.reverse-kpi-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reverse-num {
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
}

.reverse-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* --------------------------------------------------------------------------
   Modal accesible corporativo
   -------------------------------------------------------------------------- */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.app-modal-backdrop.active {
  display: flex;
}

.app-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Estilos de Impresión
   -------------------------------------------------------------------------- */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-header,
  .fijate-footer,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .calc-mode-nav,
  .presets-strip-card,
  .btn-add-group-wrap,
  .report-actions-grid,
  .affiliate-section,
  .seo-guide-section {
    display: none !important;
  }
  .tool-layout {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .workspace-grid {
    grid-template-columns: 1fr !important;
  }
  .results-card-sticky {
    position: static !important;
    box-shadow: none !important;
    border: 1px solid #000000 !important;
  }
}
