/* ============================================
   Barber Assist Admin — Premium Dark Mode CSS
   ============================================ */

/* ---- Variables Globales ---- */
:root {
  --bg-primary: #0a0a12;
  --bg-secondary: #12121e;
  --bg-card: rgba(18, 18, 30, 0.7);
  --bg-card-solid: #12121e;
  --border-subtle: #1e1e3a;
  --border-glow: rgba(240, 192, 64, 0.15);

  --accent-gold: #f0c040;
  --accent-gold-dim: rgba(240, 192, 64, 0.15);
  --accent-indigo: #6366f1;
  --accent-indigo-dim: rgba(99, 102, 241, 0.15);

  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-full: 9999px;

  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  --sidebar-width: 240px;
  --bottom-nav-height: 72px;
  --header-height: 64px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Utilidades */
.hidden { display: none !important; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-gold), #f6d981);
  color: #111118;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 8px 28px rgba(240, 192, 64, 0.22);
}

.brand-logo-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(216, 183, 93, 0.35);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.08), transparent 52%),
    #0b0c10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.brand-logo-img {
  display: block;
  width: 86%;
  height: 86%;
  object-fit: contain;
}

.brand-icon.brand-logo-frame {
  width: 42px;
  height: 42px;
}

/* ============================================
   PANTALLA DE LOGIN
   ============================================ */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 1000;
  animation: fadeIn 0.5s ease;
}

.login-container {
  text-align: center;
  padding: 2rem;
  max-width: 380px;
  width: 100%;
}

/* Logo animado */
.login-logo {
  margin-bottom: 2.5rem;
}

.login-icon {
  width: 72px;
  height: 72px;
  font-size: 1.35rem;
  margin: 0 auto 0.9rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.login-title {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-gold), #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  font-weight: 400;
}

/* PIN Input */
.pin-wrapper {
  margin-bottom: 2rem;
}

.pin-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.pin-boxes {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.pin-box {
  width: 56px;
  height: 64px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--bg-secondary);
  color: var(--accent-gold);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: all var(--transition);
  caret-color: var(--accent-gold);
  -webkit-text-security: disc;
}

.pin-box:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-dim), 0 0 20px rgba(240, 192, 64, 0.1);
  transform: scale(1.05);
}

.pin-box.filled {
  border-color: var(--accent-gold);
  background: var(--accent-gold-dim);
}

.pin-box.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.pin-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 1rem;
  min-height: 1.2em;
  font-weight: 500;
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #e0a820);
  color: #0a0a12;
  box-shadow: 0 4px 14px rgba(240, 192, 64, 0.25);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(240, 192, 64, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--accent-indigo);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.2);
}
.btn-secondary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  min-height: 32px;
  border-radius: 6px;
}

.btn-full {
  width: 100%;
}

.btn-login {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border-radius: var(--radius-card);
}

/* ============================================
   APP PRINCIPAL — LAYOUT
   ============================================ */
.main-app {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar (Desktop) ---- */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  z-index: 50;
  transition: transform var(--transition-slow);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem;
  margin-bottom: 2rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-gold), #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtext {
  display: block;
  margin-top: 0.08rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0 0.75rem;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-btn);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  min-height: 44px;
}

.sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.sidebar .nav-item.active {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
}

.nav-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 0.75rem;
}

.btn-logout {
  width: 100%;
  justify-content: flex-start;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ---- Contenido Principal ---- */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 0 1.5rem 2rem;
  max-width: 100%;
  min-height: 100vh;
}

/* ---- Top Header ---- */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  position: sticky;
  top: 0;
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 40;
  margin: 0 -1.5rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.branch-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.branch-select {
  min-width: 160px;
  height: 36px;
  padding: 0 2rem 0 0.75rem;
  font-size: 0.82rem;
}

.header-date {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 2px solid var(--accent-gold);
}

/* ---- Navegación Inferior (Mobile) ---- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: rgba(18, 18, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  z-index: 100;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex: 1;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  transition: all var(--transition);
  min-height: 44px;
  padding: 0.5rem 0;
  position: relative;
}

.bottom-nav-icon {
  font-size: 1.35rem;
  transition: transform var(--transition);
}

.bottom-nav-item.active {
  color: var(--accent-gold);
}

.bottom-nav-item.active .bottom-nav-icon {
  transform: scale(1.15);
}

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--accent-gold);
  border-radius: 0 0 4px 4px;
}

/* ============================================
   VISTAS — Transiciones
   ============================================ */
.view {
  display: none;
  animation: fadeSlideIn 0.3s ease;
  padding-top: 1.25rem;
  padding-bottom: 1rem;
}

.view.active {
  display: block;
}

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

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

/* ============================================
   TARJETAS DE ESTADÍSTICAS (Dashboard)
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: rgba(18, 18, 30, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
  cursor: default;
}

.stat-card:hover {
  border-color: rgba(240, 192, 64, 0.35);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.stat-icon {
  font-size: 1.4rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gold-dim);
  border-radius: var(--radius-btn);
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  display: block;
  line-height: 1;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 0.25rem;
  display: block;
}

/* ============================================
   SECCIÓN HEADERS
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-gold {
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
}

.badge-muted {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

/* Status badges con dot */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pendiente {
  background: rgba(240, 192, 64, 0.12);
  color: var(--accent-gold);
}
.status-pendiente::before { background: var(--accent-gold); }

.status-confirmada {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo);
}
.status-confirmada::before { background: var(--accent-indigo); }

.status-completada {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}
.status-completada::before { background: var(--success); }

.status-cancelada {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}
.status-cancelada::before { background: var(--danger); }

.status-no_show {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}
.status-no_show::before { background: var(--warning); }

/* ============================================
   TARJETAS DE CITA
   ============================================ */
.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.appointment-card {
  background: rgba(18, 18, 30, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
}

.appointment-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 18, 30, 0.9);
}

.agenda-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.agenda-summary-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 180px;
}

.agenda-summary-main strong {
  font-size: 1rem;
}

.agenda-summary-kicker,
.agenda-group-branch {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.agenda-summary-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.agenda-summary-metrics span,
.agenda-group-count {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
}

.agenda-summary-metrics strong {
  color: var(--text-primary);
}

.agenda-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.agenda-group-header {
  align-items: flex-end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.25rem 0.15rem 0;
}

.agenda-group-header h3 {
  font-size: 0.95rem;
  margin: 0.1rem 0 0;
}

.agenda-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.appt-time {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
  min-width: 60px;
  text-align: center;
  flex-shrink: 0;
}

.appt-info {
  flex: 1;
  min-width: 0;
}

.appt-client {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appt-detail {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.appt-detail span {
  margin-right: 0.75rem;
}

.appt-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.appt-actions .btn-sm {
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  min-height: 34px;
  min-width: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.action-text {
  font-weight: 600;
}

.btn-action-complete {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.btn-action-complete:hover {
  background: rgba(34, 197, 94, 0.25);
}

.btn-action-cancel {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-action-cancel:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-action-noshow {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.btn-action-noshow:hover {
  background: rgba(245, 158, 11, 0.25);
}

/* ============================================
   FILTROS (Citas)
   ============================================ */
.filters-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 140px;
}

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

/* Inputs */
.input-field {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-btn);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.65rem 0.9rem;
  outline: none;
  transition: all var(--transition);
  width: 100%;
  min-height: 44px;
}

.input-field:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.registered-client-picker {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-client-results {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.55rem;
  max-height: 220px;
  overflow-y: auto;
}

.modal-client-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.modal-client-option:hover,
.modal-client-option.selected {
  border-color: var(--accent-gold);
  background: var(--accent-gold-dim);
}

.modal-client-option strong,
.modal-client-option small {
  display: block;
}

.modal-client-option small,
.modal-client-hint {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.modal-client-hint {
  padding: 0.55rem 0;
}

.client-avatar.small {
  width: 30px;
  height: 30px;
  font-size: 0.72rem;
}

.input-lg {
  font-size: 1.1rem;
  padding: 1rem;
  text-align: center;
}

/* Color scheme para inputs de date */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

select.input-field {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* ============================================
   FAB (Floating Action Button)
   ============================================ */
.fab {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold), #e0a820);
  color: #0a0a12;
  border: none;
  font-size: 1.75rem;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(240, 192, 64, 0.35);
  transition: all var(--transition);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 8px 30px rgba(240, 192, 64, 0.5);
}

/* ============================================
   BARRA DE BÚSQUEDA (Clientes)
   ============================================ */
.search-bar {
  position: relative;
  margin-bottom: 1.25rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.85rem 1rem 0.85rem 3rem;
  outline: none;
  transition: all var(--transition);
  min-height: 48px;
}

.search-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* ============================================
   LISTA DE CLIENTES
   ============================================ */
.clients-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.client-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
}

.client-card:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 2px 12px var(--accent-gold-dim);
  transform: translateX(4px);
}

.client-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--accent-indigo-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-indigo);
  flex-shrink: 0;
}

.client-info {
  flex: 1;
  min-width: 0;
}

.client-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.client-phone {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.client-stats {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.client-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.client-stat {
  text-align: center;
}

.client-stat-value {
  font-size: 1rem;
  font-weight: 700;
  display: block;
  color: var(--accent-gold);
}

.client-stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Panel de detalle del cliente */
.client-detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  z-index: 80;
  padding: 1.5rem;
  overflow-y: auto;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.btn-back {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.detail-info {
  margin-bottom: 2rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(30, 30, 58, 0.5);
}

.detail-row-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.detail-row-value {
  font-weight: 600;
  font-size: 0.9rem;
}

.detail-history h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

/* ============================================
   CONFIGURACIÓN
   ============================================ */
.config-section {
  margin-bottom: 2rem;
}

.config-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: rgba(18, 18, 30, 0.72);
}

.config-tab {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 38px;
  padding: 0.55rem 0.9rem;
  transition: all var(--transition);
}

.config-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.config-tab.active {
  color: #111118;
  background: var(--accent-gold);
}

.config-panel {
  display: none;
}

.config-panel.active {
  display: block;
}

.config-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.branch-admin-note {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
  margin: -0.25rem 0 1rem;
}

.hidden-role {
  display: none !important;
}

.business-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  background: rgba(18, 18, 30, 0.82);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem;
}

.business-config-grid .full {
  grid-column: 1 / -1;
}

.maintenance-zone {
  align-items: center;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding: 1rem;
}

.maintenance-zone h4 {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
}

.maintenance-zone p {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0;
}

.config-item {
  background: rgba(18, 18, 30, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: all var(--transition);
}

.config-item:hover {
  border-color: rgba(255, 255, 255, 0.06);
}

.config-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.config-item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.config-item-detail {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.config-item-price {
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 0.9rem;
}

.config-item-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.config-item-actions .btn {
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
}

.config-item.editing {
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px var(--accent-gold-dim);
}

.config-item.editing .config-item-actions {
  justify-content: flex-end;
}

.edit-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.edit-field.stacked {
  align-items: stretch;
  flex-direction: column;
  margin-bottom: 0;
}

.edit-field label {
  font-size: 0.7rem;
  color: var(--text-muted);
  min-width: 60px;
}

.edit-field input,
.edit-field textarea {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-btn);
  padding: 0.4rem 0.6rem;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
}

.edit-field textarea {
  min-height: 76px;
  resize: vertical;
}

.edit-field input:focus,
.edit-field textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.config-logout {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================
   CALENDARIO
   ============================================ */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
}

.calendar-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: capitalize;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-name {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0.5rem 0;
  letter-spacing: 0.5px;
}

.cal-day {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.5rem;
  min-height: 72px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.cal-day:hover {
  border-color: var(--accent-gold);
  background: var(--accent-gold-dim);
}

.cal-day.today {
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold-dim);
}

.cal-day.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.cal-day.empty:hover {
  background: transparent;
  border-color: transparent;
}

.cal-day-num {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.cal-day.today .cal-day-num {
  color: var(--accent-gold);
}

.cal-day-dots {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.cal-dot.confirmada { background: var(--accent-indigo); }
.cal-dot.completada { background: var(--success); }
.cal-dot.cancelada { background: var(--danger); }

.cal-day-count {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  line-height: 1.2;
}

.cal-count-active {
  color: var(--primary);
  font-weight: 600;
}

.cal-count-done {
  color: var(--success);
  font-weight: 600;
}

.cal-count-cancelled {
  color: var(--danger);
  opacity: 0.75;
}

/* Citas canceladas — apariencia atenuada */
.appointment-card.cancelled-card {
  opacity: 0.65;
  border-left-color: var(--danger);
}

.appointment-card.cancelled-card:hover {
  opacity: 0.85;
}

@media (max-width: 768px) {
  .cal-day {
    min-height: 58px;
    padding: 0.25rem;
  }
  .cal-day-num {
    font-size: 0.75rem;
  }
  .cal-dot {
    width: 4px;
    height: 4px;
  }
  .cal-day-count {
    font-size: 0.58rem;
  }
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.35s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Steps indicator */
.steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  gap: 0;
}

.step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}

.step.active {
  background: var(--accent-gold);
  color: #0a0a12;
  box-shadow: 0 0 12px var(--accent-gold-dim);
}

.step.completed {
  background: var(--success);
  color: white;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  max-width: 30px;
  transition: background var(--transition);
}

.step-line.completed {
  background: var(--success);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.appointment-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.appointment-progress.hidden {
  display: none;
}

.progress-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
}

.form-step {
  display: none;
  animation: fadeSlideIn 0.3s ease;
}

.form-step.active {
  display: block;
}

.step-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

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

/* Opciones de barbero */
.barbero-options,
.servicio-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.barbero-option,
.servicio-option {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.barbero-option:hover,
.servicio-option:hover {
  border-color: var(--accent-gold);
  background: var(--accent-gold-dim);
}

.barbero-option.selected,
.servicio-option.selected {
  border-color: var(--accent-gold);
  background: var(--accent-gold-dim);
  box-shadow: 0 0 16px rgba(240, 192, 64, 0.1);
}

.barbero-option-icon {
  font-size: 1.75rem;
}

.barbero-option-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.barbero-option-schedule {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.servicio-option-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
}

.servicio-option-price {
  font-weight: 700;
  color: var(--accent-gold);
}

.servicio-option-duration {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
}

.check-option input {
  accent-color: var(--accent-gold);
}

/* Time slots */
.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.time-slot {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-btn);
  padding: 0.65rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.time-slot:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.time-slot.selected {
  background: var(--accent-gold);
  color: #0a0a12;
  border-color: var(--accent-gold);
  box-shadow: 0 2px 10px var(--accent-gold-dim);
}

/* Form groups */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

/* Confirm card */
.confirm-card {
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: 0 0 20px var(--accent-gold-dim);
}

.confirm-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.confirm-row-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.confirm-row-label {
  color: var(--text-secondary);
  min-width: 80px;
  font-size: 0.8rem;
}

.confirm-row-value {
  font-weight: 600;
}

/* Loading spinner */
.loading-slots {
  text-align: center;
  padding: 2rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading-slots p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.35s ease;
  pointer-events: auto;
  max-width: 360px;
}

.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--accent-indigo); }

/* ============================================
   SUCCESS OVERLAY (Animación de éxito)
   ============================================ */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  animation: fadeIn 0.3s ease;
}

.success-content {
  text-align: center;
  animation: fadeSlideIn 0.5s ease;
}

.success-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 1rem;
  color: var(--success);
}

.success-content p {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Checkmark animation */
.success-checkmark {
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.check-icon {
  width: 80px;
  height: 80px;
  position: relative;
  border-radius: 50%;
  box-sizing: content-box;
  border: 4px solid var(--success);
}

.check-icon .icon-line {
  height: 4px;
  background-color: var(--success);
  display: block;
  border-radius: 2px;
  position: absolute;
  z-index: 10;
}

.check-icon .icon-line.line-tip {
  top: 44px;
  left: 14px;
  width: 20px;
  transform: rotate(45deg);
  animation: iconLineTip 0.75s;
}

.check-icon .icon-line.line-long {
  top: 38px;
  right: 8px;
  width: 40px;
  transform: rotate(-45deg);
  animation: iconLineLong 0.75s;
}

@keyframes iconLineTip {
  0% { width: 0; left: 1px; top: 19px; }
  54% { width: 0; left: 1px; top: 19px; }
  70% { width: 25px; left: 10px; top: 46px; }
  84% { width: 12px; left: 16px; top: 44px; }
  100% { width: 20px; left: 14px; top: 44px; }
}

@keyframes iconLineLong {
  0% { width: 0; right: 46px; top: 54px; }
  65% { width: 0; right: 46px; top: 54px; }
  84% { width: 44px; right: 0px; top: 35px; }
  100% { width: 40px; right: 8px; top: 38px; }
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, var(--border-subtle) 25%, rgba(30, 30, 58, 0.6) 50%, var(--border-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-btn);
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-card {
  height: 72px;
  border-radius: var(--radius-card);
  margin-bottom: 0.75rem;
}

.skeleton-stat {
  height: 80px;
  border-radius: var(--radius-card);
}

/* ============================================
   RESPONSIVE — Mobile First
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .content {
    margin-left: 0;
    padding: 0 1rem 2rem;
    padding-bottom: calc(var(--bottom-nav-height) + 2rem);
  }

  .bottom-nav {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .filters-bar {
    flex-direction: column;
    gap: 0.75rem;
  }

  .filter-group {
    min-width: 100%;
  }

  .appointment-card {
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
  }

  .agenda-summary,
  .agenda-group-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .agenda-summary-metrics {
    justify-content: flex-start;
  }

  .appt-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
  }

  .fab {
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: 16px;
  }

  .modal {
    max-height: 90vh;
  }

  .client-detail-panel {
    width: 100%;
  }

  .client-stats {
    gap: 0.5rem;
  }

  .client-card {
    flex-wrap: wrap;
  }

  .client-card-main {
    flex-basis: 100%;
  }

  .client-stats {
    flex: 1;
    justify-content: flex-start;
  }

  .client-actions {
    flex: 1;
    justify-content: flex-end;
  }

  .business-config-grid {
    grid-template-columns: 1fr;
  }

  .config-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .config-tab {
    flex: 1;
    min-width: 92px;
  }

  .top-header {
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  .header-date {
    display: none;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
  }

  .toast {
    max-width: 100%;
  }

  .appointments-list {
    max-height: none;
  }

  .time-slots {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop large */
@media (min-width: 1200px) {
  .modal {
    border-radius: var(--radius-card);
    max-height: 80vh;
  }

  .modal-overlay {
    align-items: center;
  }
}

/* ============================================
   Visual Redesign v2 — Barber Assist Operations
   ============================================ */
:root {
  --bg-primary: #08090b;
  --bg-secondary: #111318;
  --bg-card: rgba(22, 24, 30, 0.9);
  --bg-card-solid: #171a21;
  --border-subtle: #282c35;
  --accent-gold: #d8b75d;
  --accent-gold-dim: rgba(216, 183, 93, 0.14);
  --accent-indigo: #7c8cff;
  --success: #35c67a;
  --danger: #ef6461;
  --warning: #e6a93d;
  --text-primary: #f3f4f6;
  --text-secondary: #a9afba;
  --text-muted: #707887;
  --sidebar-width: 252px;
}

body {
  background:
    linear-gradient(180deg, rgba(216, 183, 93, 0.06), transparent 240px),
    radial-gradient(circle at 80% 0%, rgba(124, 140, 255, 0.08), transparent 340px),
    var(--bg-primary);
}

.sidebar {
  background: linear-gradient(180deg, #151820, #0d0f14);
  border-right-color: rgba(255, 255, 255, 0.08);
  padding: 1.1rem 0;
}

.sidebar-brand {
  padding: 0 1rem 1rem;
  margin: 0 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-text {
  background: none;
  -webkit-text-fill-color: var(--text-primary);
  color: var(--text-primary);
  font-size: 1rem;
  letter-spacing: 0;
}

.sidebar .nav-item {
  border-radius: 10px;
  color: #aeb5c2;
  font-weight: 650;
}

.sidebar .nav-item.active {
  background: #222630;
  color: var(--text-primary);
  box-shadow: inset 3px 0 0 var(--accent-gold);
}

.nav-icon,
.bottom-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
}

.content {
  padding: 0 2rem 2.25rem;
}

.top-header {
  height: 72px;
  margin: 0 -2rem;
  padding: 0 2rem;
  background: rgba(8, 9, 11, 0.76);
}

.header-title {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.header-avatar {
  display: none;
}

.ops-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(216, 183, 93, 0.16), rgba(124, 140, 255, 0.06)),
    rgba(20, 22, 28, 0.9);
}

.ops-kicker {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent-gold);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ops-hero h3 {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
}

.ops-hero p {
  margin-top: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.ops-stats {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.stat-card {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 118px;
  padding: 1rem;
  background: rgba(23, 26, 33, 0.94);
  border-color: rgba(255, 255, 255, 0.08);
}

.stat-icon {
  width: auto;
  height: auto;
  padding: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.stat-value {
  font-size: 1.85rem;
}

.stat-label {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.62rem;
}

.ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1rem;
  align-items: start;
}

.ops-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(17, 19, 24, 0.86);
  padding: 1rem;
}

.ops-panel-main .appointments-list {
  max-height: calc(100vh - 430px);
}

.ops-panel-side {
  position: sticky;
  top: 90px;
}

.side-block + .side-block {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.side-label {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.side-block .btn + .btn {
  margin-top: 0.5rem;
}

.rule-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.rule-list span {
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.operation-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.operation-heading h3 {
  font-size: 1.5rem;
}

.operation-heading p {
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.operation-summary {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(17, 19, 24, 0.86);
}

.operation-summary div,
.operation-row div {
  min-width: 0;
}

.operation-summary strong,
.operation-summary span,
.operation-row strong,
.operation-row span,
.operation-row small {
  display: block;
}

.operation-summary span,
.operation-row span,
.operation-row small {
  margin-top: 0.18rem;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.operation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.operation-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.operation-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.operation-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.operation-light,
.operation-event-mark {
  width: 8px;
  height: 8px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.operation-ok .operation-light,
.operation-row-ok .operation-light {
  background: var(--success);
}

.operation-warning .operation-light,
.operation-row-warning .operation-light {
  background: var(--warning);
}

.operation-critical .operation-light,
.operation-row-critical .operation-light {
  background: var(--danger);
}

.operation-event-mark {
  background: var(--accent-indigo);
}

.operation-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.operation-metrics div {
  padding: 0.7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.operation-metrics strong,
.operation-metrics span {
  display: block;
}

.operation-metrics strong {
  font-size: 1.2rem;
}

.reports-panel {
  margin-bottom: 1rem;
}

.report-actions {
  flex-wrap: wrap;
}

.report-date {
  max-width: 155px;
  min-height: 38px;
  padding: 0.5rem 0.65rem;
}

.report-metrics {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.report-row {
  padding: 0.65rem 0.75rem;
}

.operation-metrics span,
.operation-footnote,
.operation-empty {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.operation-footnote,
.operation-empty {
  padding: 0.6rem 0.1rem 0;
}

.operation-problems:empty {
  display: none;
}

.appointment-card,
.client-card,
.config-item,
.business-config-grid {
  background: rgba(23, 26, 33, 0.94);
  border-color: rgba(255, 255, 255, 0.08);
}

.appointment-card {
  border-radius: 11px;
}

.appt-time {
  min-width: 76px;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(216, 183, 93, 0.12);
  color: #f2d98a;
}

.btn-primary {
  background: #d8b75d;
  color: #0a0b0f;
  box-shadow: none;
}

.btn-primary:hover {
  box-shadow: 0 8px 22px rgba(216, 183, 93, 0.22);
}

.config-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(760px, 100%);
  background: rgba(17, 19, 24, 0.88);
}

.config-tab.active {
  background: #d8b75d;
}

@media (max-width: 1180px) {
  .ops-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .ops-grid {
    grid-template-columns: 1fr;
  }

  .ops-panel-side {
    position: static;
  }
}

@media (max-width: 768px) {
  .content {
    padding: 0 1rem 2rem;
    padding-bottom: calc(var(--bottom-nav-height) + 2rem);
  }

  .top-header {
    margin: 0 -1rem;
    padding: 0 1rem;
    height: auto;
    min-height: var(--header-height);
    gap: 0.75rem;
  }

  .header-right {
    gap: 0.55rem;
  }

  .branch-switcher span {
    display: none;
  }

  .branch-select {
    min-width: 116px;
    max-width: 42vw;
  }

  .ops-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 1.1rem;
  }

  .ops-hero h3 {
    font-size: 1.45rem;
  }

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

  .stat-card {
    min-height: 104px;
  }

  .operation-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .operation-grid {
    grid-template-columns: 1fr;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-date {
    max-width: none;
  }

  .bottom-nav-icon {
    width: 28px;
    height: 22px;
  }
}

@media (max-width: 560px) {
  .config-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   Visual Refinement v3 — Operación clara
   ============================================ */
.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.view-heading h3 {
  color: var(--text-primary);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
}

.ops-hero {
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(216, 183, 93, 0.12), rgba(124, 140, 255, 0.04)),
    #151821;
}

.ops-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.ops-meta-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
}

.ops-panel,
.stat-card,
.client-card,
.config-item,
.business-config-grid {
  border-radius: 10px;
}

.ops-panel-main .section-header {
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.appointment-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  border-radius: 10px;
  padding: 0.9rem;
  background: #171a21;
}

.appointment-card:hover {
  border-color: rgba(216, 183, 93, 0.28);
  background: #1a1e27;
  transform: translateY(-1px);
}

.appt-time {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  width: 88px;
  min-height: 58px;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  background: rgba(216, 183, 93, 0.12);
  text-align: center;
}

.appt-time strong,
.appt-time small {
  display: block;
}

.appt-time strong {
  color: #f2d98a;
  font-size: 1.12rem;
  line-height: 1.1;
}

.appt-time small {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
}

.appt-client-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.appt-client {
  margin-bottom: 0.18rem;
  color: var(--text-primary);
  font-size: 0.96rem;
  font-weight: 800;
}

.appt-phone {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.appt-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.appt-detail span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-right: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.status-badge {
  flex-shrink: 0;
  white-space: nowrap;
}

.appt-actions {
  align-self: stretch;
  align-items: center;
  justify-content: flex-end;
  max-width: 300px;
}

.appt-actions .btn-sm {
  min-height: 34px;
  border-radius: 7px;
}

.appointment-card-history {
  grid-template-columns: 76px minmax(0, 1fr) auto;
  margin-bottom: 0.5rem;
}

.appointment-card-history .appt-time {
  width: 76px;
}

.filters-bar,
.search-bar {
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(17, 19, 24, 0.7);
}

.search-bar {
  margin-bottom: 1rem;
}

.clients-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(620px, 1fr));
  gap: 0.75rem;
}

.client-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: stretch;
  padding: 0.85rem;
  background: #171a21;
}

.client-card:hover {
  border-color: rgba(216, 183, 93, 0.28);
  box-shadow: none;
  transform: none;
}

.client-avatar {
  border-radius: 8px;
  background: rgba(124, 140, 255, 0.14);
}

.client-name {
  font-size: 0.95rem;
  font-weight: 800;
}

.client-phone {
  overflow-wrap: anywhere;
}

.client-stats {
  align-items: center;
  min-width: 126px;
  justify-content: center;
  padding: 0 0.65rem;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.client-actions {
  align-items: center;
}

.client-actions .btn-sm {
  min-width: 58px;
}

.fab {
  display: none;
}

.client-detail-panel {
  background: #111318;
  box-shadow: -22px 0 60px rgba(0, 0, 0, 0.32);
}

.detail-row {
  gap: 1rem;
}

.detail-row-value {
  text-align: right;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .clients-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .view-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .view-heading .btn {
    width: 100%;
  }

  .appointment-card,
  .appointment-card-history {
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: start;
  }

  .appt-time {
    width: 76px;
    min-height: 54px;
  }

  .appt-client-row {
    flex-direction: column;
    gap: 0.45rem;
  }

  .appointment-card > .appt-actions {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    margin-top: 0.2rem;
    padding-top: 0.65rem;
  }

  .appt-actions .btn-sm {
    flex: 1;
  }

  .client-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .fab {
    display: flex;
  }

  .client-stats {
    justify-content: flex-start;
    padding: 0.75rem 0;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .client-actions {
    justify-content: stretch;
  }

  .client-actions .btn-sm {
    flex: 1;
  }

  .maintenance-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .maintenance-zone .btn {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .ops-meta-row span,
  .appt-detail span {
    width: 100%;
  }

  .appointment-card,
  .appointment-card-history {
    grid-template-columns: 1fr;
  }

  .appt-time {
    align-items: center;
    flex-direction: row;
    gap: 0.5rem;
    width: 100%;
    min-height: 42px;
  }

  .appt-time small {
    margin-top: 0;
  }
}
