/* 
  admin.css — TEMA PREMIUM SAAS (Estilo Stripe/Apple/Notion) 
  Colores: Burdeos Corporativo, Crema, Blanco, Dorado
*/
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:root {
  /* Color Palette */
  --bg: #F9F8F6; /* Crema muy suave */
  --surface: #FFFFFF;
  --surface-2: #F2EFEA;
  --surface-3: #EBE6DF;
  
  --text: #111111;
  --text-dim: #5C5A55;
  --text-muted: #68645E;
  
  --primary: #7A1028; /* Dorado clásico elegante */
  --primary-light: #9a1433;
  --primary-bg: rgba(122, 16, 40, 0.08);
  --primary-glow: rgba(122, 16, 40, 0.25);
  
  --border: rgba(0,0,0,0.06);
  --border-primary: rgba(122, 16, 40, 0.3);
  
  --success: #059669; --warning: #D97706; --error: #DC2626; --info: #2563EB;
  --success-bg: rgba(5,150,105,0.08); --warning-bg: rgba(217,119,6,0.08);
  --error-bg: rgba(220,38,38,0.08); --info-bg: rgba(37,99,235,0.08);
  
  --font-display: 'Cormorant Garamond', serif;
  --font-body: 'Inter', 'Outfit', sans-serif;
  
  --transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  --radius: 16px;
  --radius-sm: 8px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow: 0 4px 12px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.02);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.02);
}

*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); min-height: 100vh; -webkit-font-smoothing: antialiased; display: flex; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* LAYOUT: APP */
.app-layout { display: flex; width: 100vw; height: 100vh; overflow: hidden; }

/* LAYOUT: SIDEBAR */
.sidebar { width: 260px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 100; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.sidebar-header { padding: 28px 24px 24px; text-align: center; }
.sidebar-logo-area { display: flex; flex-direction: column; align-items: center; gap: 0; }
.admin-logo-img { width: 160px; height: auto; margin-bottom: 8px; border-radius: 10px; display: block; }
.sidebar-header h1 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--text); letter-spacing: 1px; }
.sidebar-header p { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; margin-top: 4px; font-weight: 500; }

.admin-nav { display: flex; flex-direction: column; padding: 0 16px; gap: 4px; flex-grow: 1; overflow-y: auto; }
.nav-tab { background: transparent; border: none; padding: 12px 16px; border-radius: var(--radius-sm); color: var(--text-dim); cursor: pointer; font-family: var(--font-body); font-size: 0.9rem; font-weight: 500; display: flex; align-items: center; gap: 12px; transition: var(--transition); text-align: left; width: 100%; }
.nav-tab i { font-size: 1.1rem; width: 20px; text-align: center; color: var(--text-muted); transition: var(--transition); }
.nav-tab:hover { background: var(--surface-2); color: var(--text); }
.nav-tab.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.nav-tab.active i { color: var(--primary); }

.sidebar-footer { padding: 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.back-link { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: var(--transition); }
.back-link:hover { background: var(--primary); color: #fff; box-shadow: var(--shadow); }

/* LAYOUT: MAIN CONTENT */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow-y: auto; background: var(--bg); position: relative; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 24px 48px; background: rgba(249,248,246,0.8); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 90; }
.topbar-title { font-size: 1.5rem; font-weight: 600; color: var(--text); }
.user-info { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--text-dim); font-weight: 500; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 0.9rem; box-shadow: var(--shadow-sm); }

.dashboard-container { padding: 48px; max-width: 1400px; margin: 0 auto; width: 100%; }
.tab-content { display: none; animation: tab-fade-in 0.4s var(--transition); }
.tab-content.active-tab { display: block; }
@keyframes tab-fade-in { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* CARDS & CONTAINERS */
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; margin-bottom: 24px; box-shadow: var(--shadow); transition: var(--transition); }
.section-card:hover { box-shadow: var(--shadow-md); border-color: rgba(0,0,0,0.08); }
.section-card h2 { font-family: var(--font-body); font-size: 1.25rem; font-weight: 600; color: var(--text); margin-bottom: 24px; display: flex; align-items: center; gap: 12px; }
.section-card h2 i { color: var(--primary); }

/* STATS DASHBOARD */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: var(--transition); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--primary); opacity: 0; transition: var(--transition); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card:hover::before { opacity: 1; }
.stat-card h3 { font-size: 0.75rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.stat-card p { font-size: 2.5rem; font-family: var(--font-display); font-weight: 600; color: var(--text); line-height: 1; }
.stat-card .trend { font-size: 0.8rem; font-weight: 500; margin-top: 12px; display: flex; align-items: center; gap: 4px; }
.stat-card .trend.up { color: var(--success); }
.stat-card .trend.down { color: var(--error); }

/* CONTROLS */
.dashboard-controls { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; align-items: center; background: var(--surface); padding: 16px 24px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.dashboard-controls input, .dashboard-controls select { padding: 10px 16px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text); font-family: var(--font-body); font-size: 0.9rem; outline: none; transition: var(--transition); }
.dashboard-controls input:focus, .dashboard-controls select:focus { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-bg); }

/* BUTTONS */
button { padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-dim); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--shadow-sm); }
button:hover { background: var(--surface-2); color: var(--text); }
button i { font-size: 0.9rem; }
.btn-gold { background: var(--text) !important; color: var(--surface) !important; border-color: var(--text) !important; } /* Modern SaaS uses black as primary sometimes, let's use black or gold */
.btn-gold:hover { background: #000 !important; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary { background: var(--primary) !important; color: #fff !important; border: none !important; }
.btn-primary:hover { background: var(--primary-light) !important; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-success { background: var(--success-bg) !important; color: var(--success) !important; border-color: rgba(5,150,105,0.2) !important; }
.btn-success:hover { background: var(--success) !important; color: #fff !important; }
.btn-danger { background: var(--error-bg) !important; color: var(--error) !important; border-color: rgba(220,38,38,0.2) !important; }
.btn-danger:hover { background: var(--error) !important; color: #fff !important; }
.btn-warning { background: var(--warning-bg) !important; color: var(--warning) !important; border-color: rgba(217,119,6,0.2) !important; }
.btn-info { background: var(--info-bg) !important; color: var(--info) !important; border-color: rgba(37,99,235,0.2) !important; }

.btn-surface { 
  background: var(--surface) !important; 
  color: var(--text) !important; 
  border: 1px solid var(--border) !important; 
  box-shadow: var(--shadow-sm);
}
.btn-surface:hover { 
  background: var(--surface-2) !important; 
  border-color: var(--border-primary) !important;
  transform: translateY(-1px);
}

/* TABLE */
.table-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; overflow-x: auto; box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; white-space: nowrap; }
thead tr { background: var(--surface-2); border-bottom: 1px solid var(--border); }
thead th { padding: 16px 24px; text-align: left; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); }
tbody tr { border-bottom: 1px solid var(--border); transition: var(--transition); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child { border-bottom: none; }
td { padding: 16px 24px; vertical-align: middle; color: var(--text); }
.table-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }

/* BADGES */
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 50px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-badge.pending { color: var(--warning); background: var(--warning-bg); }
.status-badge.pending::before { background: var(--warning); }
.status-badge.confirmed { color: var(--success); background: var(--success-bg); }
.status-badge.confirmed::before { background: var(--success); }
.zone-tag { padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); }

/* FORMS */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 16px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text); font-family: var(--font-body); font-size: 0.95rem; outline: none; transition: var(--transition); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-bg); }

.checkbox-group { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid transparent; transition: var(--transition); cursor: pointer; }
.checkbox-group:hover { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-sm); }
.checkbox-group input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.checkbox-group label { margin-bottom: 0; font-size: 0.95rem; font-weight: 500; cursor: pointer; color: var(--text); flex: 1; }

/* SAVE BTN */
.save-btn { width: 100%; padding: 14px; background: var(--text); color: var(--surface); border: none; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: var(--transition); box-shadow: var(--shadow); }
.save-btn:hover { background: #000; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.save-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* MODAL */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px); align-items: center; justify-content: center; padding: 24px; }
.modal.open { display: flex; }
.modal-content { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 36px; width: 100%; max-width: 760px; max-height: 90vh; overflow-y: auto; position: relative; animation: modal-in 0.4s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--shadow-lg); }
@keyframes modal-in { from { opacity: 0; transform: scale(0.95) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.4rem; font-weight: 600; color: var(--text); }
.close-modal-btn { background: var(--surface-2); border: none; color: var(--text-dim); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); font-size: 1rem; }
.close-modal-btn:hover { background: var(--border); color: var(--text); transform: rotate(90deg); }

/* TOAST */
.toast { position: fixed; top: 24px; right: 24px; padding: 16px 24px; border-radius: var(--radius-sm); display: flex; align-items: center; gap: 12px; font-size: 0.95rem; font-weight: 500; z-index: 9999; animation: toast-in 0.4s var(--transition), toast-out 0.4s var(--transition) 4.5s both; box-shadow: var(--shadow-lg); background: var(--text); color: var(--surface); }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--error); }
.toast-info { border-left: 4px solid var(--info); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; pointer-events: none; } }

/* LOGIN */
#login-overlay { position: fixed; inset: 0; background: var(--bg); display: flex; justify-content: center; align-items: center; z-index: 9999; transition: opacity 0.6s var(--transition); }
#login-overlay.login-hide { opacity: 0; pointer-events: none; }
.login-card { text-align: center; background: var(--surface); padding: 56px 48px; border-radius: 24px; border: 1px solid var(--border); width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.login-card h2 { font-family: var(--font-display); font-size: 2.5rem; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.login-card p { font-size: 0.9rem; color: var(--text-dim); margin-bottom: 32px; }
#admin-password { width: 100%; padding: 16px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text); font-family: var(--font-body); font-size: 1.1rem; outline: none; text-align: center; letter-spacing: 4px; margin-bottom: 24px; transition: var(--transition); }
#admin-password:focus { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-bg); }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 64px 24px; color: var(--text-dim); background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-state i { font-size: 3rem; margin-bottom: 16px; color: var(--border); }
.empty-state h3 { font-size: 1.2rem; color: var(--text); margin-bottom: 8px; font-weight: 600; }
.empty-state p { font-size: 0.95rem; max-width: 400px; margin: 0 auto 24px auto; }

  /* ── Horario Semanal de Lujo ────────────────────────── */
  .schedule-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); 
    gap: 24px; 
    margin-top: 32px; 
  }
  
  .day-card { 
    background: #fff; 
    border: 1px solid rgba(0,0,0,0.05); 
    border-radius: 20px; 
    padding: 24px; 
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  .day-card:hover { 
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
    border-color: var(--primary-light);
  }

  .day-card.closed-day {
    background: #fafaf9;
    border-color: transparent;
  }

  .day-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding-bottom: 12px;
    border-bottom: 1px solid var(--surface-2);
  }
  
  .day-header h3 { 
    font-family: var(--font-display); 
    font-size: 1.25rem; 
    font-weight: 700; 
    color: var(--text);
    letter-spacing: -0.02em;
  }
  
  /* Status Badges */
  .status-badge { 
    font-size: 0.7rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    padding: 6px 12px; 
    border-radius: 100px; 
    transition: all 0.3s;
  }
  .status-badge.open { background: #ecfdf5; color: #059669; }
  .status-badge.closed { background: #f1f5f9; color: #64748b; }

  /* Time Shifts Layout */
  .time-shift { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    transition: all 0.3s;
  }
  
  .shift-label { 
    font-size: 0.75rem; 
    font-weight: 700; 
    color: var(--text-dim); 
    text-transform: uppercase; 
    letter-spacing: 0.08em; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
  }
  .shift-label i { color: var(--primary); font-size: 0.9rem; }
  
  .time-inputs-row { 
    display: flex; 
    align-items: center; 
    background: var(--surface-2);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.03);
  }
  
  .time-input-group { flex: 1; }
  
  /* Custom Time Inputs (Clean & Premium) */
  .time-input-group input[type="time"] { 
    width: 100%; 
    padding: 10px; 
    border: none; 
    background: transparent;
    font-family: var(--font-body); 
    font-size: 1rem; 
    font-weight: 600;
    color: var(--text);
    outline: none;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s;
  }
  
  .time-input-group input[type="time"]::-webkit-calendar-picker-indicator {
    display: none; /* Hide default icon to keep it minimal */
  }

  .time-input-group input:hover { color: var(--primary); }
  .time-input-group input:focus { color: var(--gold-dark); }
  
  .time-separator { 
    width: 1px;
    height: 20px;
    background: rgba(0,0,0,0.1);
    margin: 0 4px;
  }

  /* Switch Toggle Premium */
  .status-switch { position: relative; width: 48px; height: 26px; }
  .status-switch input { opacity: 0; width: 0; height: 0; }
  .slider { 
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; 
    background-color: #e2e8f0; transition: .4s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 34px; 
  }
  .slider:before { 
    position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; 
    background-color: white; transition: .4s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }
  input:checked + .slider { background-color: var(--text); }
  input:checked + .slider:before { transform: translateX(22px); }

/* RESPONSIVE */
@media(max-width:1024px){
  .sidebar { width: 220px; }
  .dashboard-container { padding: 32px; }
  .topbar { padding: 20px 32px; }
}

@media(max-width:992px){
  .app-layout { flex-direction: column; height: 100vh; overflow: hidden; }
  .sidebar { 
    width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); 
    padding: 12px 20px; flex-direction: row; justify-content: space-between; align-items: center; 
    flex-shrink: 0; position: relative;
  }
  .sidebar-header { padding: 0; }
  .sidebar-header h1 { font-size: 1.3rem; }
  .sidebar-header p { display: none; }
  .sidebar-footer { display: none; }
  
  /* Mobile/tablet navigation uses the existing Dashboard icon menu only. */
  .admin-nav { display: none; }
  .main-wrapper { flex: 1 1 0; min-height: 0; height: auto; }
  .topbar { padding: 14px 20px; box-shadow: var(--shadow-sm); }
  .topbar-title { font-size: 1.1rem; }
  .user-info span { display: none; }
  .dashboard-container { padding: 20px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

  /* Grids y Tablas */
  .stats-grid { grid-template-columns: 1fr; gap: 16px; }
  .section-card { padding: 20px; }
  .section-card h2 { font-size: 1.1rem; margin-bottom: 16px; }
  
  .table-container { 
    margin: 0 -20px; width: calc(100% + 40px); border-radius: 0; border-left: none; border-right: none; 
    -webkit-overflow-scrolling: touch; overflow-x: auto;
  }
  table { min-width: 700px; } /* Forzar scroll horizontal para claridad */

  /* Forms en móvil */
  .modal-content { padding: 24px 20px; border-radius: 16px; }
  .modal-content form > div { grid-template-columns: 1fr !important; gap: 20px !important; }
}

@media(max-width:600px) {
  .dashboard-controls { padding: 12px; flex-direction: column; align-items: stretch; }
  .dashboard-controls > div { width: 100%; justify-content: space-between; }
  .dashboard-controls input, .dashboard-controls select { width: 100%; }
  
  .stat-card p { font-size: 2rem; }
  
  /* Ajustar cuadrícula de horario */
  .schedule-grid { grid-template-columns: 1fr; }
  .day-card { padding: 16px; }
  
  /* Ajustar botones de acción en tabla */
  td { padding: 12px 16px; }
  
  /* QR Section */
  #qr-wrapper { padding: 20px; }
  #qr-canvas { max-width: 100%; height: auto !important; }
}

/* ── Mejoras de Claridad Desktop ───────────────────── */
.main-wrapper::-webkit-scrollbar { width: 8px; }
.main-wrapper::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.05); }
.main-wrapper::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.1); }

.premium-text {
  background: linear-gradient(to right, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Extra Styles for Business Tab */
#tab-business .form-group input {
  font-weight: 500;
}

#tab-business .save-btn {
  margin-top: 8px;
}

#tab-business .section-card h2 i {
  color: var(--primary);
}

.password-toggle-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.password-toggle-btn:hover {
  color: var(--primary);
}

/* ══ APP DASHBOARD GRID (MOBILE LAUNCHPAD) ══ */
.app-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 24px;
  padding: 10px 0 40px;
}

.app-icon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.app-icon-card:active {
  transform: scale(0.9);
  opacity: 0.8;
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.8rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.app-icon::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.2), transparent);
}

.app-icon-card span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}

/* Ajustes Mobile Dashboard */
@media(max-width: 480px) {
  .app-dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 20px;
  }
  .app-icon {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
    border-radius: 16px;
  }
  .app-icon-card span {
    font-size: 0.75rem;
  }
}

/* Consistent admin workspace */
:root {
  --admin-space-1: 0.5rem;
  --admin-space-2: 0.75rem;
  --admin-space-3: 1rem;
  --admin-space-4: 1.5rem;
  --admin-space-5: 2rem;
  --focus-ring: 0 0 0 3px rgba(122, 16, 40, 0.18);
}

html { scroll-behavior: smooth; }
body { min-width: 320px; }
.app-layout { min-height: 0; min-height: 100dvh; }
.main-wrapper { min-width: 0; min-height: 0; }
.dashboard-container { max-width: 1480px; padding: clamp(1.25rem, 3vw, 2.75rem); }

.topbar {
  min-height: 76px;
  padding: 1rem clamp(1.25rem, 3vw, 2.75rem);
  background: rgba(249, 248, 246, 0.94);
}
.topbar-title { line-height: 1.25; }
.topbar > div:last-child { min-width: 0; }

.admin-nav { scrollbar-width: thin; }
.nav-tab { min-height: 44px; }
.nav-tab:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(122, 16, 40, 0.35);
  outline-offset: 2px;
}

.section-card,
.stat-card,
.table-container { min-width: 0; }
.section-card { padding: clamp(1.25rem, 2.5vw, 2rem); }
.section-card:hover { transform: none; }
.section-card h2 { line-height: 1.35; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.stat-card { padding: clamp(1rem, 2vw, 1.5rem); }

.form-group { min-width: 0; }
.form-group input,
.form-group select,
.form-group textarea,
.dashboard-controls input,
.dashboard-controls select { min-height: 44px; }
.form-group textarea { resize: vertical; }
input:disabled,
select:disabled,
textarea:disabled,
button:disabled { cursor: not-allowed; opacity: 0.58; }
button { min-height: 42px; }
.save-btn { min-height: 46px; }
.btn-primary:hover,
.btn-surface:hover,
.btn-success:hover,
.btn-danger:hover,
.btn-warning:hover,
.btn-info:hover { transform: translateY(-1px); }

.empty-state,
.empty-state-card {
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px dashed var(--border-primary);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.empty-state h2,
.empty-state h3,
.empty-state-card h2,
.empty-state-card h3 { margin-bottom: 0.5rem; }

.login-card {
  width: min(100% - 2rem, 420px);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.login-card h2 { margin-bottom: 0.35rem; }
.login-card > p:first-of-type { margin-bottom: 1.5rem; color: var(--text-dim); }
.login-card input { min-height: 46px; }
.login-card #login-btn { width: 100%; margin-top: 0.75rem; }
#login-error { line-height: 1.45; }

@media (min-width: 993px) {
  .app-layout { height: 100dvh; }
  .sidebar { width: 248px; }
  .sidebar-header { padding: 1.5rem 1.25rem; }
  .admin-logo-img { width: min(100%, 144px); }
  .admin-nav { padding-inline: 0.75rem; }
  .sidebar-footer { padding: 1rem; }
}

@media (max-width: 992px) {
  .app-layout { height: 100dvh; }
  .sidebar { min-height: 60px; padding: 0.5rem 1rem; }
  .sidebar-header { display: flex; align-items: center; gap: 0.5rem; }
  .admin-logo-img { display: none; }
  .sidebar-header h1 { font-family: var(--font-body); font-size: 1rem; letter-spacing: 0; }
  .admin-nav { display: none; }
  .main-wrapper { height: auto; }
  .topbar { min-height: 60px; gap: 0.75rem; }
  .topbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-container { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
  #tab-tables .section-card[style*="min-width:500px"] { min-width: 0 !important; }
}

@media (max-width: 600px) {
  .topbar { padding-inline: 0.875rem; }
  .topbar-title { font-size: 1rem; }
  .topbar > div:last-child { gap: 0.5rem !important; }
  #admin-logout { padding: 0.55rem 0.65rem; font-size: 0.75rem; white-space: nowrap; }
  .dashboard-container { padding: 1rem 0.875rem calc(1.5rem + env(safe-area-inset-bottom)); }
  .section-card { margin-bottom: 1rem; border-radius: 12px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .stat-card h3 { font-size: 0.68rem; letter-spacing: 0.04em; }
  .dashboard-controls { gap: 0.75rem; }
  .dashboard-controls button { width: 100%; }
  .app-dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 0.5rem; }
  .app-icon-card { min-width: 0; text-align: center; }
  .app-icon-card span { line-height: 1.3; }
  .modal { padding: 0.5rem; align-items: end; }
  .modal-content { width: 100%; max-height: min(92dvh, 900px); padding: 1.25rem 1rem; border-radius: 18px 18px 12px 12px; }
  .modal-header { margin-bottom: 1rem; }
  .table-container { margin-inline: -0.875rem; width: calc(100% + 1.75rem); }
  .schedule-grid { grid-template-columns: minmax(0, 1fr); }
  #tab-tables > div[style*="display:flex"] { flex-direction: column; }
  #tab-tables .section-card { width: 100%; min-width: 0 !important; }
  #tables-map-area { min-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.login-link {
  display: block;
  margin: 10px auto 0;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.login-link:hover { text-decoration: underline; }

/* Reservation editor keeps usable controls on small screens. */
.reservation-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.reservation-form-grid > .form-group { min-width: 0; }
.reservation-form-grid input, .reservation-form-grid select { width: 100%; min-width: 0; }
.reservation-form-error { margin-top: 16px; padding: 12px; border: 1px solid var(--error); border-radius: 10px; color: var(--error); font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
.reservation-form-error[hidden] { display: none; }
#reservation-modal button:disabled { cursor: wait; opacity: .7; }
@media (max-width: 380px) { .reservation-form-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; } }

.special-day-actions { text-align: right; white-space: nowrap; }
.special-day-actions button + button { margin-left: 6px; }
@media (max-width: 600px) {
  #special-hours-fields { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #special-hours-fields > .form-group:last-child { grid-column: 1 / -1; }
  #special-hours-fields input { min-width: 0; width: 100%; }
}
