/* ==========================================================================
   La Casa Blanca · Panel de Gestión de Carta (PRB-19)
   Diseño limpio inspirado en dashboard ejecutivo moderno, 100% autocontenido
   ========================================================================== */

:root {
  --sidebar-bg: #030712;
  --sidebar-border: rgba(30, 64, 175, 0.35);
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-active-bg: rgba(6, 182, 212, 0.14);
  --sidebar-accent: #06b6d4;
  --brand-amber: #f59e0b;

  --bg-canvas: #f1f5f9;
  --bg-card: #ffffff;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-dark: #0f172a;
  --accent-blue: #1e40af;
  --accent-blue-hover: #1d4ed8;
  --accent-teal: #0891b2;
  --accent-teal-hover: #0e7490;
  --accent-cyan: #06b6d4;
  --accent-gold: #dfc05a;

  --success-bg: #ecfdf5;
  --success-text: #059669;
  --success-border: #a7f3d0;

  --warning-bg: #fffbeb;
  --warning-text: #d97706;
  --warning-border: #fde68a;

  --danger-bg: #fef2f2;
  --danger-text: #dc2626;
  --danger-border: #fecaca;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-hover: 0 8px 20px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- Layout Principal --- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 256px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f172a 0%, #030712 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.28);
  flex-shrink: 0;
}

.brand-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.login-logo-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11.5px;
  color: #7c8ba1;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 14px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5b6b82;
  padding: 14px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #a3b3c9;
  font-weight: 500;
  font-size: 13.5px;
  margin-bottom: 3px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

.nav-link.is-active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--sidebar-accent);
}

.nav-link.is-active svg {
  color: var(--sidebar-accent);
}

.nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #7c8ba1;
}

.sidebar-footer {
  padding: 14px 14px 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1e3a5f;
  color: #7dd3fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: #64748b;
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

/* --- Área Principal --- */
.main-area {
  flex: 1;
  min-width: 0;
  padding: 24px 30px 40px;
  max-width: 1600px;
}

/* --- Cabecera de Página y Barra de Filtros --- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-group {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  box-shadow: var(--shadow-card);
}

.pill-filter {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  border: none;
  background: transparent;
  cursor: pointer;
}

.pill-filter:hover {
  color: var(--text-primary);
  background: #f1f5f9;
}

.pill-filter.is-active {
  background: var(--accent-dark);
  color: #ffffff;
  font-weight: 600;
}

/* --- Botones --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent-teal);
  color: #ffffff;
}

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

.btn-secondary {
  background: #ffffff;
  border-color: var(--border-strong);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.btn-secondary:hover {
  background: #f1f6f9;
  border-color: var(--accent-teal);
  color: var(--accent-teal);
}

.btn-blue {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-blue:hover {
  background: var(--accent-blue-hover);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
  box-shadow: var(--shadow-card);
}

.btn-outline:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: #f8fafc;
}

.btn-success-soft {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-border);
}

.btn-success-soft:hover {
  background: #d1fae5;
}

.btn-warning-soft {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.btn-warning-soft:hover {
  background: #fef3c7;
}

.btn-danger-soft {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: var(--danger-border);
}

.btn-danger-soft:hover {
  background: #fee2e2;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 7px;
}

/* --- Alertas / Mensajes Flash --- */
.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.flash-msg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  box-shadow: var(--shadow-card);
}

.flash-msg.success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #065f46;
}

.flash-msg.warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: #92400e;
}

.flash-msg.error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #991b1b;
}

.flash-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}

/* --- Tarjetas KPI (Fila Superior de 6 Tarjetas) --- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 112px;
}

.kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-label svg {
  width: 14px;
  height: 14px;
  color: #94a3b8;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 8px 0 8px;
  font-variant-numeric: tabular-nums;
}

.kpi-value.kpi-range {
  font-size: 17px;
}

.kpi-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.badge-trend {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-trend.up {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-trend.warn {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge-trend.danger {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.badge-trend.neutral {
  background: #f1f5f9;
  color: #475569;
}

/* --- Tira Resumen Horizontal (Estilo FuelGo) --- */
.summary-strip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}

.strip-item {
  font-size: 12.5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.strip-item strong {
  color: var(--text-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --- Grilla de Gráficos (2 Columnas) --- */
.charts-grid-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.bottom-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
}

.bottom-single-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.card-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-blue);
}

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

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
}

.legend-line {
  width: 16px;
  height: 2.5px;
  background: var(--accent-teal);
  display: inline-block;
  border-radius: 2px;
}

.chart-stage {
  position: relative;
  width: 100%;
  min-height: 255px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-tooltip {
  position: fixed;
  pointer-events: none;
  background: #0f172a;
  color: #f8fafc;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  z-index: 1000;
  display: none;
}

/* --- Tablas y Listados --- */
.toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  font-size: 13px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #94a3b8;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: #f8fafc;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 13.5px;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

.dish-name {
  font-weight: 600;
  color: var(--text-primary);
}

.dish-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 360px;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.status-badge.is-available {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-badge.is-available::before {
  background: #10b981;
}

.status-badge.is-soldout {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.status-badge.is-soldout::before {
  background: #f59e0b;
}

/* --- Switch Toggle de Pesca del Día --- */
.stock-toggle-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.switch-btn {
  position: relative;
  width: 42px;
  height: 23px;
  border-radius: 999px;
  border: none;
  background: #cbd5e1;
  cursor: pointer;
  padding: 0;
  transition: background 0.18s ease;
}

.switch-btn::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.switch-btn.is-on {
  background: #10b981;
}

.switch-btn.is-on::after {
  transform: translateX(19px);
}

/* --- Edición Rápida de Precio --- */
.price-inline-form {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.price-prefix {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.price-input {
  width: 84px;
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.price-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

/* --- Formularios y Modales --- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: inherit;
  background: #ffffff;
  color: var(--text-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
  font-size: 11.5px;
  color: var(--text-muted);
}

.form-error {
  font-size: 12px;
  color: var(--danger-text);
  font-weight: 500;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #f8fafc;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #10b981;
  cursor: pointer;
}

/* --- Modal --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 900;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  padding: 22px 24px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
}

/* --- Pesca del Día Tarjetas por Categoría --- */
.pesca-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.pesca-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.pesca-item:last-child {
  border-bottom: none;
}

/* --- Estado Vacío --- */
.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  margin: 8px 0 6px;
  color: var(--text-primary);
  font-size: 16px;
}

/* --- Pantalla de Login --- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #172542 0%, #09101f 65%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 410px;
  background: #ffffff;
  border-radius: 18px;
  padding: 32px 30px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   Dashboard Operativo del Día · En Vivo (PRB-45)
   ========================================================================== */
.operativo-panel {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-top: 3px solid #0e7490;
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.operativo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.operativo-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-live 1.8s infinite;
}

@keyframes pulse-live {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.operativo-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.operativo-subheading {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.operativo-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.operativo-clock {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 4 KPIs Operativos en Fila */
.operativo-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.op-kpi-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.op-kpi-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.op-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.op-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.op-kpi-icon svg {
  width: 17px;
  height: 17px;
}

.op-kpi-icon.icon-tables {
  background: #eff6ff;
  color: #2563eb;
}

.op-kpi-icon.icon-sales {
  background: #ecfdf5;
  color: #059669;
}

.op-kpi-icon.icon-stock {
  background: #fffbeb;
  color: #d97706;
}

.op-kpi-icon.icon-orders {
  background: #fdf2f8;
  color: #db2777;
}

.op-kpi-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.op-kpi-badge.up {
  background: #ecfdf5;
  color: #059669;
}

.op-kpi-badge.warn {
  background: #fffbeb;
  color: #d97706;
}

.op-kpi-badge.danger {
  background: #fef2f2;
  color: #dc2626;
}

.op-kpi-badge.neutral {
  background: #f1f5f9;
  color: #475569;
}

.op-kpi-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.op-kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.op-kpi-value .currency {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
}

.op-kpi-value .op-kpi-total {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
}

.op-kpi-foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Grilla Salón + Comandas */
.operativo-layout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.op-salon-card,
.op-pedidos-card {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.op-mesa-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.op-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.op-legend-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.op-legend-chip.libre .dot { background-color: #10b981; }
.op-legend-chip.atendiendo .dot { background-color: #3b82f6; }
.op-legend-chip.ocupada .dot { background-color: #ef4444; }
.op-legend-chip.cuenta .dot { background-color: #f59e0b; }

/* Grilla de Mesas */
.mesas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.mesa-box {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.mesa-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.mesa-num-badge {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.mesa-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.mesa-ubicacion {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mesa-status-pill {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  margin-top: 2px;
}

/* Colores de Estado de Mesas */
.mesa-estado-libre {
  border-color: #a7f3d0;
  background: #f0fdf4;
}
.mesa-estado-libre .mesa-status-pill {
  background: #dcfce7;
  color: #15803d;
}

.mesa-estado-atendiendo,
.mesa-estado-atendida {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.mesa-estado-atendiendo .mesa-status-pill,
.mesa-estado-atendida .mesa-status-pill {
  background: #dbeafe;
  color: #1d4ed8;
}

.mesa-estado-ocupada {
  border-color: #fecaca;
  background: #fef2f2;
}
.mesa-estado-ocupada .mesa-status-pill {
  background: #fee2e2;
  color: #b91c1c;
}

.mesa-estado-pide_cuenta,
.mesa-estado-cuenta_solicitada {
  border-color: #fde68a;
  background: #fffbeb;
}
.mesa-estado-pide_cuenta .mesa-status-pill,
.mesa-estado-cuenta_solicitada .mesa-status-pill {
  background: #fef3c7;
  color: #b45309;
}

/* Comandas Activas List */
.op-pedidos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  max-height: 380px;
  overflow-y: auto;
}

.op-pedido-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.op-ped-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-primary);
}

.op-ped-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

.op-ped-total {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Estados de Pedidos */
.ped-status-pendiente {
  background: #fef3c7;
  color: #b45309;
}
.ped-status-cocinando {
  background: #fee2e2;
  color: #b91c1c;
}
.ped-status-listo {
  background: #dbeafe;
  color: #1d4ed8;
}
.ped-status-servido {
  background: #dcfce7;
  color: #15803d;
}
.ped-status-cobrado {
  background: #f1f5f9;
  color: #475569;
}
.ped-status-cancelado,
.ped-status-anulado {
  background: #f3f4f6;
  color: #9ca3af;
}

/* ==========================================================================
   Caja y Arqueo por Turno (PRB-60) & Reportes de Ventas (PRB-61)
   ========================================================================== */
.caja-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

.caja-layout-grid > * {
  min-width: 0;
}

.reportes-layout-grid {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1520px) {
  .reportes-layout-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
}

.metodo-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.metodo-efectivo {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.metodo-yape {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.metodo-plin {
  background: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.metodo-tarjeta {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.pay-bar-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.pay-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.pay-fill-efectivo { background: #10b981; }
.pay-fill-yape { background: #7c3aed; }
.pay-fill-plin { background: #06b6d4; }
.pay-fill-tarjeta { background: #2563eb; }

.arqueo-preview-box {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: #f8fafc;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.arqueo-preview-box.is-cuadrado {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #065f46;
}

.arqueo-preview-box.is-sobrante {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: #92400e;
}

.arqueo-preview-box.is-faltante {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #991b1b;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .caja-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Responsividad --- */
@media (max-width: 1280px) {
  .operativo-kpis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .operativo-layout-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .charts-grid-duo,
  .charts-grid,
  .bottom-grid,
  .bottom-single-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .operativo-kpis-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Stock del Día / Inventario Reducido (PRB-59)
   ========================================================================== */
.stock-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stock-pill-ok {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.stock-pill-low {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.stock-pill-zero {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.stock-pill-free {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.mov-tipo-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mov-tipo-carga_diaria {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.mov-tipo-salida_venta {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.mov-tipo-reversion {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.mov-tipo-ajuste {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* ==========================================================================
   KDS DE COCINA (PRB-57 · P-10)
   Diseño de alta visibilidad para pantallas táctiles y monitores de cocina
   ========================================================================== */

.kds-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kds-station-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #ffffff;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.kds-station-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
  cursor: pointer;
}

.kds-station-pill:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.kds-station-pill.is-active {
  background: var(--accent-teal);
  color: #ffffff;
  border-color: var(--accent-teal);
  box-shadow: 0 2px 8px rgba(15, 76, 92, 0.25);
}

.kds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
  align-items: start;
}

.kds-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kds-card:hover {
  box-shadow: var(--shadow-hover);
}

/* Semáforo SLA en cabecera de la comanda */
.kds-card-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid transparent;
}

.kds-card.sla-normal {
  border-color: #a7f3d0;
}
.kds-card.sla-normal .kds-card-header {
  background: #f0fdf4;
  border-bottom-color: #bbf7d0;
}

.kds-card.sla-alerta {
  border-color: #fde68a;
}
.kds-card.sla-alerta .kds-card-header {
  background: #fffbeb;
  border-bottom-color: #fef08a;
}

.kds-card.sla-critico {
  border-color: #fca5a5;
  animation: kdsPulseBorder 2s infinite ease-in-out;
}
.kds-card.sla-critico .kds-card-header {
  background: #fef2f2;
  border-bottom-color: #fecaca;
}

@keyframes kdsPulseBorder {
  0%, 100% { border-color: #fca5a5; }
  50% { border-color: #dc2626; }
}

.kds-card-table {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.kds-card-order-id {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-left: 6px;
}

.kds-sla-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: monospace;
  font-size: 14px;
  font-weight: 700;
}

.kds-card.sla-normal .kds-sla-timer {
  background: #dcfce7;
  color: #15803d;
}

.kds-card.sla-alerta .kds-sla-timer {
  background: #fef3c7;
  color: #b45309;
}

.kds-card.sla-critico .kds-sla-timer {
  background: #fee2e2;
  color: #b91c1c;
  animation: kdsBlinkTimer 1s infinite alternate;
}

@keyframes kdsBlinkTimer {
  from { opacity: 1; }
  to { opacity: 0.65; }
}

.kds-card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kds-item-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 9px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.kds-item-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.kds-item-row:first-child {
  padding-top: 2px;
}

.kds-item-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.kds-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 37px;
  flex-wrap: wrap;
}

.kds-item-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.kds-item-qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  background: var(--accent-teal);
  color: #ffffff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.kds-item-info {
  flex: 1;
  min-width: 0;
}

.kds-item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.kds-item-notes {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border-left: 3px solid #f59e0b;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Badges de Estación */
.badge-barra-fria {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-cocina-caliente {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.badge-bebidas {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.badge-postres {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fef08a;
}

.kds-card-footer {
  padding: 12px 16px;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.btn-kds-action {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-kds-iniciar {
  background: #2563eb;
  color: #ffffff;
}
.btn-kds-iniciar:hover {
  background: #1d4ed8;
}

.btn-kds-listo {
  background: #059669;
  color: #ffffff;
}
.btn-kds-listo:hover {
  background: #047857;
}

.btn-kds-servir {
  background: #475569;
  color: #ffffff;
}
.btn-kds-servir:hover {
  background: #334155;
}

/* ==========================================================================
   PRB-58: Monitor de Impresión Térmica 80 mm y Vista Previa de Tickets
   ========================================================================== */
.ticket-80mm-preview {
  font-family: "Courier New", Courier, monospace;
  font-size: 12.5px;
  line-height: 1.35;
  background: #fffcf2;
  color: #1e293b;
  padding: 18px 16px;
  border-radius: 4px;
  border: 1px dashed #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  white-space: pre;
  overflow-x: auto;
  max-width: 480px;
  margin: 0 auto;
}

.badge-impreso {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.badge-pendiente {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde047;
}

.badge-fallido {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.badge-tipo-comanda {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

.badge-tipo-precuenta {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #d8b4fe;
}

.badge-subtitulo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.kds-filtros-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #ffffff;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.kds-filtros-grupo {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kds-filtro-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 4px;
}

.kds-filtro-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  transition: all 0.15s ease;
}

.kds-filtro-btn:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.kds-filtro-btn.is-active {
  background: linear-gradient(135deg, #1e40af 0%, #06b6d4 100%);
  color: #ffffff;
  border-color: #06b6d4;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.25);
}

/* Badges base compartidos (KDS / Personal / Impresión) */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  border: 1px solid transparent;
}

.badge-primary {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.badge-success {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.badge-warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.badge-danger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.badge-outline {
  background: #f8fafc;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.op-kpi-card-highlight {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.ticket-preview-row {
  background: #f8fafc;
  border-bottom: 2px solid var(--border-subtle);
}

/* ==========================================================================
   Apartado Selector de Apariencia (Modo Claro / Modo Oscuro)
   ========================================================================== */
.sidebar-theme-box {
  padding: 10px 9px;
  margin: 4px 14px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(30, 64, 175, 0.36);
  box-sizing: border-box;
}

.theme-switch-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  gap: 4px;
  padding: 7px 3px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: #94a3b8;
  background: rgba(3, 7, 18, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.theme-switch-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.theme-switch-btn:hover {
  color: #ffffff;
  border-color: rgba(6, 182, 212, 0.45);
}

.theme-switch-btn.is-active {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.55) 0%, rgba(6, 182, 212, 0.28) 100%);
  color: #ffffff;
  border-color: #06b6d4;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.22);
}

/* ==========================================================================
   MODO OSCURO · Paleta Oficial (#030712 · #0f172a · #1e40af · #06b6d4 · #FFFFFF)
   ========================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #030712;
  --bg-card: #0f172a;
  --border-subtle: rgba(30, 64, 175, 0.36);
  --border-strong: rgba(6, 182, 212, 0.5);

  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent-dark: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #60a5fa;
  --accent-teal: #06b6d4;
  --accent-teal-hover: #22d3ee;

  --success-bg: rgba(16, 185, 129, 0.15);
  --success-text: #34d399;
  --success-border: rgba(16, 185, 129, 0.45);

  --warning-bg: rgba(245, 158, 11, 0.15);
  --warning-text: #fbbf24;
  --warning-border: rgba(245, 158, 11, 0.45);

  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-text: #f87171;
  --danger-border: rgba(239, 68, 68, 0.45);

  --shadow-card: 0 4px 20px rgba(3, 7, 18, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  --shadow-hover: 0 8px 28px rgba(6, 182, 212, 0.12);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 82% 8%, rgba(6, 182, 212, 0.09) 0%, transparent 42%),
    radial-gradient(circle at 20% 92%, rgba(30, 64, 175, 0.14) 0%, transparent 48%),
    #030712;
  color: #ffffff;
}

html[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #080f20 0%, #030712 100%);
  border-right: 1px solid rgba(30, 64, 175, 0.42);
}

html[data-theme="dark"] .nav-link.is-active {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.2) 0%, rgba(30, 64, 175, 0.16) 100%);
  color: #ffffff;
  box-shadow: inset 3px 0 0 #06b6d4;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .operativo-panel,
html[data-theme="dark"] .kpi-card,
html[data-theme="dark"] .summary-strip,
html[data-theme="dark"] .toolbar,
html[data-theme="dark"] .kds-station-nav,
html[data-theme="dark"] .kds-filtros-bar,
html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .login-card {
  background: #0f172a;
  border-color: rgba(30, 64, 175, 0.4);
  color: #ffffff;
}

html[data-theme="dark"] .operativo-panel {
  border-top: 2px solid #06b6d4;
  box-shadow: 0 0 28px rgba(6, 182, 212, 0.08), 0 6px 24px rgba(3, 7, 18, 0.65);
}

html[data-theme="dark"] .kpi-card:first-child,
html[data-theme="dark"] .op-kpi-card:first-child {
  border-color: rgba(6, 182, 212, 0.55);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.12);
}

html[data-theme="dark"] .op-kpi-card,
html[data-theme="dark"] .op-pedido-item,
html[data-theme="dark"] .checkbox-row {
  background: #080f20;
  border-color: rgba(30, 64, 175, 0.38);
}

html[data-theme="dark"] .op-kpi-card:hover {
  border-color: rgba(6, 182, 212, 0.55);
}

html[data-theme="dark"] .op-kpi-card-highlight {
  background: rgba(6, 182, 212, 0.09);
  border-color: rgba(6, 182, 212, 0.55);
}

html[data-theme="dark"] .op-kpi-icon.icon-tables {
  background: rgba(30, 64, 175, 0.32);
  color: #60a5fa;
}

html[data-theme="dark"] .op-kpi-icon.icon-sales {
  background: rgba(6, 182, 212, 0.18);
  color: #22d3ee;
}

html[data-theme="dark"] .op-kpi-icon.icon-stock {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

html[data-theme="dark"] .op-kpi-icon.icon-orders {
  background: rgba(30, 64, 175, 0.28);
  color: #38bdf8;
}

html[data-theme="dark"] .op-kpi-badge.up {
  background: rgba(6, 182, 212, 0.16);
  color: #22d3ee;
}

html[data-theme="dark"] .op-kpi-badge.warn {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

html[data-theme="dark"] .op-kpi-badge.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

html[data-theme="dark"] .op-kpi-badge.neutral,
html[data-theme="dark"] .badge-trend.neutral {
  background: rgba(30, 64, 175, 0.28);
  color: #cbd5e1;
}

html[data-theme="dark"] .live-pill {
  background: rgba(6, 182, 212, 0.14);
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.45);
}

html[data-theme="dark"] .live-pulse {
  background-color: #06b6d4;
}

html[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #1e40af 0%, #0891b2 100%);
  border-color: #06b6d4;
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.28);
}

html[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #06b6d4 100%);
}

html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .btn-secondary {
  background: #080f20;
  border-color: rgba(30, 64, 175, 0.48);
  color: #e2e8f0;
}

html[data-theme="dark"] .btn-outline:hover,
html[data-theme="dark"] .btn-secondary:hover {
  background: rgba(30, 64, 175, 0.22);
  border-color: #06b6d4;
  color: #ffffff;
}

html[data-theme="dark"] .btn-success-soft {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

html[data-theme="dark"] .btn-warning-soft {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

html[data-theme="dark"] .btn-danger-soft {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

html[data-theme="dark"] .pill-group {
  background: #080f20;
  border-color: rgba(30, 64, 175, 0.42);
}

html[data-theme="dark"] .pill-filter,
html[data-theme="dark"] .kds-station-pill,
html[data-theme="dark"] .kds-filtro-btn {
  color: #cbd5e1;
}

html[data-theme="dark"] .kds-station-pill,
html[data-theme="dark"] .kds-filtro-btn {
  background: #080f20;
  border-color: rgba(30, 64, 175, 0.42);
}

html[data-theme="dark"] .pill-filter:hover,
html[data-theme="dark"] .kds-station-pill:hover,
html[data-theme="dark"] .kds-filtro-btn:hover {
  background: rgba(30, 64, 175, 0.25);
  color: #ffffff;
}

html[data-theme="dark"] .pill-filter.is-active,
html[data-theme="dark"] .kds-station-pill.is-active,
html[data-theme="dark"] .kds-filtro-btn.is-active {
  background: linear-gradient(135deg, #1e40af 0%, #06b6d4 100%);
  color: #ffffff;
  border-color: #06b6d4;
}

html[data-theme="dark"] .data-table th {
  background: #080f20;
  color: #94a3b8;
  border-bottom-color: rgba(30, 64, 175, 0.42);
}

html[data-theme="dark"] .data-table td {
  border-bottom-color: rgba(30, 64, 175, 0.22);
  color: #e2e8f0;
}

html[data-theme="dark"] .data-table tbody tr:hover {
  background: rgba(6, 182, 212, 0.08);
}

html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-textarea,
html[data-theme="dark"] .search-box input,
html[data-theme="dark"] .price-input {
  background: #030712;
  border-color: rgba(30, 64, 175, 0.5);
  color: #ffffff;
}

html[data-theme="dark"] .form-input:focus,
html[data-theme="dark"] .form-select:focus,
html[data-theme="dark"] .form-textarea:focus,
html[data-theme="dark"] .search-box input:focus,
html[data-theme="dark"] .price-input:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

html[data-theme="dark"] .cat-chip {
  background: rgba(30, 64, 175, 0.28);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.45);
}

html[data-theme="dark"] .switch-btn {
  background: #334155;
}

html[data-theme="dark"] .switch-btn.is-on {
  background: linear-gradient(135deg, #1e40af 0%, #06b6d4 100%);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

html[data-theme="dark"] .mesa-box {
  background: #080f20;
  border-color: rgba(30, 64, 175, 0.42);
}

html[data-theme="dark"] .mesa-estado-libre {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.45);
}
html[data-theme="dark"] .mesa-estado-libre .mesa-status-pill {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}

html[data-theme="dark"] .mesa-estado-atendiendo,
html[data-theme="dark"] .mesa-estado-atendida {
  background: rgba(30, 64, 175, 0.22);
  border-color: rgba(6, 182, 212, 0.55);
}
html[data-theme="dark"] .mesa-estado-atendiendo .mesa-status-pill,
html[data-theme="dark"] .mesa-estado-atendida .mesa-status-pill {
  background: rgba(6, 182, 212, 0.22);
  color: #67e8f9;
}

html[data-theme="dark"] .mesa-estado-ocupada {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.48);
}
html[data-theme="dark"] .mesa-estado-ocupada .mesa-status-pill {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

html[data-theme="dark"] .mesa-estado-pide_cuenta,
html[data-theme="dark"] .mesa-estado-cuenta_solicitada {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.48);
}
html[data-theme="dark"] .mesa-estado-pide_cuenta .mesa-status-pill,
html[data-theme="dark"] .mesa-estado-cuenta_solicitada .mesa-status-pill {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}

html[data-theme="dark"] .kds-card {
  background: #0f172a;
}

html[data-theme="dark"] .kds-card.sla-normal {
  border-color: rgba(6, 182, 212, 0.45);
}
html[data-theme="dark"] .kds-card.sla-normal .kds-card-header {
  background: rgba(6, 182, 212, 0.1);
  border-bottom-color: rgba(6, 182, 212, 0.35);
}
html[data-theme="dark"] .kds-card.sla-alerta {
  border-color: rgba(245, 158, 11, 0.55);
}
html[data-theme="dark"] .kds-card.sla-alerta .kds-card-header {
  background: rgba(245, 158, 11, 0.14);
  border-bottom-color: rgba(245, 158, 11, 0.38);
}
html[data-theme="dark"] .kds-card.sla-critico {
  border-color: rgba(239, 68, 68, 0.65);
}
html[data-theme="dark"] .kds-card.sla-critico .kds-card-header {
  background: rgba(239, 68, 68, 0.16);
  border-bottom-color: rgba(239, 68, 68, 0.42);
}

html[data-theme="dark"] .kds-item-row {
  border-bottom-color: rgba(30, 64, 175, 0.3);
}
html[data-theme="dark"] .kds-item-name,
html[data-theme="dark"] .kds-card-table {
  color: #ffffff;
}
html[data-theme="dark"] .kds-item-qty {
  background: #1e40af;
  border: 1px solid #06b6d4;
}
html[data-theme="dark"] .kds-item-notes {
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
  border-left-color: #f59e0b;
}
html[data-theme="dark"] .kds-card-footer {
  background: #080f20;
  border-top-color: rgba(30, 64, 175, 0.36);
}

html[data-theme="dark"] .badge-primary {
  background: rgba(30, 64, 175, 0.3);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.45);
}
html[data-theme="dark"] .badge-success,
html[data-theme="dark"] .badge-impreso {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}
html[data-theme="dark"] .badge-warning,
html[data-theme="dark"] .badge-pendiente {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.45);
}
html[data-theme="dark"] .badge-danger,
html[data-theme="dark"] .badge-fallido {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
}
html[data-theme="dark"] .badge-outline {
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.35);
}
html[data-theme="dark"] .badge-tipo-comanda,
html[data-theme="dark"] .badge-barra-fria,
html[data-theme="dark"] .badge-subtitulo {
  background: rgba(6, 182, 212, 0.16);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.45);
}
html[data-theme="dark"] .badge-tipo-precuenta,
html[data-theme="dark"] .badge-bebidas {
  background: rgba(139, 92, 246, 0.2);
  color: #ddd6fe;
  border-color: rgba(167, 139, 250, 0.45);
}
html[data-theme="dark"] .badge-cocina-caliente {
  background: rgba(249, 115, 22, 0.2);
  color: #fdba74;
  border-color: rgba(251, 146, 60, 0.45);
}
html[data-theme="dark"] .badge-postres {
  background: rgba(234, 179, 8, 0.2);
  color: #fde047;
  border-color: rgba(250, 204, 21, 0.45);
}

html[data-theme="dark"] .stock-pill-ok,
html[data-theme="dark"] .mov-tipo-carga_diaria {
  background: rgba(30, 64, 175, 0.28);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.45);
}
html[data-theme="dark"] .stock-pill-low,
html[data-theme="dark"] .mov-tipo-ajuste {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.45);
}
html[data-theme="dark"] .stock-pill-zero,
html[data-theme="dark"] .mov-tipo-salida_venta {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.45);
}
html[data-theme="dark"] .stock-pill-free {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.35);
}
html[data-theme="dark"] .mov-tipo-reversion {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}

html[data-theme="dark"] .metodo-efectivo {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}
html[data-theme="dark"] .metodo-yape {
  background: rgba(139, 92, 246, 0.22);
  color: #ddd6fe;
  border-color: rgba(167, 139, 250, 0.45);
}
html[data-theme="dark"] .metodo-plin {
  background: rgba(6, 182, 212, 0.18);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.45);
}
html[data-theme="dark"] .metodo-tarjeta {
  background: rgba(30, 64, 175, 0.28);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.45);
}
html[data-theme="dark"] .pay-bar-track {
  background: #1e293b;
}

html[data-theme="dark"] .ticket-preview-row {
  background: #080f20;
}
html[data-theme="dark"] .ticket-80mm-preview {
  background: #030712;
  color: #e2e8f0;
  border-color: rgba(6, 182, 212, 0.45);
}
html[data-theme="dark"] .section-divider {
  border-top-color: rgba(30, 64, 175, 0.45) !important;
}
html[data-theme="dark"] .pesca-item {
  border-bottom-color: rgba(30, 64, 175, 0.25);
}
html[data-theme="dark"] .flash-msg {
  background: #0f172a;
  color: #ffffff;
}
html[data-theme="dark"] code {
  background: rgba(30, 64, 175, 0.28);
  color: #67e8f9;
  padding: 1px 5px;
  border-radius: 4px;
}

html[data-theme="dark"] .arqueo-preview-box {
  background: #080f20;
  color: #ffffff;
}
html[data-theme="dark"] .arqueo-preview-box.is-cuadrado,
html[data-theme="dark"] .flash-msg.success {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.48);
  color: #6ee7b7;
}
html[data-theme="dark"] .arqueo-preview-box.is-sobrante,
html[data-theme="dark"] .flash-msg.warning {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.48);
  color: #fcd34d;
}
html[data-theme="dark"] .arqueo-preview-box.is-faltante,
html[data-theme="dark"] .flash-msg.error {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.48);
  color: #fca5a5;
}

html[data-theme="dark"] .ped-status-pendiente {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
}
html[data-theme="dark"] .ped-status-cocinando {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}
html[data-theme="dark"] .ped-status-listo {
  background: rgba(6, 182, 212, 0.2);
  color: #67e8f9;
}
html[data-theme="dark"] .ped-status-servido,
html[data-theme="dark"] .ped-status-cobrado {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}
html[data-theme="dark"] .login-shell {
  background:
    radial-gradient(circle at 20% 20%, rgba(30, 64, 175, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.18) 0%, transparent 45%),
    #030712;
}
html[data-theme="dark"] .user-name,
html[data-theme="dark"] .brand-title,
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .operativo-heading,
html[data-theme="dark"] .kpi-value,
html[data-theme="dark"] .op-kpi-value,
html[data-theme="dark"] .dish-name,
html[data-theme="dark"] .strip-item strong {
  color: #ffffff;
}


