@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* ── ToraTita Premium — Gold & Obsidian ── */
  --gold: #D4AF37;
  --gold-light: #F9E076;
  --gold-dark: #9A7B4F;
  --gold-glow: rgba(212, 175, 55, 0.12);
  --obsidian: #050505;
  --panel: #0A0A0A;
  --surface: #121212;
  --surface-hover: #1A1A1A;

  /* Semántico */
  --primary: var(--gold);
  --primary-dark: var(--gold-dark);
  --primary-glow: var(--gold-glow);
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;

  /* Fondos */
  --bg: var(--obsidian);
  --bg-2: var(--panel);
  --bg-card: var(--surface);
  --bg-hover: var(--surface-hover);
  --border: rgba(255, 255, 255, 0.05);
  --border-gold: rgba(212, 175, 55, 0.2);

  /* Texto */
  --text: #FFFFFF;
  --text-muted: #808080;
  --text-light: #B3B3B3;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  background: radial-gradient(circle at top right, #101010, #050505);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── SCROLLBAR ───────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-card);
}

::-webkit-scrollbar-thumb {
  background: var(--border-amber);
  border-radius: 3px;
}

/* ── CARDS ───────────────────────────────────── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), var(--shadow-gold);
}

.card-sm {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
}

.card-amber {
  border-color: var(--border-amber);
  background: linear-gradient(135deg, rgba(224, 164, 88, 0.05) 0%, var(--bg-card) 100%);
}

.card-glass {
  backdrop-filter: blur(12px);
  background: rgba(24, 27, 34, 0.7);
}

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: #000;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #FF4B4B, #8B0000);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(1.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
}

.btn-success:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-info {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-light);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: 12px;
}

.btn-xl {
  padding: 18px 32px;
  font-size: 1.1rem;
  border-radius: 14px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.w-full {
  width: 100%;
}

/* ── FORMS ───────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.input,
.select,
textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  color-scheme: dark;
}

.input:focus,
.select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.select option,
.input option,
option {
  background-color: var(--bg-card, #121212);
  color: var(--text, #ffffff);
}

.input::placeholder {
  color: var(--text-muted);
}

textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

/* ── ALERTS ──────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.alert-danger {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fca5a5;
}

.alert-success {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fde68a;
}

.alert-info {
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.25);
  color: #93c5fd;
}

/* ── LAYOUT ──────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR (DESKTOP - ADMIN) ───────────────── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(224, 164, 88, 0.06) 0%, transparent 100%);
}

.sidebar-brand .logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.sidebar-brand .brand-icon {
  font-size: 2.2rem;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.2);
}

.sidebar-brand h1 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sidebar-brand h1 span {
  color: var(--primary);
}

.sidebar-brand .tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar-brand .rol-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid var(--border-amber);
  text-transform: uppercase;
}

.sidebar nav {
  padding: 12px 0;
  flex: 1;
}

.sidebar nav .nav-section {
  padding: 16px 20px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.87rem;
  font-weight: 500;
  transition: all 0.15s;
  border-right: 3px solid transparent;
  margin: 1px 0;
}

.sidebar nav a .nav-icon {
  width: 20px;
  text-align: center;
  font-size: .85rem;
}

.sidebar nav a:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.sidebar nav a.active {
  color: var(--primary);
  background: var(--primary-glow);
  border-right-color: var(--primary);
}

.sidebar nav a .notif-pill {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  display: none;
}

.sidebar nav a .notif-pill.show {
  display: inline-block;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-footer .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.sidebar-footer .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-glow);
  border: 2px solid var(--border-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.sidebar-footer .user-info strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 600;
}

.sidebar-footer .user-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.main-content {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
  max-width: 100%;
}

/* ── PAGE HEADER ─────────────────────────────── */
.page-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.page-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  animation: fadeInDown 0.5s ease-out;
}

.page-header h2 .accent {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 6px;
  letter-spacing: 0.01em;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

/* ── GRIDS ───────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media(max-width: 900px) {

  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media(max-width: 600px) {

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ── STAT CARDS ──────────────────────────────── */
.stat-card {
  text-align: center;
  padding: 20px;
}

.stat-card .stat-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.stat-card .stat-sub {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* ── TABLE ───────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 480px;
  padding-right: 4px;
  /* espacio para la barra de desplazamiento */
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

thead tr {
  background: var(--bg-2);
}

th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--border-gold);
}

td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

tbody tr {
  transition: all 0.2s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ── BADGES ──────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.4;
}

.badge-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.badge-warning {
  background: rgba(249, 115, 22, 0.12);
  color: var(--warning);
}

.badge-info {
  background: rgba(59, 130, 246, 0.12);
  color: var(--info);
}

.badge-amber {
  background: var(--amber-glow);
  color: var(--amber);
}

.badge-muted {
  background: var(--bg-hover);
  color: var(--text-muted);
}

/* ── SECTION TITLE ───────────────────────────── */
.section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ── DIVIDER ─────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── MODAL ───────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-amber);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--danger);
}

/* ── TOAST ───────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}

.toast {
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  max-width: 320px;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow);
}

.toast.success {
  background: linear-gradient(135deg, #34d399, #059669);
}

.toast.error {
  background: linear-gradient(135deg, #f87171, #dc2626);
}

.toast.warning {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.toast.info {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}

@keyframes toastIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ── LOADING ─────────────────────────────────── */
.loading {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── EMPTY STATE ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════
   MOBILE EMPLOYEE LAYOUT
   (Vendedor, Reponedor, Encargado)
   Mobile-first: sidebar reemplazado por bottom nav
═══════════════════════════════════════════════ */
.mobile-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Header superior con nombre de usuario */
.mobile-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.mobile-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-header .brand-icon {
  font-size: 1.5rem;
}

.mobile-header .brand-name {
  font-weight: 800;
  font-size: 1rem;
}

.mobile-header .brand-name span {
  color: var(--primary);
}

.mobile-header .user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-header .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-glow);
  border: 2px solid var(--border-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.mobile-header .user-name {
  font-size: 0.82rem;
  font-weight: 600;
}

/* Contenido principal de la app mobile */
.mobile-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 100px; /* Suficiente para que el contenido no quede bajo el nav fijo */
}

/* Navegación inferior tipo app móvil */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  height: 68px;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.mobile-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  transition: all 0.15s;
  position: relative;
  padding: 8px 4px;
}

.mobile-bottom-nav a .nav-icon {
  font-size: 1.35rem;
}

.mobile-bottom-nav a.active {
  color: var(--primary);
}

.mobile-bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.mobile-bottom-nav a .badge-dot {
  position: absolute;
  top: 8px;
  right: calc(50% - 16px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  display: none;
  border: 2px solid var(--bg-card);
}

.mobile-bottom-nav a .badge-dot.show {
  display: block;
}

/* Secciones mobile */
.mobile-section {
  display: none;
}

.mobile-section.active {
  display: block;
}

/* Card de asistencia estilo app */
.asist-card {
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.10) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border-amber);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
}

.asist-card .clock-display {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--primary);
  margin: 12px 0;
}

.asist-card .date-display {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
  text-transform: capitalize;
}

.asist-card .estado-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.asist-card .geo-info {
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Pan cards - para vendedor */
.bread-card {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.bread-card .bread-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.bread-card .bread-info {
  flex: 1;
}

.bread-card .bread-count {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.bread-card .bread-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Cierre de caja card */
.caja-total-display {
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
}

.caja-total-display .total-amt {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.caja-total-display .total-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.caja-dif-badge {
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 14px;
}

/* Map container */
#sucursalMap {
  width: 100%;
  height: 340px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-amber);
  overflow: hidden;
  margin-top: 12px;
}

/* Number input with +/- for mobile */
.num-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.num-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-2);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.num-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.num-input-wrap .input {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .main-content {
    padding: 16px;
  }

  .sidebar {
    display: none;
  }

  .modal {
    padding: 20px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) {

  /* En desktop, ocultar mobile nav — admin usa sidebar */
  .mobile-bottom-nav {
    display: none;
  }

  .mobile-layout .mobile-header .brand-icon {
    font-size: 1.8rem;
  }

  .mobile-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 20px;
  }
}

/* ══════════════════════════════════════════════
   MÓDULOS VISUALES — separación clara por función
═══════════════════════════════════════════════ */

/* Cabecera de módulo — banner coloreado con ícono */
.mod-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.mod-header.amber {
  background: linear-gradient(130deg, rgba(245, 158, 11, .13) 0%, rgba(245, 158, 11, .05) 100%);
  border-color: var(--border-amber);
}

.mod-header.green {
  background: linear-gradient(130deg, rgba(16, 185, 129, .12) 0%, rgba(16, 185, 129, .04) 100%);
  border-color: rgba(16, 185, 129, .2);
}

.mod-header.blue {
  background: linear-gradient(130deg, rgba(59, 130, 246, .12) 0%, rgba(59, 130, 246, .04) 100%);
  border-color: rgba(59, 130, 246, .2);
}

.mod-header.red {
  background: linear-gradient(130deg, rgba(239, 68, 68, .12) 0%, rgba(239, 68, 68, .04) 100%);
  border-color: rgba(239, 68, 68, .2);
}

.mod-header.purple {
  background: linear-gradient(130deg, rgba(168, 85, 247, .12) 0%, rgba(168, 85, 247, .04) 100%);
  border-color: rgba(168, 85, 247, .2);
}

.mod-header-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
}

.mod-header-text h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.mod-header-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Sub-módulo — tarjeta con título de sección */
.submod {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}

.submod-title {
  padding: 12px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 7px;
}

.submod-body {
  padding: 18px;
}

/* Tab interno para sub-secciones (Ops del encargado) */
.inner-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 18px 0;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.inner-tab {
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: .15s;
}

.inner-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.inner-tab-panel {
  display: none;
  padding: 18px;
}

.inner-tab-panel.active {
  display: block;
}

/* ── Pestañas Premium (Reportes, Dashboard, Personal) ── */
.premium-tabs {
  display: inline-flex;
  gap: 8px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.premium-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}

.premium-tab-btn:hover {
  color: var(--text-light);
  background: var(--bg-hover);
}

.premium-tab-btn.active-tab {
  background: linear-gradient(135deg, var(--gold), var(--gold-light)) !important;
  color: var(--bg) !important;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.25);
  border-color: transparent !important;
}

/* ── MOBILE EMPLOYEE LAYOUT (Vendedor, Reponedor, Encargado) ── */
/* .mobile-layout unificada arriba */

.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.mobile-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-header .brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
}

.mobile-header .brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.mobile-header .brand-name span {
  color: var(--primary);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 1px solid var(--border-amber);
}

.user-chip .user-name {
  font-size: 0.85rem;
  font-weight: 600;
  display: none;
}

@media (min-width: 400px) {
  .user-chip .user-name {
    display: block;
  }
}

/* .mobile-content unificada arriba */

.mobile-section {
  display: none;
  animation: fadeUp 0.3s ease;
}

.mobile-section.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bottom Nav */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(15px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  z-index: 100;
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  transition: all 0.2s;
  padding: 8px 6px;
  border-radius: 8px;
}

.mobile-bottom-nav a svg {
  width: 24px;
  height: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-bottom-nav a svg .icon-primary {
  stroke: var(--text-muted);
  transition: all 0.3s ease;
}

.mobile-bottom-nav a svg .icon-secondary {
  stroke: var(--text-muted);
  opacity: 0.6;
  transition: all 0.3s ease;
}

.mobile-bottom-nav a.active svg,
.mobile-bottom-nav a:hover svg {
  transform: scale(1.15);
}

.mobile-bottom-nav a.active svg .icon-primary,
.mobile-bottom-nav a:hover svg .icon-primary {
  stroke: var(--primary);
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5));
}

.mobile-bottom-nav a.active svg .icon-secondary,
.mobile-bottom-nav a:hover svg .icon-secondary {
  stroke: #ffffff;
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

/* Specific icon color overrides */
.mobile-bottom-nav a#tab-cierre svg .icon-primary,
.mobile-bottom-nav a#tab-ops svg .icon-primary {
  stroke: var(--success, #10b981);
}

.mobile-bottom-nav a#tab-cierre.active svg .icon-primary,
.mobile-bottom-nav a#tab-ops.active svg .icon-primary {
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.5));
}

.mobile-bottom-nav a#tab-pan svg .icon-primary {
  stroke: var(--primary, #f59e0b);
}

.mobile-bottom-nav a.active {
  color: var(--primary);
  position: relative;
  background: rgba(245, 158, 11, 0.05);
}

.mobile-bottom-nav a.active::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.6);
}

/* Mod Header */
.mod-header {
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.mod-header h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 2px;
}

.mod-header p {
  font-size: 0.8rem;
  color: var(--text-light);
}

.mod-header.green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.02));
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.mod-header.blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.02));
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.mod-header.red {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.02));
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.mod-header.amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.02));
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.mod-header.gold {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.02));
  border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Submod */
.submod {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  overflow: hidden;
}

.submod-title {
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

.submod-body {
  padding: 16px;
}

/* Bread Card for Vendedor Pan */
.bread-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bread-card .bread-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.bread-card .bread-label {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.2;
}

/* Numeric input wrap */
.num-input-wrap {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.num-input-wrap .num-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: all 0.2s;
}

.num-input-wrap .num-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--primary);
}

.num-input-wrap .num-btn:last-child {
  border-right: none;
  border-left: 1px solid var(--border);
}

.num-input-wrap .input {
  flex: 2;
  border: none;
  background: transparent;
  border-radius: 0;
}

/* -- MODAL PREMIUM (RANGO/ERROR) ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
  animation: modalFadeIn 0.3s ease;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-card {
  background: linear-gradient(145deg, #1c1c1e 0%, #0a0a0a 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  width: 100%;
  max-width: 340px;
  padding: 40px 28px;
  position: relative;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: all 0.2s;
  border: none;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.modal-icon {
  font-size: 3.5rem;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.3));
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.modal-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 30px;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── CENTRADO MAESTRO ABSOLUTO (ASISTENCIA) ── */
#gate {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100vh !important;
    width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
    background: radial-gradient(circle at center, #1a1a1a 0%, #0a0a0a 100%) !important;
    z-index: 9999 !important;
    overflow: hidden !important;
}

.gate-centered-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 320px !important; /* Más estrecho para evitar el efecto zoom */
    padding: 20px !important;
    margin: auto !important;
    text-align: center !important;
    animation: gateFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.g-brand { margin-bottom: 24px !important; }
.g-name { font-weight: 900 !important; letter-spacing: -0.04em !important; font-size: 1.5rem !important; }

.g-clock, .g-clock-wrap {
    width: 100% !important;
    padding: 24px 16px !important; /* Menos relleno para que se vea más fino */
    background: rgba(255, 255, 255, 0.02) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 24px !important;
    margin-bottom: 24px !important;
}

.g-time {
    font-size: 3rem !important; /* Mucho más pequeño para quitar el efecto zoom */
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
    color: var(--primary) !important;
    line-height: 1 !important;
    margin-bottom: 6px !important;
}

.g-date {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em !important;
}

.g-status, .g-status-wrap {
    width: 100% !important;
    padding: 0 !important; /* Sin relleno para que no se vea cargado */
    background: transparent !important;
    border: none !important;
    margin-bottom: 32px !important;
}

.g-chip {
    display: inline-block !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    background: transparent !important;
    color: var(--primary) !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
}

.g-btn, #gBtn {
    height: 48px !important; /* Más bajo para un look más fino */
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #000 !important;
    border: none !important;
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.2) !important;
    width: 100% !important;
}

.g-footer {
    margin-top: 32px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 14px !important;
}

.logout-btn-premium {
    font-size: 0.65rem !important;
    letter-spacing: 0.1em !important;
    opacity: 0.5 !important;
}
