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

/* Clase utilitaria — usada en JS para ocultar cualquier elemento */
.hidden { display: none !important; }

:root {
  --grad-a: #d93540;
  --grad-b: #f0770a;
  --surface: #ffffff;
  --surface2: #f5f5f8;
  --surface3: #ceced4;
  --border: rgba(0,0,0,0.08);
  --border2: rgba(0,0,0,0.13);
  --accent: #d93540;
  --accent2: #f0770a;
  --text: #1a1a2e;
  --text2: #6b6b82;
  --text3: #adadbe;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #d97706;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.13);
  --shadow-lg: 0 16px 56px rgba(0,0,0,0.22);
}

/* ── MODO OSCURO ────────────────────────────────────────────── */
:root.dark {
  --grad-a: #6e1a20;
  --grad-b: #b95000;
  --surface: #1c1c1e;
  --surface2: #2c2c2e;
  --surface3: #3a3a3c;
  --border: rgba(255,255,255,0.09);
  --border2: rgba(255,255,255,0.15);
  --text: #f5f5f7;
  --text2: rgba(235,235,245,0.60);
  --text3: rgba(235,235,245,0.30);
  --shadow: 0 4px 20px rgba(0,0,0,0.50);
  --shadow-lg: 0 16px 56px rgba(0,0,0,0.70);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(135deg, var(--grad-a) 0%, var(--grad-b) 100%);
  background-attachment: fixed;
  color: var(--text);
  overflow: hidden;
}

/* ── SCREENS ── */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.screen.hidden { display: none; }

/* ── AUTH SCREEN ── */
#screen-auth {
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  margin: 16px;
  box-shadow: var(--shadow-lg);
}

/* ── CONFIRM EMAIL SCREEN ── */
#screen-confirm-email {
  align-items: center;
  justify-content: center;
}

.confirm-email-icon {
  width: 64px; height: 64px;
  background: rgba(217,53,64,0.1);
  border: 1px solid rgba(217,53,64,0.2);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  color: var(--accent);
}

.confirm-email-icon svg { width: 30px; height: 30px; }

.confirm-email-addr {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-bottom: 20px;
  word-break: break-all;
}

.confirm-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.confirm-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text2);
}

.confirm-step-num {
  width: 24px; height: 24px;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}

.auth-logo .logo-icon svg { width: 22px; height: 22px; }
.auth-logo span { font-size: 18px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); }

.auth-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.auth-card p { font-size: 14px; color: var(--text2); margin-bottom: 24px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--text3); }

/* ── BUTTONS ── */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 16px rgba(217,53,64,0.35);
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover { background: var(--surface3); }

.btn-icon {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 9px;
  color: rgba(255,255,255,0.9);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-icon:hover { background: rgba(255,255,255,0.28); }

/* btn-icon inside modal (light bg context) */
.modal .btn-icon {
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  color: var(--text2);
}
.modal .btn-icon:hover { background: var(--surface3); color: var(--text); }

/* Botón cerrar estilo macOS */
.btn-close-mac {
  width: 14px; height: 14px;
  background: #ff5f57;
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: opacity 0.15s, transform 0.1s;
  display: flex; align-items: center; justify-content: center;
}

.btn-close-mac:hover  { opacity: 0.82; }
.btn-close-mac:active { transform: scale(0.88); }

.btn-danger {
  background: rgba(220,38,38,0.08);
  color: var(--red);
  border: 1px solid rgba(220,38,38,0.2);
  border-radius: 8px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
  font-size: 14px;
}

.btn-danger:hover { background: rgba(220,38,38,0.16); }

.btn-outline {
  background: transparent;
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-outline:hover { background: var(--surface2); color: var(--text); }

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  flex: 1;
  justify-content: center;
}

.btn-whatsapp:hover  { opacity: 0.88; }
.btn-whatsapp:active { transform: scale(0.98); }

/* ── ONBOARDING ── */
#screen-onboarding {
  align-items: center;
  justify-content: center;
}

.onboard-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px;
  width: 100%;
  max-width: 460px;
  margin: 16px;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  max-height: calc(100vh - 32px);
}

.step-indicator {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
}

.step-dot {
  height: 4px;
  border-radius: 2px;
  background: var(--surface3);
  flex: 1;
  transition: background 0.3s;
}

.step-dot.active { background: linear-gradient(90deg, var(--grad-a), var(--grad-b)); }

.onboard-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.onboard-card > p { font-size: 14px; color: var(--text2); margin-bottom: 24px; }

.flow-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }

.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
}

.flow-step-num {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}

.flow-step-text strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 2px; color: var(--text); }
.flow-step-text span { font-size: 12px; color: var(--text2); }

/* ── DASHBOARD ── */
#screen-dashboard {
  background: transparent;
}

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  flex-shrink: 0;
}

.dash-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-logo .logo-wordmark {
  display: flex;
  flex-direction: column;
}

.dash-logo .logo-brand {
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1;
}

.dash-logo .logo-module {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.dash-body {
  flex: 1;
  overflow-y: auto;
  padding: 36px 20px 100px;
}

.dash-greeting {
  margin-bottom: 32px;
  text-align: center;
}

.dash-greeting h2 {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  color: #ffffff;
  line-height: 1.1;
}

.dash-date {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  font-weight: 400;
  letter-spacing: 0.1px;
  text-align: center;
}

.dash-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 8px;
  font-weight: 500;
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  flex-shrink: 0;
}

.status-dot.yellow { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.status-dot.red { background: var(--red); box-shadow: 0 0 6px var(--red); }
.status-dot.gray { background: rgba(255,255,255,0.4); box-shadow: none; }

/* Status dot inside modal (light bg) */
.modal .status-dot.gray { background: var(--text3); box-shadow: none; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 420px;
}

@media (min-width: 700px) {
  .action-grid { grid-template-columns: repeat(4, 1fr); max-width: 780px; }
}

.action-card {
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 22px;
  padding: 0;
  aspect-ratio: 1;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
  transition: background 0.18s, transform 0.15s;
  overflow: hidden;
}

.action-card:hover  { background: rgba(255,255,255,0.22); transform: scale(1.03); }
.action-card:active { transform: scale(0.96); }

.action-card .card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.92);
}

.action-card .card-icon svg { width: 52px; height: 52px; }

.action-card h3 {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  text-align: center;
  letter-spacing: 0.1px;
  padding: 0 8px;
}

/* ── Badge de completado en tarjeta ── */
.card-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,255,255,0.9);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.card-badge--count {
  color: var(--accent);
  font-size: 9px;
  width: 22px; height: 22px;
}

.dash-section-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.65);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.stat-card {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  backdrop-filter: blur(6px);
}

.stat-card .stat-val {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.stat-card .stat-label {
  font-size: 10px;
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.manage-btn {
  width: 100%;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
  backdrop-filter: blur(6px);
}

.manage-btn:hover { background: rgba(255,255,255,0.26); }
.manage-btn svg { color: rgba(255,255,255,0.6); }

/* ── MODAL SYSTEM ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,5,5,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}

.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border-radius: 20px;
  width: 100%;
  max-width: 700px;
  max-height: 82vh;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.06);
  transform: scale(0.94) translateY(16px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.2s;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-handle { display: none; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 0;
  flex-shrink: 0;
}

.modal-header-left { display: flex; align-items: center; gap: 10px; }
.modal-title { font-size: 17px; font-weight: 800; color: var(--text); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px;
}

.modal-footer {
  padding: 0 24px 20px;
  flex-shrink: 0;
  display: flex;
  gap: 10px;
}

.modal-footer .btn-primary { flex: 1; }

/* ── TABLA INVENTARIO ── */
.inv-table { width: 100%; border-collapse: separate; border-spacing: 0; }

.inv-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 0 14px 10px;
  text-align: left;
}

.inv-table td { padding: 5px 14px; }

.inv-row { transition: background 0.1s; }
.inv-row:nth-child(even) td { background: var(--surface2); }
.inv-row:nth-child(even) td:first-child { border-radius: 8px 0 0 8px; }
.inv-row:nth-child(even) td:last-child { border-radius: 0 8px 8px 0; }
.inv-row td { vertical-align: middle; }

.insumo-name { font-size: 14px; font-weight: 600; color: var(--text); }
.insumo-unit { font-size: 11px; color: var(--text3); }

.qty-input {
  width: 90px;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  padding: 8px 10px;
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
}

.qty-input:focus { border-color: var(--accent); }
.qty-input::placeholder { color: var(--text3); font-weight: 400; font-size: 13px; }

/* ── SALIDAS MODAL ── */
.salidas-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 340px;
}

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

.salidas-left, .salidas-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.salidas-right {
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.salidas-right-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.search-input-wrap {
  position: relative;
  flex-shrink: 0;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  width: 16px; height: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px 10px 36px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text3); }

.insumo-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }

.insumo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: 8px;
  gap: 8px;
  transition: background 0.1s;
}

.insumo-item:hover { background: var(--surface3); }

.insumo-item-info .name { font-size: 13px; font-weight: 600; color: var(--text); }
.insumo-item-info .stock { font-size: 11px; color: var(--text3); }

.insumo-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.qty-mini {
  width: 60px;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 8px;
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
}

.qty-mini:focus { border-color: var(--accent); }

.btn-add {
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  box-shadow: 0 2px 8px rgba(217,53,64,0.3);
}

.btn-add:hover { opacity: 0.88; }

.cart-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 13px;
  gap: 8px;
  padding: 20px 0;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  gap: 8px;
}

.cart-item-info .qty { font-size: 13px; font-weight: 700; color: var(--accent); }
.cart-item-info .name { font-size: 12px; color: var(--text2); }

/* ── CORTE TABLE ── */
.corte-table { width: 100%; border-collapse: separate; border-spacing: 0 3px; }

.corte-table th {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0 8px 8px;
  text-align: center;
  white-space: nowrap;
}

.corte-table th:first-child { text-align: left; padding-left: 12px; }

.corte-table td {
  padding: 9px 8px;
  text-align: center;
  font-size: 13px;
  background: var(--surface2);
  color: var(--text);
}

.corte-table tr td:first-child {
  text-align: left;
  border-radius: 8px 0 0 8px;
  font-weight: 600;
  padding-left: 12px;
}
.corte-table tr td:last-child { border-radius: 0 8px 8px 0; }

.diff-pos  { color: var(--green); font-weight: 700; }
.diff-neg  { color: var(--red);   font-weight: 700; }
.diff-zero { color: var(--text3); }
.loss-val  { color: var(--red);   font-weight: 700; }
.loss-zero { color: var(--text3); }

.corte-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.corte-stat {
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
}

.corte-stat.ok   { background: rgba(22,163,74,0.08);   border: 1.5px solid rgba(22,163,74,0.18); }
.corte-stat.warn { background: rgba(217,119,6,0.08);   border: 1.5px solid rgba(217,119,6,0.18); }
.corte-stat.loss { background: rgba(220,38,38,0.07);   border: 1.5px solid rgba(220,38,38,0.18); }

.corte-stat .val { font-size: 22px; font-weight: 900; letter-spacing: -0.5px; }
.corte-stat .lbl { font-size: 11px; color: var(--text3); margin-top: 3px; font-weight: 600; }

/* ── AJUSTE APERTURA BANNER ── */
.ajuste-apertura-banner {
  background: rgba(220,38,38,0.06);
  border: 1.5px solid rgba(220,38,38,0.22);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ajuste-apertura-banner-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}
.ajuste-apertura-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.ajuste-apertura-name { flex: 1; font-weight: 600; color: var(--text); }
.ajuste-apertura-diff { font-weight: 700; }
.ajuste-apertura-loss { color: var(--red); font-weight: 700; font-size: 12px; }

/* ── MANAGE INSUMOS ── */
.manage-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface2);
  border-radius: 10px;
  gap: 10px;
}

.manage-item-info .name { font-size: 14px; font-weight: 600; color: var(--text); }
.manage-item-info .meta { font-size: 12px; color: var(--text3); }

.add-insumo-form {
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.add-insumo-form .form-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 2px;
}

.add-insumo-form .form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 8px;
}

.add-insumo-form .form-row input,
.add-insumo-form .unit-select,
.onboard-card .form-row input,
.onboard-card .unit-select {
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 9px 10px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

.add-insumo-form .form-row input:focus,
.add-insumo-form .unit-select:focus,
.onboard-card .form-row input:focus,
.onboard-card .unit-select:focus { border-color: var(--accent); }

.add-insumo-form .form-row input::placeholder,
.onboard-card .form-row input::placeholder { color: var(--text3); }

.unit-select option { background: var(--surface); color: var(--text); }

/* ── TOASTS ── */
#toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  color: var(--text);
}

.toast.success { border-color: rgba(22,163,74,0.3);  color: var(--green); }
.toast.error   { border-color: rgba(220,38,38,0.3);  color: var(--red);   }
.toast.info    { border-color: rgba(217,53,64,0.25); color: var(--accent);}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }

/* ── UTILITIES ── */
.divider { height: 1px; background: var(--border); margin: 14px 0; }

.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text3);
  font-size: 13px;
}

.empty-state svg { width: 36px; height: 36px; margin-bottom: 10px; opacity: 0.4; }
.empty-state p { line-height: 1.6; }

/* ── LOADING OVERLAY ── */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(180,60,40,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── AUTH TOGGLE ── */
.auth-toggle {
  text-align: center;
  margin-top: 16px;
}

.auth-toggle a {
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.auth-toggle a:hover { text-decoration: underline; }

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: 32px;
  right: 24px;
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.95);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, background 0.15s;
  z-index: 50;
}

.fab:hover  { background: rgba(255,255,255,0.26); transform: scale(1.07); }
.fab:active { transform: scale(0.93); }

/* ── SIDEBAR ── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,5,5,0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}

.sidebar-overlay.active { opacity: 1; pointer-events: all; }

.sidebar {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 300px;
  max-width: 88vw;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  border-radius: 24px 0 0 24px;
  box-shadow: -12px 0 60px rgba(0,0,0,0.2);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.sidebar-overlay.active .sidebar { transform: translateX(0); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-title { font-size: 17px; font-weight: 800; color: var(--text); }

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 32px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding: 0 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.14s;
  color: var(--text);
}

.sidebar-item:hover { background: var(--surface2); }

.sidebar-item--disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.sidebar-item-icon {
  width: 40px; height: 40px;
  background: var(--surface2);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.sidebar-item--disabled .sidebar-item-icon { color: var(--text3); }

.sidebar-item-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sidebar-item-title { font-size: 14px; font-weight: 600; color: var(--text); }
.sidebar-item-sub   { font-size: 12px; color: var(--text3); }

.sidebar-chevron { color: var(--text3); flex-shrink: 0; }

/* ── DARK MODE TOGGLE (sidebar) ── */
.sidebar-footer {
  padding: 12px 16px 28px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.dark-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.14s;
  user-select: none;
}
.dark-toggle-row:hover { background: var(--surface2); }

.dark-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.dark-toggle-icon {
  width: 40px; height: 40px;
  background: var(--surface2);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  font-size: 18px;
}

/* Pill switch */
.dark-toggle-pill {
  width: 44px;
  height: 26px;
  background: var(--surface3);
  border-radius: 13px;
  position: relative;
  transition: background 0.22s;
  flex-shrink: 0;
}
.dark-toggle-pill::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
:root.dark .dark-toggle-pill {
  background: var(--accent);
}
:root.dark .dark-toggle-pill::after {
  transform: translateX(18px);
}

/* ── inputs dentro de contenedores surface2 ── */
.add-insumo-form .field input {
  background: var(--surface);
}

/* ── Onboard form fields (card ya es white, surface2 está bien) ── */
.onboard-card .field input {
  background: var(--surface2);
}

/* ── APP LOGO ── */
.app-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

/* ── DASHBOARD BUSINESS NAME ── */
.dash-business {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  font-weight: 400;
  letter-spacing: 0.2px;
  margin-bottom: 4px;
  text-align: center;
}

/* ── TURNO GRID WRAPPER ── */
.dash-grid-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* Disable cards when no active turno */
[data-turno-state="inactive"] .action-grid {
  opacity: 0.3;
  pointer-events: none;
}

/* ── NO TURNO CTA ── */
.no-turno-cta {
  width: 100%;
  max-width: 680px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 18px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.no-turno-cta p {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  margin: 0;
}

.btn-turno-crear {
  background: #ffffff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

.btn-turno-crear:hover  { opacity: 0.88; }
.btn-turno-crear:active { transform: scale(0.97); }

/* ── CERRAR TURNO BUTTON ── */
.btn-cerrar-turno {
  background: rgba(220,38,38,0.12);
  border: 1.5px solid rgba(220,38,38,0.3);
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.btn-cerrar-turno:hover  { background: rgba(220,38,38,0.22); }
.btn-cerrar-turno:active { transform: scale(0.97); }

/* ── RECOMENDACIONES BUTTON ── */
.btn-recomendaciones {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.28);
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  letter-spacing: 0.2px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-recomendaciones svg { flex-shrink: 0; opacity: 0.8; }
.btn-recomendaciones:hover  { background: rgba(245,158,11,0.20); color: rgba(255,255,255,0.95); }
.btn-recomendaciones:active { transform: scale(0.96); }

/* ── RECOMENDACIONES MODAL ── */
.rec-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text2);
  margin: 0 0 8px;
}

.rec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  gap: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.rec-item:hover { background: var(--surface3, rgba(255,255,255,0.06)); }

.rec-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text1);
}

.rec-item-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(245,158,11,0.14);
  color: rgba(245,158,11,0.9);
  flex-shrink: 0;
}

.rec-chevron {
  color: var(--text2);
  opacity: 0.5;
  flex-shrink: 0;
}

.rec-group { margin-bottom: 20px; }
.rec-group:last-child { margin-bottom: 0; }

.rec-empty {
  text-align: center;
  color: var(--text2);
  font-size: 14px;
  padding: 32px 0;
}

/* ── TURNO LIST ITEMS ── */
.turno-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  gap: 10px;
  margin-bottom: 6px;
}

.turno-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.turno-item-fecha {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: capitalize;
}

.turno-badge-estado {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.turno-badge-estado.abierto {
  background: rgba(22,163,74,0.1);
  color: var(--green);
  border: 1px solid rgba(22,163,74,0.2);
}

.turno-badge-estado.cerrado {
  background: rgba(107,107,130,0.1);
  color: var(--text3);
  border: 1px solid rgba(107,107,130,0.18);
}

/* ── PROVEEDORES ── */
.prov-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  gap: 10px;
  margin-bottom: 6px;
  cursor: default;
}

.prov-item-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.prov-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.prov-item-meta {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
}

.prov-detalle-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.prov-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 9px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.prov-back-btn:hover { background: var(--surface3); color: var(--text); }

.prov-detalle-tr {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}

.prov-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.prov-assign-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── INSUMOS MODAL REDESIGN ── */
.insumos-stats-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.ins-stat-item {
  flex: 1;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.ins-stat-val {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text);
}

.ins-stat-lbl {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.insumos-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.insumos-toolbar-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-sm-add {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(var(--accent-rgb, 99,102,241), 0.12);
  border: 1.5px solid rgba(var(--accent-rgb, 99,102,241), 0.25);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-sm-add:active { opacity: 0.7; }

.insumos-mgr-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 3px;
}

.insumos-mgr-table thead th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 6px 10px;
  text-align: center;
}

.insumos-mgr-table thead th:first-child { text-align: left; padding-left: 12px; }

.insumos-mgr-row {
  cursor: pointer;
  transition: opacity 0.15s;
}

.insumos-mgr-row:active { opacity: 0.7; }

.insumos-mgr-row td {
  background: var(--surface2);
  padding: 11px 10px;
  font-size: 13px;
  color: var(--text);
  text-align: center;
}

.insumos-mgr-row td:first-child {
  border-radius: 8px 0 0 8px;
  padding-left: 12px;
  text-align: left;
}

.insumos-mgr-row td:last-child { border-radius: 0 8px 8px 0; }

.insumos-mgr-name { font-weight: 600; }
.insumos-mgr-unit { font-size: 12px; color: var(--text3); }
.ins-stock-val    { font-weight: 700; color: var(--accent); }
.ins-stock-empty  { color: var(--text3); }
.insumos-mgr-arrow { color: var(--text3); width: 24px; }

/* ── WINDOWED MODALS ── */
.modal.windowed {
  position: fixed !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 0 !important;
  transform: none !important;
  margin: 0 !important;
  overflow: hidden;
}

/* Entry animation for returning windowed modal: fade only */
/* Modales tipo ventana: el overlay es transparente y no bloquea la UI */
.modal-overlay {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.modal-overlay.active {
  pointer-events: none;
}
.modal-overlay.active .modal {
  pointer-events: all;
}

.modal-overlay.active .modal.windowed {
  transform: none !important;
  opacity: 1;
}

.modal.windowed.maximized {
  left: 0 !important;
  top: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
}

.modal.windowed .modal-header {
  cursor: move;
  user-select: none;
}

.modal.windowed.maximized .modal-header {
  cursor: default;
}

/* ── Header controls (close + max buttons) ── */
.modal-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Green macOS-style maximize button */
.btn-max-mac {
  width: 14px;
  height: 14px;
  background: #27c93f;
  border: 1.5px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: opacity 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.btn-max-mac:hover  { opacity: 0.82; }
.btn-max-mac:active { transform: scale(0.88); }

/* Hide icon by default, show on hover */
.btn-max-mac .max-icon { opacity: 0; transition: opacity 0.1s; }
.btn-max-mac:hover .max-icon { opacity: 1; }

/* Resize handles */
.modal-resize-handle {
  position: absolute;
  z-index: 10;
}
.modal-resize-handle[data-dir="n"]  { top: -5px;    left: 16px;  right: 16px; height: 10px; cursor: n-resize; }
.modal-resize-handle[data-dir="s"]  { bottom: -5px; left: 16px;  right: 16px; height: 10px; cursor: s-resize; }
.modal-resize-handle[data-dir="e"]  { right: -5px;  top: 16px; bottom: 16px;  width: 10px;  cursor: e-resize; }
.modal-resize-handle[data-dir="w"]  { left: -5px;   top: 16px; bottom: 16px;  width: 10px;  cursor: w-resize; }
.modal-resize-handle[data-dir="ne"] { top: -5px;    right: -5px;   width: 20px; height: 20px; cursor: ne-resize; }
.modal-resize-handle[data-dir="nw"] { top: -5px;    left: -5px;    width: 20px; height: 20px; cursor: nw-resize; }
.modal-resize-handle[data-dir="se"] { bottom: -5px; right: -5px;   width: 20px; height: 20px; cursor: se-resize; }
.modal-resize-handle[data-dir="sw"] { bottom: -5px; left: -5px;    width: 20px; height: 20px; cursor: sw-resize; }

/* ── Snap ghost preview ── */
#win-snap-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: rgba(217,53,64,0.06);
  border: 2px solid transparent;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

#win-snap-ghost.snapping {
  border-color: rgba(217,53,64,0.45);
  box-shadow:
    inset 0 0 60px rgba(217,53,64,0.07),
    0 0 0 1px rgba(217,53,64,0.12);
  animation: snapBreath 0.85s ease-in-out infinite alternate;
}

@keyframes snapBreath {
  from {
    background: rgba(217,53,64,0.04);
    border-color: rgba(217,53,64,0.3);
    box-shadow: inset 0 0 40px rgba(217,53,64,0.05), 0 0 24px rgba(217,53,64,0.08);
  }
  to {
    background: rgba(217,53,64,0.09);
    border-color: rgba(217,53,64,0.65);
    box-shadow: inset 0 0 80px rgba(217,53,64,0.1), 0 0 48px rgba(217,53,64,0.15);
  }
}

/* ── Edge glow bar ── */
#win-edge-bar {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.12s ease;
}

#win-edge-bar.top {
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--accent) 25%,
    var(--accent) 75%,
    transparent 100%);
  box-shadow: 0 0 20px var(--accent), 0 2px 12px rgba(217,53,64,0.5);
  animation: edgePulse 0.8s ease-in-out infinite alternate;
}

#win-edge-bar.left {
  top: 0; left: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--accent) 25%,
    var(--accent) 75%,
    transparent 100%);
  box-shadow: 0 0 20px var(--accent), 2px 0 12px rgba(217,53,64,0.5);
  animation: edgePulse 0.8s ease-in-out infinite alternate;
}

#win-edge-bar.right {
  top: 0; right: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--accent) 25%,
    var(--accent) 75%,
    transparent 100%);
  box-shadow: 0 0 20px var(--accent), -2px 0 12px rgba(217,53,64,0.5);
  animation: edgePulse 0.8s ease-in-out infinite alternate;
}

@keyframes edgePulse {
  from { opacity: 0.7; }
  to   { opacity: 1;   }
}

/* ── STOCK ACTUAL ─────────────────────────────────────────── */

/* ── TURNOS FILTER ────────────────────────────────────────── */
.turnos-filter-bar {
  display: flex;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--surface3);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.turno-filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--surface3);
  background: var(--surface2);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.turno-filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.turno-filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── PREDICCIONES DETALLE ─────────────────────────────────── */
.pred-row-clickable { cursor: pointer; }
.pred-row-clickable:hover td { background: var(--surface2); }
.pred-spark--clickable { cursor: pointer; }
.pred-detail-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.pred-detail-bar {
  width: 100%;
  min-width: 24px;
  border-radius: 4px 4px 0 0;
  background: var(--surface3);
  transition: height 0.3s;
}
.pred-detail-bar-lbl {
  font-size: 10px;
  color: var(--text3);
  white-space: nowrap;
}

/* ── STOCK ACTUAL ─────────────────────────────────────────── */
.stock-td { vertical-align: middle; padding: 10px; white-space: nowrap; }

.stock-qty          { font-size: 15px; font-weight: 700; }
.stock-qty--ok      { color: var(--green); }
.stock-qty--bajo    { color: var(--accent2); }
.stock-qty--critico { color: var(--accent); }
.stock-unit         { font-size: 11px; color: var(--text2); }

.stock-fecha {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}

.stock-cpd-val { font-size: 13px; font-weight: 600; color: var(--text); }

.stock-dias          { font-size: 13px; font-weight: 600; }
.stock-dias--critico { color: var(--accent); }
.stock-dias--bajo    { color: var(--accent2); }

.stock-pedido {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.pred-stat--warn .pred-stat-val { color: var(--accent2); }

.pred-badge--critico { background: rgba(217,53,64,0.15); color: var(--accent); }
.pred-badge--bajo    { background: rgba(240,119,10,0.13); color: var(--accent2); }

/* ── GENERAR ÓRDENES ─────────────────────────────────────── */

.stock-ordenes-bar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 0 4px;
}

.btn-generar-ordenes {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-generar-ordenes:hover  { background: #b91c1c; }
.btn-generar-ordenes:active { transform: scale(0.97); }

.ordenes-badge {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 700;
}

/* Dialog */
.ordenes-dialogo {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 0 24px;
}

.ordenes-dialogo-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ordenes-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.12s;
}
.ordenes-back-btn:hover { background: var(--surface2); }

.ordenes-titulo {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.ordenes-seccion {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.ordenes-desc {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 18px;
  line-height: 1.5;
}

.ordenes-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.ordenes-periodo-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.ordenes-num-input {
  width: 90px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.ordenes-num-input:focus { border-color: var(--accent); }

.ordenes-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ordenes-select:focus { border-color: var(--accent); }

.ordenes-preview-dias {
  font-size: 12px;
  color: var(--text2);
  padding: 6px 10px;
  background: var(--surface3);
  border-radius: 6px;
  margin-top: 4px;
}

.ordenes-periodo-wrap { margin-bottom: 18px; }

.ordenes-prov-list { border-top: 1px solid var(--border); padding-top: 14px; }

.ordenes-prov-list-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  margin-bottom: 8px;
}

.orden-prov-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 6px;
}

.orden-prov-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.orden-prov-count { font-size: 11px; color: var(--text2); }

.ordenes-acciones {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-ordenes-cancelar {
  padding: 9px 18px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.12s;
}
.btn-ordenes-cancelar:hover { background: var(--surface2); }

.btn-ordenes-confirmar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-ordenes-confirmar:hover  { background: #b91c1c; }
.btn-ordenes-confirmar:active { transform: scale(0.97); }

/* ── PREDICCIONES ─────────────────────────────────────────── */

.pred-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text2);
  font-size: 14px;
}

.pred-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}
.pred-empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.25;
  color: var(--text2);
}
.pred-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.pred-empty-sub {
  font-size: 13px;
  color: var(--text2);
  margin: 0;
  max-width: 320px;
  line-height: 1.6;
}

/* Stats bar */
.pred-stats-bar {
  display: flex;
  gap: 0;
  background: var(--surface2);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}
.pred-stat {
  flex: 1;
  padding: 14px 12px;
  text-align: center;
  border-right: 1px solid var(--surface3);
}
.pred-stat:last-child { border-right: none; }
.pred-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.pred-stat-lbl {
  font-size: 11px;
  color: var(--text2);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pred-stat--alert .pred-stat-val { color: var(--accent); }
.pred-stat--ok .pred-stat-val    { color: var(--green); }

/* Table */
.pred-table-wrap { overflow-x: auto; }
.pred-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pred-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text2);
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--surface3);
  white-space: nowrap;
}
.pred-table tbody tr {
  border-bottom: 1px solid var(--surface2);
  transition: background 0.15s;
}
.pred-table tbody tr:hover { background: var(--surface2); }
.pred-table td { padding: 10px; vertical-align: middle; }

/* Columnas */
.pred-td-name   { min-width: 120px; }
.pred-td-spark  { min-width: 90px; }
.pred-td-pred   { min-width: 110px; white-space: nowrap; }
.pred-td-tend   { min-width: 90px; }
.pred-td-estado { min-width: 110px; }

.pred-ins-name {
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}
.pred-ins-meta {
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
}
.pred-prov-tag {
  color: var(--accent);
  font-weight: 600;
}

/* Sparkline */
.pred-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
}
.pred-bar-col {
  display: flex;
  align-items: flex-end;
  height: 32px;
}
.pred-bar {
  width: 8px;
  border-radius: 3px 3px 0 0;
  background: var(--surface3);
  transition: height 0.3s;
}
.pred-bar--last  { background: var(--accent); opacity: 0.85; }
.pred-bar--zero  { opacity: 0.3; }
.pred-nodata-lbl {
  font-size: 11px;
  color: var(--text3);
  font-style: italic;
}

/* Predicción valor */
.pred-pred-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.pred-pred-unit {
  font-size: 11px;
  color: var(--text2);
}

/* Tendencia */
.pred-tend {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.pred-tend--up      { background: rgba(22,163,74,0.12); color: var(--green); }
.pred-tend--down    { background: rgba(220,38,38,0.10); color: var(--red); }
.pred-tend--neutral { background: var(--surface3); color: var(--text2); }

/* Estado badges */
.pred-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.pred-badge--alert { background: rgba(217,53,64,0.12); color: var(--accent); }
.pred-badge--ok    { background: rgba(22,163,74,0.12); color: var(--green); }
.pred-badge--gray  { background: var(--surface3); color: var(--text3); }

/* ── print: ocultar todo menos la tabla del corte ── */
@media print {
  body { background: white !important; }
  .modal-overlay { position: static !important; opacity: 1 !important; pointer-events: all !important; background: none !important; }
  .modal { box-shadow: none !important; max-height: none !important; border-radius: 0 !important; }
  .modal-handle, .modal-header .btn-icon, .modal-footer, #screen-dashboard { display: none !important; }
  .corte-table td, .corte-table th { font-size: 11px; }
}
