/* ©2026. AppointmentSMS - Development by www.acticven.com . All rights reserved to author for use , copy and deployment. */
/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   AppointmentSMS â€” App.css v2.0
   Diseño: Mobile-first, blanco y limpio
   Inspirado en: Square + calnd.me + EZ
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* â”€â”€â”€ RESET â”€â”€â”€ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-bg: #1a237e;
  --sidebar-text: #ffffff;
  --sidebar-hover: rgba(255,255,255,0.1);
  --sidebar-active: rgba(255,255,255,0.15);
  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;

  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --card-radius: 12px;

  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --primary: #1a237e;
  --primary-light: #e8eaf6;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --gray: #6b7280;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* â”€â”€â”€ DARK MODE â”€â”€â”€ */
.dark-mode {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary-light: #1e3a5f;
}

.dark-mode body { background: var(--bg); color: var(--text-primary); }
.dark-mode .topbar { background: var(--card-bg); border-bottom-color: #334155; }
.dark-mode .topbar-title { color: var(--text-primary); }
.dark-mode .topbar-user { color: var(--text-secondary); }
.dark-mode .topbar-right span:not(.badge) { color: var(--text-secondary) !important; }
.dark-mode .topbar-right span[style*="color:#1a237e"] { color: var(--text-primary) !important; }
.dark-mode .topbar-right select { background: #334155; color: #f1f5f9; border-color: #475569; }
.dark-mode .card { background: var(--card-bg); }
.dark-mode .card-header { border-bottom-color: #334155; }
.dark-mode .card-title { color: var(--text-primary); }
.dark-mode .card-subtitle { color: var(--text-secondary); }
.dark-mode .summary-card { background: var(--card-bg); }
.dark-mode .summary-card .sc-value { color: var(--text-primary); }
.dark-mode .summary-card .sc-label { color: var(--text-secondary); }
.dark-mode .summary-card .sc-icon.blue { background: #1e3a5f; color: #60a5fa; }
.dark-mode .summary-card .sc-icon.amber { background: #3a2f0b; color: #fbbf24; }
.dark-mode .summary-card .sc-icon.green { background: #0a3622; color: #34d399; }
.dark-mode .summary-card .sc-icon.red { background: #3a1111; color: #f87171; }
.dark-mode .timeline-card { background: var(--card-bg); }
.dark-mode .timeline-card .tc-client { color: var(--text-primary); }
.dark-mode .timeline-card .tc-service { color: var(--text-secondary); }
.dark-mode .timeline-card .tc-phone { color: var(--text-muted); }
.dark-mode .timeline-line { background: #334155; }
.dark-mode .timeline-line::before { border-color: var(--card-bg); }
.dark-mode .badge-pending { background: #3a2f0b; color: #fbbf24; }
.dark-mode .badge-confirmed { background: #1e3a5f; color: #60a5fa; }
.dark-mode .badge-completed { background: #0a3622; color: #34d399; }
.dark-mode .badge-cancelled { background: #3a1111; color: #f87171; }
.dark-mode .badge-noshow { background: #334155; color: #cbd5e1; }
.dark-mode .badge-delayed { background: #3a2f0b; color: #fb923c; }
.dark-mode .btn-ghost { color: var(--text-secondary); }
.dark-mode .btn-ghost:hover { background: #334155; color: var(--text-primary); }
.dark-mode .btn-outline { color: var(--text-primary); border-color: var(--text-secondary); }
.dark-mode .btn-outline:hover { background: #1e3a5f; }
.dark-mode .form-control { background: #1e293b; color: var(--text-primary); border-color: #475569; }
.dark-mode .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }
.dark-mode .form-group label { color: var(--text-secondary); }
.dark-mode table th { color: var(--text-muted); border-bottom-color: #334155; }
.dark-mode table td { color: var(--text-primary); border-bottom-color: #334155; }
.dark-mode table tr:hover td { background: #1e293b; }
.dark-mode .modal { background: var(--card-bg); }
.dark-mode .modal-close { color: var(--text-muted); }
.dark-mode .modal-overlay { background: rgba(0,0,0,0.7); }
.dark-mode .empty-state i { color: #475569; }
.dark-mode .empty-state h3 { color: var(--text-secondary); }
.dark-mode .empty-state p { color: var(--text-muted); }
.dark-mode .alert-info { background: #1e3a5f; color: #60a5fa; }
.dark-mode .alert-success { background: #0a3622; color: #34d399; }
.dark-mode .alert-warning { background: #3a2f0b; color: #fbbf24; }
.dark-mode .alert-danger { background: #3a1111; color: #f87171; }
.dark-mode .section-title { color: var(--text-primary); }
.dark-mode .section-title .count { background: #334155; color: var(--text-secondary); }
.dark-mode .slot-btn { background: var(--card-bg); color: var(--text-primary); border-color: #475569; }
.dark-mode .slot-btn:hover { border-color: var(--primary); }
.dark-mode .slot-btn.selected { background: var(--primary); color: white; border-color: var(--primary); }
.dark-mode .setup-card { background: var(--card-bg); }
.dark-mode .setup-card h2 { color: var(--text-primary); }
.dark-mode .setup-card p { color: var(--text-secondary); }
.dark-mode .step .step-num { background: #475569; color: var(--text-muted); }
.dark-mode .step-connector { background: #475569; }
.dark-mode .date-nav button { background: var(--card-bg); border-color: #475569; color: var(--text-secondary); }
.dark-mode .date-nav input[type="date"] { background: var(--card-bg); color: var(--text-primary); border-color: #475569; }
.dark-mode .qr-container img { border-color: #475569; }
.dark-mode .toast { box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.dark-mode .loading-overlay { background: rgba(0,0,0,0.6); }
.dark-mode .loading-overlay::after { border-color: #475569; border-top-color: var(--primary); }
.dark-mode .toggle .slider { background: #475569; }
.dark-mode .time { color: var(--text-primary); }
.dark-mode .duration { color: var(--text-muted); }
.dark-mode .text-muted { color: var(--text-muted); }
.dark-mode .text-secondary { color: var(--text-secondary); }
.dark-mode .mapa-stat { background: var(--card-bg); }
.dark-mode .mapa-stat .lbl { color: var(--text-muted); }
.dark-mode .fc { --fc-page-bg-color: var(--card-bg); --fc-border-color: #334155; --fc-neutral-bg-color: #1e293b; --fc-today-bg-color: rgba(26,35,126,0.15); }
.dark-mode .fc .fc-toolbar-title { color: var(--text-primary); }
.dark-mode .fc .fc-button { background: var(--card-bg); border-color: #475569; color: var(--text-primary); }
.dark-mode .fc .fc-button:hover { background: #334155; }
.dark-mode .fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--primary); border-color: var(--primary); }
.dark-mode .fc .fc-col-header-cell-cushion { color: var(--text-secondary); }
.dark-mode .fc .fc-daygrid-day-number { color: var(--text-primary); }
.dark-mode .fc .fc-daygrid-more-link { color: var(--primary); }
.dark-mode .fc .fc-popover { background: var(--card-bg); border-color: #475569; }
.dark-mode .fc .fc-popover-title { color: var(--text-primary); }
.dark-mode .fc .fc-list-day-cushion { background: #1e293b; }
.dark-mode .fc .fc-list-event:hover td { background: #334155; }
.dark-mode .pb-card { background: var(--card-bg); }
.dark-mode .pb-biz-name { color: var(--text-primary); }
.dark-mode .pb-step h3 { color: var(--text-primary); }
.dark-mode .pb-step p { color: var(--text-secondary); }
.dark-mode .pb-dot { background: #475569; }
.dark-mode .pb-dot.active { background: var(--primary); }
.dark-mode .pb-dot.done { background: var(--success); }
.dark-mode .card-view .table-wrap tr { background: var(--card-bg); }
.dark-mode .text-muted[style*="color:#9ca3af"] { color: var(--text-muted) !important; }
.dark-mode .text-secondary[style*="color:#6b7280"] { color: var(--text-secondary) !important; }
.dark-mode .text-center.text-secondary { color: var(--text-secondary); }

html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* â”€â”€â”€ LAYOUT â”€â”€â”€ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── SIDEBAR ─── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  transform: translateX(-100%);
}

.sidebar-brand {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1.2;
}

.sidebar-brand .brand-sub {
  font-size: 0.6rem;
  opacity: 0.6;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-nav .nav-section {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #f59e0b;
  opacity: 1;
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  padding: 7px 12px 3px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 3px 10px 3px 36px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s ease;
  opacity: 0.75;
}

.sidebar-nav a:hover { background: var(--sidebar-hover); opacity: 1; }
.sidebar-nav a.active { background: var(--sidebar-active); opacity: 1; }

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s ease;
  opacity: 0.6;
}

.sidebar-footer a:hover { background: var(--sidebar-hover); opacity: 1; }

/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-layout.sidebar-closed .main-content {
  margin-left: 0;
}

/* â”€â”€â”€ TOPBAR â”€â”€â”€ */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar .hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background 0.15s;
}
.topbar .hamburger:hover {
  background: #f1f5f9;
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.topbar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

/* â”€â”€â”€ PAGE WRAPPER â”€â”€â”€ */
.page-wrapper {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* â”€â”€â”€ CARDS RESUMEN â”€â”€â”€ */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}

.summary-card .sc-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.summary-card .sc-icon.blue { background: #dbeafe; color: #1d4ed8; }
.summary-card .sc-icon.amber { background: #fef3c7; color: #b45309; }
.summary-card .sc-icon.green { background: #d1fae5; color: #047857; }
.summary-card .sc-icon.red { background: #fee2e2; color: #b91c1c; }

.summary-card .sc-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.summary-card .sc-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ─── STATS PANEL (persiana) ─── */
.stats-panel .stats-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px;
  background: var(--card-bg);
  border: none;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  transition: background 0.15s ease;
}

.stats-panel .stats-toggle:hover { background: #f8f9ff; }

.stats-toggle-title { display: flex; align-items: center; gap: 8px; }

.stats-caret {
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.stats-panel.open .stats-caret { transform: rotate(180deg); }

.slot-fecha-label {
  cursor: pointer;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 1px;
  line-height: 1.2;
}
.slot-fecha-label:hover { border-bottom-color: var(--primary); color: var(--primary); }

.stats-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.stats-panel.open .stats-body { max-height: 600px; }

.stats-body .summary-cards {
  margin: 0;
  padding: 14px 18px 6px;
}

select[disabled][data-block="1"] {
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
  cursor: not-allowed;
  border-color: #c7d2fe;
}

.stats-body .summary-card { margin-bottom: 0; }

/* â”€â”€â”€ TIMELINE â”€â”€â”€ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 16px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-time {
  flex: 0 0 60px;
  text-align: right;
  padding-top: 12px;
}

.timeline-time .time {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.timeline-time .duration {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-line {
  flex: 0 0 2px;
  background: #e5e7eb;
  position: relative;
  margin: 0 8px;
}

.timeline-line::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  border: 2px solid var(--card-bg);
}

.timeline-line.pending::before { background: var(--accent); }
.timeline-line.confirmed::before { background: var(--info); }
.timeline-line.completed::before { background: var(--success); }
.timeline-line.cancelled::before { background: var(--danger); }
.timeline-line.noshow::before { background: var(--gray); }
.timeline-line.delayed::before { background: #f97316; }

.timeline-card {
  flex: 1;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 12px 16px;
  box-shadow: var(--card-shadow);
  border-left: 3px solid var(--primary);
}

.timeline-card.pending { border-left-color: var(--accent); }
.timeline-card.confirmed { border-left-color: var(--info); }
.timeline-card.completed { border-left-color: var(--success); }
.timeline-card.cancelled { border-left-color: var(--danger); }
.timeline-card.noshow { border-left-color: var(--gray); }
.timeline-card.delayed { border-left-color: #f97316; }

.timeline-card .tc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.timeline-card .tc-client {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.timeline-card .tc-service {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.timeline-card .tc-phone {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.timeline-card .tc-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* â”€â”€â”€ BADGES â”€â”€â”€ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-noshow { background: #f3f4f6; color: #374151; }
.badge-delayed { background: #ffedd5; color: #9a3412; }

/* â”€â”€â”€ BUTTONS â”€â”€â”€ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: var(--font);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn-sm { padding: 5px 10px; font-size: 0.68rem; }
.btn-lg { padding: 12px 24px; font-size: 0.9rem; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #151b6b; }

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: #d97706; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-telegram { background: #0088cc; color: #fff; border-color: #0088cc; }
.btn-telegram:hover { background: #0077b5; border-color: #0077b5; }
.btn-sms { background: #a1887f; color: #fff; border-color: #a1887f; }
.btn-sms:hover { background: #8d6e63; border-color: #8d6e63; }
.btn-email { background: #6b7280; color: #fff; border-color: #6b7280; }
.btn-email:hover { background: #4b5563; border-color: #4b5563; }
button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }
button:disabled:hover, .btn:disabled:hover { transform: none; }


.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover { background: #f3f4f6; color: var(--text-primary); }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* â”€â”€â”€ FORMS â”€â”€â”€ */
.form-group { margin-bottom: 16px; }

.modal .form-group { margin-bottom: 10px; }

.form-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.form-control {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--card-bg);
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,35,126,0.1);
}

select.form-control { appearance: auto; }

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* â”€â”€â”€ CARDS â”€â”€â”€ */
.card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* â”€â”€â”€ TABLE â”€â”€â”€ */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  border-bottom: 2px solid #f3f4f6;
}

table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--text-primary);
}

table tr:hover td { background: #f9fafb; }
table tr:last-child td { border-bottom: none; }

/* â”€â”€â”€ MODAL â”€â”€â”€ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

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

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  animation: modalIn 0.2s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-overlay { overflow-y: auto; }

.modal-footer {
  position: sticky;
  bottom: 0;
  background: var(--card-bg);
  border-top: 1px solid #f3f4f6;
  margin: 0 -24px;
  padding: 14px 24px 24px;
}

@keyframes modalIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

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

.modal-title {
  font-size: 1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-body { margin-bottom: 12px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; }

/* â”€â”€â”€ EMPTY STATE â”€â”€â”€ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
  color: #d1d5db;
}

.empty-state h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* â”€â”€â”€ ALERTS â”€â”€â”€ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.alert-info { background: #dbeafe; color: #1e40af; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-danger { background: #fee2e2; color: #991b1b; }

/* â”€â”€â”€ GRID â”€â”€â”€ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ─── SIDEBAR OVERLAY ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
}
.sidebar-overlay.show {
  display: block;
}

/* Desktop: sidebar visible */
@media (min-width: 768px) {
  .sidebar { transform: translateX(0); }
}
/* Mobile toggle: sidebar opens */
.sidebar.open { transform: translateX(0) !important; }
/* Desktop toggle: sidebar closed — slide out + content fills */
.app-layout.sidebar-closed .sidebar { transform: translateX(-100%) !important; }
.app-layout.sidebar-closed .main-content { margin-left: 0; }

/* â”€â”€â”€ SECTION â”€â”€â”€ */
.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .count {
  background: #f3f4f6;
  color: var(--text-secondary);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 767px) {
  .main-content {
    margin-left: 0;
  }
  .sidebar-overlay.show {
    display: block;
  }

  .topbar {
    padding: 10px 16px;
  }

  .topbar .hamburger {
    display: block;
  }

  .topbar-title {
    font-size: 0.95rem;
  }

  .topbar-right .topbar-user span {
    display: none;
  }

  .page-wrapper {
    padding: 16px;
  }

  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .summary-card {
    padding: 12px;
  }

  .summary-card .sc-value {
    font-size: 1.2rem;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .modal-overlay { padding: 10px; }
  .modal { padding: 16px; max-height: calc(100vh - 20px); }
  .form-group { margin-bottom: 10px; }
  .form-group label { font-size: 0.68rem; margin-bottom: 2px; }
  .form-control { padding: 8px 10px; font-size: 0.84rem; }
  /* Normaliza selects/inputs con estilo inline (pais/operadora/unidad) */
  .form-group select,
  .form-group input[type="text"],
  .form-group input[type="tel"],
  .form-group input[type="number"],
  .form-group input[type="email"],
  .form-group input[type="date"],
  .form-group input[type="time"],
  .form-group input[type="password"] {
    padding: 8px 10px !important;
    font-size: 0.84rem !important;
  }
  .modal-body { margin-bottom: 10px; }
  .modal-footer {
    margin: 0 -16px;
    padding: 12px 16px 16px;
  }

  .timeline-time {
    flex: 0 0 48px;
  }

}

@media (min-width: 768px) and (max-width: 1024px) {
  .page-wrapper {
    padding: 20px;
  }

  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* â”€â”€â”€ UTILITIES â”€â”€â”€ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }

.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.flex { display: flex; }
.flex-center { align-items: center; }
.flex-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.w-full { width: 100%; }
.hidden { display: none !important; }

/* â”€â”€â”€ SLOTS (booking) â”€â”€â”€ */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.slot-btn {
  padding: 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  font-family: var(--font);
}

.slot-btn:hover { border-color: var(--primary); color: var(--primary); }
.slot-btn.selected { background: var(--primary); color: white; border-color: var(--primary); }
.slot-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* â”€â”€â”€ STEP INDICATOR (wizard) â”€â”€â”€ */
.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  justify-content: center;
}

.step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.step .step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e5e7eb;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.step.active { color: var(--primary); }
.step.active .step-num { background: var(--primary); color: white; }
.step.done { color: var(--success); }
.step.done .step-num { background: var(--success); color: white; }

.step-connector {
  width: 24px;
  height: 2px;
  background: #e5e7eb;
}

.step-connector.done { background: var(--success); }

/* â”€â”€â”€ PRINT QR â”€â”€â”€ */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px;
}

.qr-container img {
  max-width: 200px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
}

/* â”€â”€â”€ ONBOARDING â”€â”€â”€ */
.setup-container {
  max-width: 520px;
  margin: 0 auto;
}

.setup-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--card-shadow);
}

.setup-card h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.setup-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* â”€â”€â”€ DATE NAV â”€â”€â”€ */
.date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.date-nav button {
  background: var(--card-bg);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.date-nav button:hover { border-color: var(--primary); color: var(--primary); }

.date-nav input[type="date"] {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--card-bg);
}

/* â”€â”€â”€ TOAST â”€â”€â”€ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  z-index: 9999;
  color: white;
  animation: toastIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.toast-info { background: var(--primary); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--accent); }
.toast-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(-50%) translateY(0); opacity: 1; }
  to { transform: translateX(-50%) translateY(20px); opacity: 0; }
}

/* â”€â”€â”€ LOADING â”€â”€â”€ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.6);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-box {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  padding: 28px 32px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.loading-clock {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  animation: pulseClock 1s ease-in-out infinite;
}

.loading-clock i { animation: spin 2s linear infinite; }

@keyframes pulseClock {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.85; }
}

.loading-msg {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.loading-note {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.loading-overlay::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* â”€â”€â”€ TOGGLE SWITCH â”€â”€â”€ */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink:0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider { position: absolute; cursor: pointer; inset: 0; background: #d1d5db; border-radius: 24px; transition: 0.2s; }
.toggle .slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }
.toggle input:checked + .slider { background: var(--primary); }
.toggle input:checked + .slider::before { transform: translateX(20px); }

/* â”€â”€â”€ AUDIO RECORDER â”€â”€â”€ */
.audio-recorder { margin-top: 4px; }
.ar-btn { font-size: 0.75rem !important; }
.ar-status { font-size: 0.75rem; color: #9ca3af; margin-left: 8px; }
.ar-playback { margin-top: 6px; }
.ar-playback audio { width: 100%; height: 36px; border-radius: 8px; }

/* â”€â”€â”€ PRINT â”€â”€â”€ */
@media print {
  .sidebar, .sidebar-overlay, .topbar, .btn, .tc-actions, .hamburger, .bottom-nav { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-wrapper { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd; }
  body { background: white; }
}

/* ─── SIDEBAR ACCORDION ─── */
.nav-section span {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.55rem;
  line-height: 1;
}
.nav-section.open span {
  transform: rotate(90deg);
}
.nav-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.nav-items.open {
  max-height: 600px;
}

/* ─── BOTTOM NAV (mobile only) ─── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
}
.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-decoration: none;
  color: #6b7280;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 6px 0 4px;
  gap: 2px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.bn-item i {
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.15s;
}
.bn-item:active i {
  transform: scale(0.88);
}
.bn-item.active {
  color: var(--primary, #1a237e);
}
.bn-item.active i {
  transform: scale(1.1);
}
@media (max-width: 767px) {
  .bottom-nav { display: flex; }
  .page-wrapper { padding-bottom: 72px !important; }
}
@media (min-width: 768px) {
  .bottom-nav { display: none !important; }
}
