@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,1,0&family=IBM+Plex+Sans:wght@500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ════════════════════════════════════════════════════════════════════════════
   OBSIDIAN SENTINEL — Theme Tokens (Admin Panel)
   Tema por defecto: DARK. Tema claro vía [data-theme="light"].
   ──────────────────────────────────────────────────────────────────────────── */

/* ── DARK (default) ── */
:root {
  /* Marca — Obsidian Sentinel */
  --os-primary:    #1B2B48;   /* navy profundo  */
  --os-secondary:  #4A5568;   /* slate gris     */
  --os-tertiary:   #2D3748;   /* slate oscuro   */
  --os-neutral:    #101827;   /* casi negro     */

  /* Primary (acción) */
  --md-primary:           #5B7FB9;   /* navy aclarado para acción/legibilidad */
  --md-on-primary:        #FFFFFF;
  --md-primary-container: #1B2B48;
  --md-on-primary-cont:   #C7D6EE;
  --md-primary-dim:       rgba(91,127,185,.10);
  --md-primary-bd:        rgba(91,127,185,.40);
  --md-primary-light:     rgba(91,127,185,.18);

  /* Secondary — Slate */
  --md-secondary:         #4A5568;
  --md-on-secondary:      #FFFFFF;
  --md-secondary-dim:     rgba(74,85,104,.12);
  --md-secondary-bd:      rgba(74,85,104,.45);

  /* Tertiary — Slate oscuro */
  --md-tertiary:          #2D3748;
  --md-tertiary-dim:      rgba(45,55,72,.30);
  --md-tertiary-bd:       rgba(45,55,72,.55);

  /* Superficies — Obsidian */
  --md-bg:       #101827;
  --md-surface:  #1B2B48;
  --md-surf-lo:  #19243b;
  --md-surf-mid: #2D3748;
  --md-surf-hi:  #38445c;
  --md-surf-top: #4A5568;
  --md-on-surf:  #E8EDF4;
  --md-on-surf-var: #A0AEC0;

  /* Outline */
  --md-outline:     rgba(160,174,192,.28);
  --md-outline-var: rgba(160,174,192,.12);

  /* Estado */
  --md-green:    #48BB78;
  --md-green-b:  rgba(72,187,120,.14);
  --md-green-bd: rgba(72,187,120,.30);
  --md-red:      #F56565;
  --md-red-b:    rgba(245,101,101,.14);
  --md-red-bd:   rgba(245,101,101,.30);
  --md-blue:     #5B7FB9;
  --md-blue-b:   rgba(91,127,185,.14);
  --md-blue-bd:  rgba(91,127,185,.30);
  --md-orange:   #ED8936;
  --md-orange-b: rgba(237,137,54,.14);
  --md-orange-bd:rgba(237,137,54,.30);
  --md-gray:     #718096;
  --md-gray-b:   rgba(113,128,150,.14);
  --md-wa:       #25d366;

  /* Tipografía Obsidian Sentinel */
  --md-font-d: 'IBM Plex Sans', system-ui, sans-serif;  /* Headline */
  --md-font-b: 'Inter', system-ui, sans-serif;          /* Body     */
  --md-font-l: 'JetBrains Mono', ui-monospace, monospace;/* Label    */

  /* Shape */
  --md-r-xs:   4px;
  --md-r-sm:   8px;
  --md-r-md:   12px;
  --md-r-lg:   16px;
  --md-r-xl:   28px;
  --md-r-full: 50px;

  --md-transition: 180ms cubic-bezier(.4,0,.2,1);
  --md-transition-fast: 120ms cubic-bezier(.4,0,.2,1);

  /* Elevación / Sombra */
  --shadow-0: none;
  --shadow-1: 0 1px 3px rgba(0,0,0,.35);
  --shadow-2: 0 2px 6px rgba(0,0,0,.40);
  --shadow-3: 0 4px 12px rgba(0,0,0,.45);
  --shadow-4: 0 8px 16px rgba(0,0,0,.50);
  color-scheme: dark;
}

html { transition: none; }
body, .sidebar, .stat-card, .topbar, .btn, .card { transition: background-color var(--md-transition), color var(--md-transition), border-color var(--md-transition); }

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

body {
  font-family: var(--md-font-b);
  background: var(--md-bg);
  color: var(--md-on-surf);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

html { scroll-behavior: smooth; }

/* Material Symbols */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-variation-settings: 'FILL' 1,'wght' 400,'GRAD' 0,'opsz' 24;
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;       /* evita que el letter-spacing del diseño rompa las ligaduras */
  text-transform: none;         /* evita uppercase heredado */
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  user-select: none;
  pointer-events: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Selection */
::selection {
  background: var(--md-primary);
  color: var(--md-on-primary);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--md-surf-lo); }
::-webkit-scrollbar-thumb { background: var(--md-outline); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--md-on-surf-var); }

/* ── App Layout ── */
.app-layout { display: flex; min-height: 100vh; }

/* ── MD3 Navigation Drawer ── */
.sidebar {
  width: 256px;
  min-width: 256px;
  background: var(--md-surf-lo);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--md-outline-var);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px 16px;
}
.brand-logo {
  width: 148px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-sub { font-size: .67rem; color: var(--md-on-surf-var); text-align: center; }

/* MD3 Navigation Drawer Section Label */
.nav-section-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--md-on-surf-var);
  text-transform: uppercase;
  padding: 16px 28px 8px;
}

.sidebar-nav { flex: 1; padding: 8px 12px; }

/* MD3 Navigation Drawer Destination */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 56px;
  color: var(--md-on-surf-var);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .01em;
  border-radius: var(--md-r-full);
  margin-bottom: 4px;
  transition: background var(--md-transition), color var(--md-transition);
  position: relative;
  overflow: hidden;
}
.nav-item::before {
  content: '';
  position: absolute; inset: 0;
  background: currentColor; opacity: 0;
  border-radius: inherit; transition: opacity var(--md-transition);
}
.nav-item:hover { color: var(--md-on-surf); }
.nav-item:hover::before { opacity: .08; }

/* MD3 Active Navigation Destination — indicator pill */
.nav-item.active {
  background: var(--md-primary-dim);
  color: var(--md-primary);
  font-weight: 600;
}
.nav-item.active::before { opacity: 0; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--md-outline-var);
}
.user-role {
  display: block;
  font-size: .68rem;
  color: var(--md-on-surf-var);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 2px;
}
.user-name {
  display: block;
  font-size: .875rem;
  color: var(--md-primary);
  font-weight: 600;
}

/* MD3 Text Button — Logout */
.btn-logout {
  margin-top: 12px;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--md-on-surf-var);
  padding: 0 16px;
  height: 40px;
  cursor: pointer;
  border-radius: var(--md-r-full);
  font-size: .875rem;
  font-family: var(--md-font-b);
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  transition: background var(--md-transition), color var(--md-transition);
  position: relative; overflow: hidden;
}
.btn-logout::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--md-red); opacity: 0;
  border-radius: inherit; transition: opacity var(--md-transition);
}
.btn-logout:hover { color: var(--md-red); }
.btn-logout:hover::before { opacity: .08; }

/* MD3 Text Button — Toggle de tema (footer desktop) */
.btn-theme {
  width: 100%;
  background: transparent;
  border: 1px solid var(--md-outline-var);
  color: var(--md-on-surf-var);
  padding: 0 16px;
  height: 40px;
  cursor: pointer;
  border-radius: var(--md-r-full);
  font-size: .8rem;
  font-family: var(--md-font-l);
  font-weight: 500;
  letter-spacing: .02em;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  transition: background var(--md-transition), color var(--md-transition), border-color var(--md-transition);
}
.btn-theme:hover { color: var(--md-on-surf); border-color: var(--md-outline); background: var(--md-primary-dim); }

/* Toggle de tema móvil (topbar) */
.theme-toggle {
  width: 48px; height: 48px;
  background: transparent; border: none;
  color: var(--md-on-surf-var);
  cursor: pointer;
  border-radius: var(--md-r-full);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--md-transition), color var(--md-transition);
}
.theme-toggle:hover { color: var(--md-on-surf); background: var(--md-primary-dim); }

/* ── Barra superior de escritorio ── */
.desktop-topbar {
  display: flex; justify-content: flex-end; align-items: center;
  margin-bottom: 8px;
}
@media (max-width: 1024px) { .desktop-topbar { display: none; } }
.topbar-actions { display: flex; align-items: center; gap: 4px; }

/* ── Campanita ── */
.bell-root { position: relative; }
.bell-btn {
  width: 44px; height: 44px;
  background: transparent; border: none;
  color: var(--md-on-surf-var);
  cursor: pointer;
  border-radius: var(--md-r-full);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: background var(--md-transition), color var(--md-transition);
}
.bell-btn:hover { color: var(--md-on-surf); background: var(--md-primary-dim); }
.bell-btn .material-symbols-rounded { font-size: 22px; }
.bell-badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--md-red); color: #fff;
  border-radius: var(--md-r-full);
  font-size: .64rem; font-weight: 700;
  font-family: var(--md-font-l);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--md-bg);
}
.bell-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 340px; max-width: calc(100vw - 32px);
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: var(--md-r-md);
  box-shadow: var(--shadow-4);
  z-index: 400;
  overflow: hidden;
  animation: bell-in .16s cubic-bezier(.4,0,.2,1);
}
@keyframes bell-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.bell-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--md-outline-var);
  font-family: var(--md-font-d);
  font-weight: 600; font-size: .92rem;
  color: var(--md-on-surf);
}
.bell-readall {
  background: transparent; border: none;
  color: var(--md-primary);
  font-family: var(--md-font-l);
  font-size: .72rem; font-weight: 500;
  cursor: pointer;
}
.bell-readall:hover { text-decoration: underline; }
.bell-list { max-height: 360px; overflow-y: auto; }
.bell-empty {
  padding: 28px 16px; text-align: center;
  color: var(--md-on-surf-var); font-size: .82rem;
}
.bell-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--md-outline-var);
  text-decoration: none;
  transition: background var(--md-transition-fast);
}
.bell-item:last-child { border-bottom: none; }
.bell-item:hover { background: var(--md-primary-dim); }
.bell-item.is-unread { background: var(--md-primary-light); }
.bell-item-ico {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: var(--md-r-sm);
  background: var(--md-primary-dim);
  color: var(--md-primary);
  display: flex; align-items: center; justify-content: center;
}
.bell-item-ico .material-symbols-rounded { font-size: 18px; }
.bell-item-body { display: flex; flex-direction: column; min-width: 0; }
.bell-item-title { font-size: .82rem; font-weight: 600; color: var(--md-on-surf); }
.bell-item-msg {
  font-size: .78rem; color: var(--md-on-surf-var);
  line-height: 1.4; margin: 2px 0;
}
.bell-item-time {
  font-size: .68rem; color: var(--md-on-surf-var); opacity: .7;
  font-family: var(--md-font-l);
}
.bell-foot {
  display: block; text-align: center;
  padding: 10px; font-size: .76rem;
  color: var(--md-primary); text-decoration: none;
  border-top: 1px solid var(--md-outline-var);
  font-family: var(--md-font-l);
}
.bell-foot:hover { background: var(--md-primary-dim); }

/* ── Main Content ── */
.main-content { flex: 1; padding: 28px 32px; overflow-x: auto; min-width: 0; }

/* ── MD3 Top App Bar (mobile topbar) ── */
.topbar {
  display: none;
  position: sticky; top: 0; z-index: 200;
  background: var(--md-surf-lo);
  border-bottom: 1px solid var(--md-outline-var);
  padding: 0 16px;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.topbar-brand {
  font-family: var(--md-font-b); font-weight: 700;
  font-size: .85rem; color: var(--md-primary);
  letter-spacing: .08em; text-transform: uppercase;
}
.hamburger {
  width: 48px; height: 48px;
  background: transparent; border: none;
  color: var(--md-on-surf-var);
  font-size: 1.3rem; cursor: pointer;
  border-radius: var(--md-r-full);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--md-transition), color var(--md-transition);
  position: relative; overflow: hidden;
}
.hamburger::before {
  content: '';
  position: absolute; inset: 0;
  background: currentColor; opacity: 0;
  border-radius: inherit; transition: opacity var(--md-transition);
}
.hamburger:hover { color: var(--md-on-surf); }
.hamburger:hover::before { opacity: .08; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.52);
  z-index: 290;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.is-open { display: block; }

/* ── Page Header ── */
.page-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title {
  font-family: var(--md-font-d);
  font-size: 1.6rem; font-weight: 600;
  color: var(--md-primary);
}
.page-date { color: var(--md-on-surf-var); font-size: .8rem; margin-top: 2px; }

/* ── MD3 Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 20px; height: 40px;
  border: none; border-radius: var(--md-r-full);
  font-family: var(--md-font-b); font-size: .875rem;
  font-weight: 600; letter-spacing: .01em;
  cursor: pointer; text-decoration: none;
  transition: box-shadow var(--md-transition), background var(--md-transition);
  position: relative; overflow: hidden;
  white-space: nowrap;
}
.btn::before {
  content: '';
  position: absolute; inset: 0;
  background: currentColor; opacity: 0;
  border-radius: inherit; transition: opacity var(--md-transition);
}
.btn:hover::before  { opacity: .08; }
.btn:active::before { opacity: .14; }

/* Filled — Primary */
.btn-primary {
  background: var(--md-primary);
  color: var(--md-on-primary);
}
.btn-primary:hover {
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
}

/* Tonal (outline) */
.btn-outline {
  background: var(--md-surf-hi);
  color: var(--md-on-surf);
  border: 1px solid var(--md-outline);
}

/* Text / ghost */
.btn-ghost {
  background: transparent;
  color: var(--md-primary);
}

/* WhatsApp */
.btn-wa {
  background: var(--md-wa);
  color: #fff;
}
.btn-wa:hover { box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15); }

/* Modifiers */
.btn-full { width: 100%; justify-content: center; }
.btn-sm   { height: 32px; padding: 0 12px; font-size: .8rem; }

/* Utility spacing */
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-4 { margin-top: 24px; }
.ml-1 { margin-left: 6px; }

/* ── MD3 Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: linear-gradient(135deg, var(--md-surf-lo) 0%, var(--md-surf-mid) 100%);
  border: 1px solid var(--md-outline);
  border-radius: var(--md-r-lg);
  padding: 22px 18px 18px;
  position: relative;
  overflow: hidden;
  transition: all var(--md-transition);
  box-shadow: var(--shadow-1);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, var(--md-primary-light) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--md-transition);
}

.stat-card:hover {
  border-color: var(--md-primary);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

.stat-card:hover::before { opacity: 1; }

.stat-card.stat-highlight {
  border-color: var(--md-primary);
  background: linear-gradient(135deg, var(--md-primary-light) 0%, var(--md-primary-dim) 100%);
}

.stat-value {
  font-family: var(--md-font-d);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--md-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--md-on-surf-var);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stat-dot {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
  opacity: 0.8;
}

.dot-gray   { background: var(--md-gray); }
.dot-blue   { background: var(--md-blue); }
.dot-gold   { background: var(--md-primary); }
.dot-green  { background: var(--md-green); }
.dot-red    { background: var(--md-red); }
.dot-orange { background: var(--md-orange); }

/* ── Dashboard: icono de stat ── */
.stat-ico {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: var(--md-r-sm);
  background: var(--md-primary-dim);
  color: var(--md-primary);
  display: flex; align-items: center; justify-content: center;
}
.stat-ico .material-symbols-rounded { font-size: 20px; }
.stat-value-sm { font-size: 1.5rem; }
.stat-card .stat-dot { display: none; }

/* ── Dashboard: chips de estado ── */
.status-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 28px;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: var(--md-r-full);
  font-size: .78rem;
  font-family: var(--md-font-l);
  font-weight: 500;
  border: 1px solid var(--md-outline-var);
  background: var(--md-surf-lo);
  color: var(--md-on-surf-var);
}
.chip b { font-weight: 700; color: var(--md-on-surf); }
.chip-gray   { border-color: var(--md-gray-b); }
.chip-blue   { border-color: var(--md-blue-bd); }
.chip-blue b { color: var(--md-blue); }
.chip-orange { border-color: var(--md-orange-bd); }
.chip-orange b { color: var(--md-orange); }
.chip-green  { border-color: var(--md-green-bd); }
.chip-green b { color: var(--md-green); }
.chip-red    { border-color: var(--md-red-bd); }
.chip-red b  { color: var(--md-red); }

/* ── Dashboard: columnas ── */
.dash-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
.dash-panel {
  background: var(--md-surf-lo);
  border: 1px solid var(--md-outline);
  border-radius: var(--md-r-lg);
  padding: 18px 20px 14px;
  box-shadow: var(--shadow-1);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--md-outline-var);
}
.panel-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--md-font-d);
  font-size: 1.05rem; font-weight: 600;
  color: var(--md-on-surf);
}
.panel-title .material-symbols-rounded { font-size: 20px; color: var(--md-primary); }
.panel-link {
  font-family: var(--md-font-l);
  font-size: .76rem; font-weight: 500;
  color: var(--md-primary); text-decoration: none;
}
.panel-link:hover { text-decoration: underline; }

/* ── Lista de citas ── */
.appt-list { list-style: none; display: flex; flex-direction: column; }
.appt-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--md-outline-var);
  transition: background var(--md-transition-fast);
}
.appt-row:last-child { border-bottom: none; }
.appt-row:hover { background: var(--md-primary-dim); border-radius: var(--md-r-sm); }
.appt-time {
  font-family: var(--md-font-l);
  font-size: .85rem; font-weight: 600;
  color: var(--md-primary);
  min-width: 52px; flex-shrink: 0;
}
.appt-date { display: flex; flex-direction: column; line-height: 1.25; min-width: 56px; }
.appt-date .d-day  { font-size: .76rem; color: var(--md-on-surf-var); text-transform: capitalize; }
.appt-date .d-hour { font-size: .85rem; color: var(--md-primary); }
.appt-info { flex: 1; min-width: 0; }
.appt-client {
  font-weight: 600; font-size: .9rem; color: var(--md-on-surf);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.appt-meta {
  font-size: .78rem; color: var(--md-on-surf-var);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Badges de estado ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: var(--md-r-full);
  font-size: .72rem; font-weight: 600;
  font-family: var(--md-font-l);
  white-space: nowrap; flex-shrink: 0;
}
.badge-gray   { background: var(--md-gray-b);   color: var(--md-gray); }
.badge-blue   { background: var(--md-blue-b);   color: var(--md-blue); }
.badge-green  { background: var(--md-green-b);  color: var(--md-green); }
.badge-orange { background: var(--md-orange-b); color: var(--md-orange); }
.badge-red    { background: var(--md-red-b);    color: var(--md-red); }

/* ── Estado vacío ── */
.empty-state {
  text-align: center; padding: 32px 16px;
  color: var(--md-on-surf-var);
}
.empty-state .material-symbols-rounded {
  font-size: 40px; opacity: .5; margin-bottom: 8px;
  display: inline-block;
}
.empty-state p { font-size: .85rem; }

@media (max-width: 900px) {
  .dash-cols { grid-template-columns: 1fr; }
}

/* ── Stack derecho del dashboard ── */
.dash-stack { display: flex; flex-direction: column; gap: 20px; }

/* ── Tarjeta de barbero del día ── */
.barber-card { border-color: var(--md-primary-bd); }
.barber-body { display: flex; align-items: center; gap: 16px; }
.barber-avatar {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--os-secondary), var(--os-primary));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--md-font-d);
  font-size: 1.5rem; font-weight: 700;
}
.barber-info { min-width: 0; }
.barber-name {
  font-family: var(--md-font-d);
  font-size: 1.05rem; font-weight: 600;
  color: var(--md-on-surf);
}
.barber-stats {
  font-family: var(--md-font-l);
  font-size: .76rem; color: var(--md-on-surf-var);
  display: flex; align-items: center; gap: 6px; margin: 4px 0;
}
.barber-stats b { color: var(--md-on-surf); font-weight: 700; }
.barber-stats .t-sep { opacity: .4; }
.barber-rev {
  font-size: .8rem; color: var(--md-green); font-weight: 600;
}

/* ── Tendencia semanal ── */
.trend-panel { margin-bottom: 20px; }
.trend-totals {
  font-family: var(--md-font-l);
  font-size: .76rem; color: var(--md-on-surf-var);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.trend-totals b { color: var(--md-on-surf); font-weight: 700; }
.trend-totals .t-rev b { color: var(--md-green); }
.trend-totals .t-sep { opacity: .4; }

.chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  height: 180px;
  padding: 8px 4px 0;
}
.chart-col {
  display: flex; flex-direction: column; align-items: center;
  min-width: 0;
}
.bar-wrap {
  flex: 1; width: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  position: relative;
}
.bar-count {
  font-family: var(--md-font-l);
  font-size: .7rem; font-weight: 600;
  color: var(--md-on-surf-var);
  margin-bottom: 4px; height: 14px;
}
.bar {
  width: 70%; max-width: 38px;
  background: var(--md-surf-hi);
  border-radius: var(--md-r-sm) var(--md-r-sm) 0 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: height var(--md-transition);
  position: relative; overflow: hidden;
}
.bar-fill {
  width: 100%;
  background: var(--md-green);
  border-radius: 0;
  transition: height var(--md-transition);
}
.chart-col.is-today .bar { background: var(--md-primary-bd); }
.chart-col.is-today .bar-count { color: var(--md-primary); }
.chart-x {
  font-family: var(--md-font-l);
  font-size: .72rem; font-weight: 500;
  color: var(--md-on-surf-var);
  margin-top: 8px;
}
.chart-col.is-today .chart-x { color: var(--md-primary); font-weight: 700; }
.chart-xd {
  font-size: .66rem; color: var(--md-on-surf-var); opacity: .6;
}
.chart-legend {
  display: flex; gap: 18px; justify-content: center;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--md-outline-var);
}
.lg {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .74rem; color: var(--md-on-surf-var);
  font-family: var(--md-font-l);
}
.lg-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-completed { background: var(--md-green); }
.lg-total { background: var(--md-surf-hi); }

/* ── MD3 Data Table Card ── */
.table-card {
  background: var(--md-surf-lo);
  border: 1px solid var(--md-outline);
  border-radius: var(--md-r-lg);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-1);
  transition: all var(--md-transition);
}

.table-card:hover {
  box-shadow: var(--shadow-2);
  border-color: var(--md-primary);
}

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

.table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--md-on-surf-var);
  border-bottom: 2px solid var(--md-outline);
  background: linear-gradient(135deg, var(--md-surf-mid) 0%, var(--md-surf-hi) 100%);
  font-weight: 700;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--md-outline-var);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

.table tbody tr {
  transition: background-color var(--md-transition-fast);
}

.table tbody tr:hover {
  background: var(--md-primary-dim);
}

.table-compact th { padding: 10px 14px; }
.table-compact td { padding: 10px 14px; font-size: 0.82rem; }

/* ── MD3 Chips (Status Badges) ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--md-r-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 1px solid;
  text-transform: uppercase;
  transition: all var(--md-transition-fast);
}

.badge-gray   {
  background: var(--md-gray-b);
  color: var(--md-gray);
  border-color: rgba(136,153,170,.2);
}

.badge-blue   {
  background: var(--md-blue-b);
  color: var(--md-blue);
  border-color: var(--md-blue-bd);
}

.badge-gold   {
  background: var(--md-primary-dim);
  color: var(--md-primary);
  border-color: var(--md-primary-bd);
  box-shadow: 0 0 8px var(--md-primary-light);
}

.badge-green  {
  background: var(--md-green-b);
  color: var(--md-green);
  border-color: var(--md-green-bd);
}

.badge-red    {
  background: var(--md-red-b);
  color: var(--md-red);
  border-color: var(--md-red-bd);
}

.badge-orange {
  background: var(--md-orange-b);
  color: var(--md-orange);
  border-color: var(--md-orange-bd);
}

/* ── Section Headers ── */
.section-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 12px;
}
.section-title { font-size: .95rem; font-weight: 600; color: var(--md-on-surf); }

/* ── Filter Bar ── */
.filter-bar {
  display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}
.form-control-sm {
  background: var(--md-surf-mid);
  border: 1px solid var(--md-outline);
  color: var(--md-on-surf);
  padding: 0 12px; height: 36px;
  border-radius: var(--md-r-full);
  font-family: var(--md-font-b); font-size: .82rem;
  transition: border-color var(--md-transition);
  outline: none;
}
.form-control-sm:focus { border-color: var(--md-primary); }

/* ── MD3 Forms ── */
.form-card {
  background: var(--md-surf-lo);
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-r-lg);
  padding: 24px; width: 100%;
}
.form-section-title {
  font-size: .78rem; font-weight: 700; color: var(--md-primary);
  text-transform: uppercase; letter-spacing: .07em;
  margin: 24px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--md-outline-var);
}
.form-section-title:first-child { margin-top: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label {
  font-size: .72rem; font-weight: 600;
  color: var(--md-on-surf-var);
  text-transform: uppercase; letter-spacing: .05em;
}
.form-group input,
.form-group select,
.form-group textarea {
  background: transparent;
  border: 1px solid var(--md-outline);
  color: var(--md-on-surf);
  padding: 10px 14px;
  border-radius: var(--md-r-sm);
  font-family: var(--md-font-b); font-size: .9rem;
  transition: border-color var(--md-transition), border-width .1s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--md-primary);
  border-width: 2px;
}
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.form-inline { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.form-inline .form-group { margin-bottom: 0; }

/* ── Services Grid ── */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 6px; }
.service-category {
  background: var(--md-surf-mid);
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-r-md);
  padding: 12px;
}
.service-cat-title {
  font-size: .68rem; font-weight: 700; color: var(--md-primary);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px;
}
.service-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; cursor: pointer; font-size: .84rem;
}
.service-item input { accent-color: var(--md-primary); }
.service-name { flex: 1; }
.service-price { color: var(--md-primary); font-weight: 600; }
.service-duration { color: var(--md-on-surf-var); font-size: .74rem; }

.services-grid-sm { display: flex; flex-direction: column; gap: 4px; }
.service-item-sm {
  display: flex; align-items: center; gap: 8px;
  font-size: .84rem; padding: 3px 0; cursor: pointer;
}
.service-item-sm input { accent-color: var(--md-primary); }

/* ── Detail Layout ── */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; }
.detail-main { display: flex; flex-direction: column; gap: 14px; }
.detail-side { display: flex; flex-direction: column; gap: 12px; }

.info-card, .action-card {
  background: var(--md-surf-lo);
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-r-lg);
  padding: 18px;
}
.card-title {
  font-size: .72rem; font-weight: 700; color: var(--md-primary);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 14px;
}
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--md-outline-var);
  font-size: .875rem;
}
.info-row:last-child { border-bottom: none; }
.info-row > span { color: var(--md-on-surf-var); }
.service-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: .875rem;
  border-bottom: 1px solid var(--md-outline-var);
}
.service-total {
  display: flex; justify-content: flex-end;
  padding: 10px 0 0; font-size: .9rem;
  color: var(--md-primary); font-weight: 600;
}

/* ── Badge Action Buttons ── */
.badge-action {
  display: flex; justify-content: center; align-items: center;
  padding: 0 16px; height: 36px;
  border: 1px solid;
  border-radius: var(--md-r-full);
  font-size: .82rem; font-weight: 600;
  cursor: pointer; background: transparent;
  width: 100%;
  transition: background var(--md-transition);
  font-family: var(--md-font-b);
}
.badge-action.badge-blue   { color: var(--md-blue);   border-color: var(--md-blue-bd); }
.badge-action.badge-blue:hover   { background: var(--md-blue-b); }
.badge-action.badge-gold   { color: var(--md-primary); border-color: var(--md-primary-bd); }
.badge-action.badge-gold:hover   { background: var(--md-primary-dim); }
.badge-action.badge-green  { color: var(--md-green);  border-color: var(--md-green-bd); }
.badge-action.badge-green:hover  { background: var(--md-green-b); }
.badge-action.badge-red    { color: var(--md-red);    border-color: var(--md-red-bd); }
.badge-action.badge-red:hover    { background: var(--md-red-b); }
.badge-action.badge-orange { color: var(--md-orange); border-color: var(--md-orange-bd); }
.badge-action.badge-orange:hover { background: var(--md-orange-b); }

/* ── MD3 Alerts / Banners ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--md-r-md);
  font-size: .875rem;
  margin-bottom: 16px;
  border: 1px solid;
  display: flex; align-items: center; gap: 10px;
}
.alert-error   { background: var(--md-red-b);   border-color: var(--md-red-bd);   color: var(--md-red); }
.alert-success { background: var(--md-green-b); border-color: var(--md-green-bd); color: var(--md-green); }
.alert-info    { background: var(--md-blue-b);  border-color: var(--md-blue-bd);  color: var(--md-blue); }

/* ── Links ── */
.link { color: var(--md-primary); text-decoration: none; font-size: .875rem; }
.link:hover { color: #ffda6a; text-decoration: underline; }
.wa-link { color: var(--md-wa); text-decoration: none; font-size: .875rem; }
.wa-link:hover { text-decoration: underline; }
.text-muted { color: var(--md-on-surf-var); font-size: .875rem; }

/* ── Pagination ── */
.pagination { display: flex; gap: 4px; padding: 12px 16px; flex-wrap: wrap; }
.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--md-r-full);
  font-size: .82rem; text-decoration: none;
  color: var(--md-on-surf-var);
  border: 1px solid var(--md-outline-var);
  transition: all var(--md-transition);
  font-family: var(--md-font-b);
}
.page-btn:hover { border-color: var(--md-outline); color: var(--md-on-surf); }
.page-btn.active {
  background: var(--md-primary);
  color: var(--md-on-primary);
  border-color: var(--md-primary);
  font-weight: 700;
}

/* ── Empty State ── */
.empty-state {
  padding: 40px 24px;
  text-align: center;
  color: var(--md-on-surf-var);
  font-size: .9rem;
}

/* ── Category Title ── */
.cat-title {
  font-size: .72rem; font-weight: 700; color: var(--md-primary);
  text-transform: uppercase; letter-spacing: .09em;
  padding: 10px 16px;
  background: var(--md-surf-mid);
  border-bottom: 1px solid var(--md-outline-var);
}

/* ── Modal ── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--md-surf-lo);
  border: 1px solid var(--md-outline);
  border-radius: var(--md-r-xl);
  padding: 28px;
  width: 480px; max-width: 95vw;
}
.modal-box h3 { color: var(--md-primary); margin-bottom: 12px; font-size: 1.1rem; }
.modal-box textarea {
  background: transparent;
  border: 1px solid var(--md-outline);
  color: var(--md-on-surf);
  padding: 12px;
  border-radius: var(--md-r-md);
  font-family: var(--md-font-b); font-size: .9rem;
  resize: vertical; outline: none;
}
.modal-box textarea:focus { border-color: var(--md-primary); border-width: 2px; }

/* ── MD3 Tabs ── */
.tab-bar {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--md-outline-var);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 20px;
  font-size: .875rem; font-weight: 500;
  color: var(--md-on-surf-var);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--md-transition), border-color var(--md-transition);
  position: relative; overflow: hidden;
}
.tab-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--md-primary); opacity: 0;
  transition: opacity var(--md-transition);
}
.tab-btn:hover { color: var(--md-on-surf); }
.tab-btn:hover::before { opacity: .06; }
.tab-btn.active { color: var(--md-primary); border-bottom-color: var(--md-primary); }

/* ── Permission Grid ── */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.perm-module {
  background: var(--md-surf-mid);
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-r-md);
  padding: 12px;
}
.perm-module-title {
  font-size: .67rem; font-weight: 700; color: var(--md-primary);
  text-transform: uppercase; letter-spacing: .09em; margin-bottom: 8px;
}
.perm-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; font-size: .82rem;
  cursor: pointer; color: var(--md-on-surf-var);
}
.perm-item:hover { color: var(--md-on-surf); }
.perm-item input { accent-color: var(--md-primary); }

/* ── Login Page ── */
.login-page {
  background: var(--md-bg);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
}
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-brand { text-align: center; margin-bottom: 32px; }
.login-icon { font-size: 2.5rem; color: var(--md-primary); }
.login-title {
  font-family: var(--md-font-d); font-size: 1.6rem;
  color: var(--md-primary); margin-top: 8px; font-weight: 600;
}
.login-subtitle { color: var(--md-on-surf-var); font-size: .85rem; margin-top: 4px; }
.login-form {
  background: var(--md-surf-lo);
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-r-xl);
  padding: 32px;
}
.login-form .form-group { margin-bottom: 20px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--md-surf-lo); }
::-webkit-scrollbar-thumb { background: var(--md-surf-hi); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--md-primary); }

/* ══════════════════════════════════════════════════════════════════════════════
   CALENDAR ADMIN — Vista Mes / Semana / Día
   ══════════════════════════════════════════════════════════════════════════════ */

/* ─── Controls Bar ── */
.cal-controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--md-surf-lo);
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-r-lg);
  padding: 10px 16px; margin-bottom: 14px;
}
.view-toggle {
  display: flex;
  border: 1px solid var(--md-outline);
  border-radius: var(--md-r-full); overflow: hidden;
}
.view-btn {
  padding: 0 16px; height: 34px;
  font-size: .8rem; font-weight: 600;
  text-decoration: none;
  color: var(--md-on-surf-var);
  background: transparent;
  transition: all var(--md-transition);
  display: flex; align-items: center;
}
.view-btn:hover:not(.active) { background: var(--md-surf-hi); color: var(--md-on-surf); }
.view-btn.active {
  background: var(--md-primary);
  color: var(--md-on-primary);
  font-weight: 700;
}
.cal-period {
  font-weight: 600; font-size: .9rem;
  color: var(--md-on-surf); min-width: 190px; text-align: center;
}

/* ─── Month View ── */
.cal-month {
  background: var(--md-surf-lo);
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-r-lg); overflow: hidden;
}
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7,1fr);
  background: var(--md-surf-mid);
  border-bottom: 1px solid var(--md-outline-var);
}
.cal-weekday {
  padding: 8px 6px; text-align: center;
  font-size: .65rem; font-weight: 700;
  color: var(--md-on-surf-var); text-transform: uppercase; letter-spacing: .06em;
}
.cal-days { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-day {
  min-height: 96px;
  border-right: 1px solid var(--md-outline-var);
  border-bottom: 1px solid var(--md-outline-var);
  padding: 6px;
}
.cal-day:nth-child(7n) { border-right: none; }
.cal-day:nth-last-child(-n+7) { border-bottom: none; }
.cal-other-month { opacity: .35; }
.cal-today { background: var(--md-primary-dim); }

.cal-day-num { margin-bottom: 4px; }
.cal-day-link {
  font-size: .78rem; font-weight: 600;
  color: var(--md-on-surf-var); text-decoration: none;
  padding: 2px 6px; border-radius: var(--md-r-full);
  display: inline-block;
  transition: all var(--md-transition);
}
.cal-day-link:hover { background: var(--md-surf-hi); color: var(--md-on-surf); }
.cal-today .cal-day-link {
  background: var(--md-primary);
  color: var(--md-on-primary);
  font-weight: 700;
}
.cal-chip {
  display: block; padding: 2px 8px;
  border-radius: var(--md-r-xs);
  font-size: .65rem; font-weight: 500;
  margin-bottom: 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  text-decoration: none; cursor: pointer;
  transition: filter var(--md-transition);
}
.cal-chip:hover { filter: brightness(1.2); }

/* ─── Week / Day Time Grid ── */
.cal-time-grid {
  background: var(--md-surf-lo);
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-r-lg); overflow: hidden;
}
.cal-thead {
  display: grid;
  background: var(--md-surf-mid);
  border-bottom: 1px solid var(--md-outline-var);
}
.cal-thead-time { border-right: 1px solid var(--md-outline-var); width: 52px; }
.cal-col-head {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 8px 4px;
  border-left: 1px solid var(--md-outline-var);
  gap: 2px;
}
.cal-col-dow {
  font-size: .62rem; font-weight: 700;
  color: var(--md-on-surf-var); text-transform: uppercase; letter-spacing: .07em;
}
.cal-col-date { font-size: .9rem; font-weight: 600; color: var(--md-on-surf-var); }
.cal-col-today .cal-col-date,
.cal-today-num {
  background: var(--md-primary); color: var(--md-on-primary) !important;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.cal-body { display: flex; overflow-y: auto; max-height: 620px; }
.cal-time-col { width: 52px; flex-shrink: 0; border-right: 1px solid var(--md-outline-var); }
.cal-time-label {
  height: 64px; padding: 3px 6px 0;
  font-size: .62rem; color: var(--md-on-surf-var);
  border-bottom: 1px solid var(--md-outline-var);
  display: flex; align-items: flex-start;
}
.cal-grid-cols { flex: 1; display: grid; min-width: 0; }
.cal-grid-col { border-left: 1px solid var(--md-outline-var); position: relative; }
.cal-grid-col:first-child { border-left: none; }
.cal-grid-hour { height: 64px; border-bottom: 1px solid rgba(145,151,160,.08); }
.cal-grid-hour:nth-child(even) { background: rgba(255,255,255,.01); }
.cal-block {
  position: absolute; left: 2px; right: 2px;
  border-radius: var(--md-r-sm); padding: 4px 6px;
  overflow: hidden; cursor: pointer; text-decoration: none;
  z-index: 1; display: flex; flex-direction: column; gap: 1px;
  transition: filter var(--md-transition);
}
.cal-block:hover { filter: brightness(1.15); z-index: 10; }
.cal-block-time   { font-size: .62rem; font-weight: 700; opacity: .85; }
.cal-block-barber { font-size: .64rem; font-weight: 700; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block-name   { font-size: .64rem; font-weight: 500; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block-svc    { font-size: .6rem; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Days Off ── */
.days-off-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.day-off-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 16px; height: 36px;
  border-radius: var(--md-r-full);
  border: 1px solid var(--md-outline);
  font-size: .8rem; font-weight: 600;
  color: var(--md-on-surf-var); cursor: pointer;
  transition: all var(--md-transition); user-select: none;
}
.day-off-chip input { display: none; }
.day-off-chip:hover { border-color: var(--md-outline); color: var(--md-on-surf); }
.day-off-chip.selected {
  background: var(--md-orange-b);
  border-color: var(--md-orange-bd);
  color: var(--md-orange);
}
.day-off-list { display: flex; flex-direction: column; gap: 6px; }
.day-off-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--md-surf-mid);
  border: 1px solid var(--md-outline-var);
  border-radius: var(--md-r-md);
  padding: 10px 14px; font-size: .84rem;
}
.day-off-date { font-weight: 600; color: var(--md-on-surf); }
.day-off-reason { color: var(--md-on-surf-var); }

/* ─── Phone Input ── */
.phone-input-row { display: flex; gap: 6px; align-items: stretch; }
.phone-country-select {
  background: transparent;
  border: 1px solid var(--md-outline);
  color: var(--md-on-surf);
  padding: 10px 8px; border-radius: var(--md-r-sm);
  font-family: var(--md-font-b); font-size: .84rem;
  transition: border-color var(--md-transition); outline: none;
  flex-shrink: 0; width: 100px;
}
.phone-country-select:focus { border-color: var(--md-primary); border-width: 2px; }
.phone-number-input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--md-outline);
  color: var(--md-on-surf);
  padding: 10px 14px; border-radius: var(--md-r-sm);
  font-family: var(--md-font-b); font-size: .9rem;
  transition: border-color var(--md-transition); outline: none; min-width: 0;
}
.phone-number-input:focus { border-color: var(--md-primary); border-width: 2px; }
.form-inline .phone-country-select { padding: 7px 6px; font-size: .8rem; width: 96px; }
.form-inline .phone-number-input   { padding: 7px 10px; font-size: .82rem; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .sidebar { width: 220px; min-width: 220px; }
  .main-content { padding: 22px 24px; }
}

@media (max-width: 768px) {
  .topbar { display: flex; }
  .app-layout { flex-direction: column; }
  .sidebar {
    position: fixed; top: 0; left: 0;
    width: 280px; min-width: unset; height: 100vh;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 32px rgba(0,0,0,.5);
  }
  .sidebar.is-open { transform: translateX(0); }
  .main-content { padding: 16px; width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .stats-grid  { grid-template-columns: repeat(3,1fr); }
  .perm-grid   { grid-template-columns: 1fr 1fr; }
  .services-grid { grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); }
  .form-row { grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); }
  .page-title { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .stats-grid  { grid-template-columns: repeat(2,1fr); }
  .perm-grid   { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .form-row    { grid-template-columns: 1fr; }
  .filter-bar  { gap: 6px; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .table { font-size: .8rem; }
  .table th, .table td { padding: 9px 12px; }
}

/* ── Custom Select ── */
.cs-wrap { position: relative; display: inline-block; vertical-align: middle; }
.cs-wrap > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; top: 0; left: 0; }
.cs-trigger {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; cursor: pointer; user-select: none;
  background: var(--md-surf-mid);
  border: 1px solid var(--md-outline);
  color: var(--md-on-surf);
  padding: 0 10px 0 14px;
  height: 36px;
  border-radius: var(--md-r-full);
  font-family: var(--md-font-b); font-size: .82rem;
  transition: border-color var(--md-transition);
  outline: none;
  white-space: nowrap;
  box-sizing: border-box;
}
.cs-trigger:focus,
.cs-wrap.cs-open .cs-trigger { border-color: var(--md-primary); }
.cs-label { flex: 1; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cs-arrow {
  font-size: 18px !important;
  color: var(--md-on-surf-var);
  transition: transform var(--md-transition);
  flex-shrink: 0;
  pointer-events: none;
}
.cs-wrap.cs-open .cs-arrow { transform: rotate(180deg); }
.cs-dropdown {
  position: fixed;
  display: none;
  max-height: 240px; overflow-y: auto;
  background: var(--md-surf-mid);
  border: 1px solid var(--md-outline);
  border-radius: var(--md-r-md);
  box-shadow: var(--shadow-3);
  z-index: 9999;
}
.cs-wrap.cs-open .cs-dropdown { display: block; }
.cs-option {
  padding: 9px 16px;
  color: var(--md-on-surf);
  font-family: var(--md-font-b); font-size: .82rem;
  cursor: pointer;
  transition: background var(--md-transition-fast);
  white-space: nowrap;
}
.cs-option:hover { background: var(--md-surf-hi); }
.cs-option.cs-selected { color: var(--md-primary); font-weight: 600; }
/* form-group context: full width, taller trigger */
.form-group .cs-wrap { display: block; width: 100%; }
.form-group .cs-trigger {
  width: 100%; height: 44px;
  border-radius: var(--md-r-sm);
  padding: 0 14px;
  font-size: .9rem;
  background: transparent;
  border: 1px solid var(--md-outline);
}

