/* --- GOOGLE FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600&display=swap');

/* --- VARIABLES GLOBALES --- */
:root {
  /* Dashboard Vars */
  --font-dash: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --orange: #E8500A;
  --orange-dark: #C4410A;
  --yellow: #F5A623;
  --bg-dash: #F2F2F2;
  --card-bg: #FFFFFF;
  --text-dash: #1A1A1A;
  --text-muted: #888;
  --radius-card: 14px;
  --radius-btn: 50px;
  --topbar-h: 60px;
  --bottombar-h: 70px;
  
  /* Login Vars */
  --brand: #D85A30; 
  --brand-dark: #993C1D;
  --bg-login: #F5F3EE; 
  --border: rgba(0,0,0,0.12); 
  --danger: #E24B4A;
  --warning-bg: #FAEEDA; 
  --warning-txt: #854F0B;
  --success: #1D9E75; 
  --radius-login: 10px;
}

/* --- RESET Y BASE --- */
html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  margin: 0; padding: 0;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* --- ESTILOS COMPARTIDOS (CUERPO) --- */
body.login-body {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: var(--bg-login);
  font-family: 'DM Sans', system-ui, sans-serif; padding: 1rem;
}

body.dash-body {
  font-family: var(--font-dash);
  background: var(--bg-dash);
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* --- LOGIN CSS (INDEX) --- */
.card {
  background: var(--card-bg); border-radius: var(--radius-login);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 2rem; width: 100%; max-width: 380px;
}
.brand { text-align: center; margin-bottom: 1.5rem; }
.brand h1 { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; color: var(--brand); letter-spacing: 3px; line-height: 1; }
.brand p { font-size: 0.68rem; color: var(--text-muted); letter-spacing: 4px; margin-top: 4px; font-weight: 500; }
hr { border: none; border-top: 1px solid var(--border); margin: 0 0 1.5rem; }
.field { margin-bottom: 1rem; }
label { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
label svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
input[type="tel"], input[type="password"] {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-login);
  font-size: 0.95rem; color: var(--text-dash); background: #FAFAF8; outline: none;
}
.rc-bar { display: flex; align-items: center; gap: 10px; background: #FAFAF8; border: 1px solid var(--border); border-radius: var(--radius-login); padding: 10px 12px; margin: 1rem 0; }
.rc-spinner { width: 22px; height: 22px; border: 2px solid #D0CFC8; border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
.rc-check { width: 22px; height: 22px; background: var(--success); border-radius: 50%; display: none; align-items: center; justify-content: center; }
.rc-check svg { width: 12px; height: 12px; stroke: white; fill: none; stroke-width: 3; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { border-radius: var(--radius-login); padding: 10px 12px; font-size: 0.8rem; display: none; gap: 8px; align-items: flex-start; margin-top: 0.5rem; }
.alert.show { display: flex; }
.alert.danger { background: #FFF0F0; color: #A32D2D; border: 1px solid #F7C1C1; }
.btn-submit { width: 100%; padding: 12px; background: var(--brand); color: #fff; border: none; border-radius: var(--radius-login); font-weight: 700; cursor: pointer; }
.btn-submit:disabled { opacity: 0.45; }
.attempts-bar { height: 3px; background: #E8E6E0; border-radius: 99px; margin-top: 8px; overflow: hidden; }
.attempts-fill { height: 100%; background: var(--brand); transition: width 0.3s; }
.sec-badges { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.badge { display: flex; align-items: center; gap: 6px; font-size: 0.7rem; color: var(--text-muted); }
.badge svg { width: 13px; height: 13px; stroke: var(--success); fill: none; stroke-width: 2.2; }
.role-badge { display: none; text-align: center; margin-top: 0.75rem; padding: 6px 12px; border-radius: 99px; font-size: 0.78rem; font-weight: 600; }
.role-cajas { background: #E6F1FB; color: #185FA5; }
.role-taquero { background: #FAEEDA; color: #854F0B; }
.role-antojitos { background: #E1F5EE; color: #0F6E56; }

/* --- DASHBOARD CSS --- */
.topbar { position: fixed; top: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: var(--topbar-h); background: var(--orange); display: flex; align-items: center; justify-content: space-between; padding: 0 16px; z-index: 100; }
.topbar-logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; color: #fff; text-transform: uppercase; }
.topbar-logo svg { width: 24px; height: 24px; stroke: #fff; fill: none; stroke-width: 2; }
.order-pill { display: none; align-items: center; gap: 8px; background: rgba(255,255,255,0.2); border-radius: var(--radius-btn); padding: 6px 14px 6px 10px; cursor: pointer; border: none; }
.order-pill.show { display: flex; }
.order-pill-count { background: #fff; color: var(--orange); font-size: 13px; font-weight: 700; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.order-pill-amount { color: #fff; font-size: 15px; font-weight: 700; }
.content { position: fixed; top: var(--topbar-h); bottom: var(--bottombar-h); left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; overflow-y: auto; padding: 16px 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.content::-webkit-scrollbar { display: none; }
.products-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.product-card { background: var(--card-bg); border-radius: var(--radius-card); padding: 14px 12px 12px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.06); transition: transform 0.12s; user-select: none; }
.product-card:active { transform: scale(0.97); }
.product-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.product-name { font-size: 16px; font-weight: 800; color: var(--text-dash); line-height: 1.2; flex: 1; }
.product-price { background: var(--text-dash); color: #fff; font-size: 13px; font-weight: 700; padding: 4px 9px; border-radius: 8px; }
.product-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bottombar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: var(--bottombar-h); background: #fff; display: flex; align-items: center; justify-content: space-around; border-top: 1px solid #E8E8E8; z-index: 100; padding-bottom: env(safe-area-inset-bottom); }
.tab-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; cursor: pointer; flex: 1; }
.tab-btn svg { width: 22px; height: 22px; stroke: #B0B0B0; fill: none; stroke-width: 1.8; }
.tab-btn span { font-size: 10px; font-weight: 500; color: #B0B0B0; text-transform: uppercase; }
.tab-btn.active svg { stroke: var(--orange); }
.tab-btn.active span { color: var(--orange); }
.tab-nuevo-btn { width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--orange); display: flex; align-items: center; justify-content: center; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: flex-end; justify-content: center; }
.overlay.show { display: flex; }
.overlay.center { align-items: center; }
.modal-product { background: #fff; border-radius: 24px 24px 0 0; padding: 20px 20px 32px; width: 100%; max-width: 480px; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.modal-close { width: 30px; height: 30px; border-radius: 50%; background: #F0F0F0; border: none; display: flex; align-items: center; justify-content: center; color: #888; }
.modal-product-name { font-size: 20px; font-weight: 700; color: var(--text-dash); }
.counter { display: flex; align-items: center; justify-content: center; gap: 24px; margin-bottom: 20px; }
.counter-btn { width: 48px; height: 48px; border-radius: 50%; border: none; font-size: 24px; display: flex; align-items: center; justify-content: center; }
.counter-minus { background: #EFEFEF; }
.counter-plus { background: var(--orange); color: #fff; }
.counter-num { font-size: 36px; font-weight: 700; min-width: 40px; text-align: center; }
.notes-input { width: 100%; border: 1.5px solid #E8E8E8; border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: none; }
.modal-total { background: #FFF4EE; border-radius: 12px; padding: 14px; text-align: center; margin: 16px 0; }
.modal-total-amount { font-size: 28px; font-weight: 700; color: var(--orange); }
.modal-actions { display: flex; gap: 12px; }
.btn-add { flex: 2; padding: 14px; background: var(--yellow); border: none; border-radius: var(--radius-btn); font-size: 15px; font-weight: 700; color: #fff; cursor: pointer; }

/* MODAL RESUMEN */
.modal-summary { background: #fff; border-radius: 24px; padding: 20px; width: calc(100% - 32px); max-width: 420px; }
.summary-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #F8F8F8; }
.summary-total-amount { font-size: 26px; font-weight: 700; }
.btn-kitchen { width: 100%; padding: 16px; background: var(--orange); border: none; border-radius: var(--radius-btn); font-size: 15px; font-weight: 700; color: #fff; text-transform: uppercase; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
