/* =========================================================================
   SAC · Estilos del sistema (sobre Bootstrap 5.3)
   --brand se define por empresa (color corporativo) en el <head>.
   ========================================================================= */
:root {
  --brand: #4f46e5;
  --brand-rgb: 79, 70, 229;
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
  --radius: 14px;
  --surface: #ffffff;
  --surface-2: #f5f6fa;
  --border-soft: #e7e9f0;
  --text-soft: #6b7280;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 8px 24px rgba(16, 24, 40, .08);
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: var(--brand-rgb);
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-bg: var(--surface-2);
}
[data-bs-theme="dark"] {
  --surface: #161b26;
  --surface-2: #0e121a;
  --border-soft: #262d3b;
  --text-soft: #9aa3b2;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 8px 24px rgba(0, 0, 0, .45);
  --bs-body-bg: var(--surface-2);
  --bs-body-color: #e4e7ee;
  --bs-border-color: var(--border-soft);
  --bs-secondary-bg: #1d2331;
  --bs-tertiary-bg: #1a2030;
}
body { background: var(--surface-2); font-size: .94rem; -webkit-font-smoothing: antialiased; }

/* ---------- Botones y colores de marca ---------- */
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: rgba(var(--brand-rgb), .88); --bs-btn-hover-border-color: rgba(var(--brand-rgb), .88);
  --bs-btn-active-bg: rgba(var(--brand-rgb), .8); --bs-btn-active-border-color: rgba(var(--brand-rgb), .8);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
}
.btn-soft { background: rgba(var(--brand-rgb), .1); color: var(--brand); border: 0; }
.btn-soft:hover { background: rgba(var(--brand-rgb), .18); color: var(--brand); }
.btn { border-radius: 10px; }
.btn-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 0; color: inherit; background: transparent; }
.btn-icon:hover { background: rgba(var(--brand-rgb), .08); }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.bg-brand-soft { background: rgba(var(--brand-rgb), .1) !important; color: var(--brand); }
.form-control, .form-select { border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: rgba(var(--brand-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--brand-rgb), .15); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .3rem; }
.nav-pills .nav-link.active { background: var(--brand); }
.nav-pills .nav-link { color: inherit; border-radius: 10px; }
.page-link { color: var(--brand); }
.active > .page-link, .page-link.active { background: var(--brand); border-color: var(--brand); }

/* ---------- Layout del panel ---------- */
.layout { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
  background: var(--surface); border-right: 1px solid var(--border-soft);
  display: flex; flex-direction: column; transition: width .22s ease, transform .22s ease;
}
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--border-soft); }
.brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.brand-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex: 0 0 40px; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; flex: 0 0 40px; background: #fff; }
.brand-text { font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { display: block; font-weight: 400; font-size: .72rem; color: var(--text-soft); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px; scrollbar-width: thin; }
.nav-group { margin-bottom: 4px; }
.nav-group-toggle {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; background: transparent;
  color: var(--text-soft); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-radius: 10px; white-space: nowrap;
}
.nav-group-toggle:hover { background: rgba(var(--brand-rgb), .06); color: inherit; }
.nav-group-toggle > i:first-child { font-size: 1.05rem; }
.nav-group-toggle .chev { margin-left: auto; transition: transform .2s; font-size: .75rem; }
.nav-group.open .nav-group-toggle { color: var(--brand); }
.nav-group.open .nav-group-toggle .chev { transform: rotate(180deg); }
.nav-group-items { overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.nav-group.open .nav-group-items { max-height: 800px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 22px; margin: 2px 0; border-radius: 10px;
  color: inherit; text-decoration: none; white-space: nowrap; font-weight: 500;
}
.nav-item i { font-size: 1.05rem; opacity: .8; }
.nav-item:hover { background: rgba(var(--brand-rgb), .07); }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(var(--brand-rgb), .3); }
.nav-item.active i { opacity: 1; }
.sidebar-foot { padding: 10px 14px; border-top: 1px solid var(--border-soft); display: flex; align-items: center; gap: 8px; }

.main { margin-left: var(--sidebar-w); transition: margin-left .22s ease; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 1030; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--surface); background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-soft);
}
.topbar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar-title h1 { font-size: 1.15rem; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.user-chip { display: flex; align-items: center; gap: 8px; border: 0; padding: 4px 8px; }
.content { padding: 22px; max-width: 1600px; margin: 0 auto; outline: none; }
.page-loader { display: flex; justify-content: center; padding: 80px 0; }

/* Colapsado (escritorio): el contenido crece */
@media (min-width: 992px) {
  .layout.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
  .layout.collapsed .main { margin-left: var(--sidebar-w-collapsed); }
  .layout.collapsed .sidebar .brand-text,
  .layout.collapsed .sidebar .nav-group-toggle span,
  .layout.collapsed .sidebar .nav-group-toggle .chev,
  .layout.collapsed .sidebar .nav-item span,
  .layout.collapsed .sidebar .sidebar-foot-text { display: none; }
  .layout.collapsed .sidebar .nav-item { padding-left: 12px; justify-content: center; }
  .layout.collapsed .sidebar .nav-group-toggle { justify-content: center; }
  /* Al pasar el mouse se despliega temporalmente sobre el contenido */
  .layout.collapsed .sidebar:hover { width: var(--sidebar-w); box-shadow: var(--shadow); }
  .layout.collapsed .sidebar:hover .brand-text,
  .layout.collapsed .sidebar:hover .nav-group-toggle span,
  .layout.collapsed .sidebar:hover .nav-group-toggle .chev,
  .layout.collapsed .sidebar:hover .nav-item span,
  .layout.collapsed .sidebar:hover .sidebar-foot-text { display: inline; }
  .layout.collapsed .sidebar:hover .nav-group-toggle .chev { display: inline-block; }
  .layout.collapsed .sidebar:hover .nav-item { padding-left: 22px; justify-content: flex-start; }
  .layout.collapsed .sidebar:hover .nav-group-toggle { justify-content: flex-start; }
  .sidebar-backdrop { display: none !important; }
}
/* Móvil y tablet: menú deslizable */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow); width: min(300px, 86vw); }
  .layout.mobile-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 1035; display: none; }
  .layout.mobile-open .sidebar-backdrop { display: block; }
  .content { padding: 14px; }
}

/* ---------- Tarjetas y componentes ---------- */
.card { border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-header { background: transparent; border-bottom: 1px solid var(--border-soft); padding: 14px 18px; font-weight: 600; }
.card-body { padding: 18px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.section-head p { margin: 2px 0 0; color: var(--text-soft); font-size: .85rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-box { position: relative; min-width: 220px; flex: 1; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-soft); }
.search-box input { padding-left: 36px; }

.kpi { display: flex; gap: 14px; align-items: center; padding: 18px; height: 100%; }
.kpi-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex: 0 0 48px; }
.kpi-value { font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.kpi-label { color: var(--text-soft); font-size: .8rem; }
.tone-brand { background: rgba(var(--brand-rgb), .12); color: var(--brand); }
.tone-green { background: rgba(16, 185, 129, .13); color: #0e9f6e; }
.tone-amber { background: rgba(245, 158, 11, .15); color: #c27803; }
.tone-red { background: rgba(239, 68, 68, .13); color: #dc2626; }
.tone-sky { background: rgba(14, 165, 233, .13); color: #0284c7; }
.tone-violet { background: rgba(139, 92, 246, .14); color: #7c3aed; }

/* Listados responsivos (en lugar de tablas) */
.data-list { display: flex; flex-direction: column; gap: 10px; }
.data-row {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px 16px;
  transition: box-shadow .15s, border-color .15s;
}
.data-row:hover { border-color: rgba(var(--brand-rgb), .35); box-shadow: var(--shadow-sm); }
.data-row .cell-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); }
.data-row .row-title { font-weight: 600; }
.data-row .row-sub { color: var(--text-soft); font-size: .82rem; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
@media (min-width: 768px) { .data-row .cell-label.md-hide { display: none; } }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.item-card { overflow: hidden; display: flex; flex-direction: column; }
.item-card .item-img { aspect-ratio: 16/10; background: linear-gradient(135deg, rgba(var(--brand-rgb), .25), rgba(var(--brand-rgb), .05)); display: flex; align-items: center; justify-content: center; color: var(--brand); font-size: 2.4rem; overflow: hidden; }
.item-card .item-img img { width: 100%; height: 100%; object-fit: cover; }
.item-card .card-body { flex: 1; }

.avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(var(--brand-rgb), .14); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: .75rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar-xl { width: 110px; height: 110px; font-size: 2rem; }

.badge-estado { font-weight: 600; padding: .4em .7em; border-radius: 999px; font-size: .72rem; }
.st-pendiente { background: rgba(245, 158, 11, .15); color: #b45309; }
.st-confirmada { background: rgba(14, 165, 233, .15); color: #0369a1; }
.st-atendida { background: rgba(16, 185, 129, .15); color: #047857; }
.st-cancelada { background: rgba(239, 68, 68, .14); color: #b91c1c; }
.st-no_asistio { background: rgba(107, 114, 128, .18); color: #4b5563; }
.st-abierto { background: rgba(245, 158, 11, .15); color: #b45309; }
.st-en_proceso { background: rgba(14, 165, 233, .15); color: #0369a1; }
.st-resuelto, .st-enviado, .st-respondida { background: rgba(16, 185, 129, .15); color: #047857; }
.st-cerrado, .st-cancelado, .st-borrador { background: rgba(107, 114, 128, .18); color: #4b5563; }
.st-error { background: rgba(239, 68, 68, .14); color: #b91c1c; }
.st-manual { background: rgba(139, 92, 246, .15); color: #6d28d9; }
[data-bs-theme="dark"] .badge-estado { filter: brightness(1.5); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-soft); }
.empty-state i { font-size: 2.6rem; display: block; margin-bottom: 10px; opacity: .6; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gallery-item { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); border: 1px solid var(--border-soft); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery-item .doc { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 8px; text-align: center; font-size: .72rem; text-decoration: none; color: inherit; word-break: break-all; }
.gallery-item .doc i { font-size: 2rem; color: var(--brand); }
.gallery-item .gallery-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem; }

.photo-picker { display: flex; align-items: center; gap: 14px; }
.photo-picker .avatar { cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: rgba(var(--brand-rgb), .1); color: var(--brand); font-size: .75rem; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 10px; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--border-soft); }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-item::before { content: ""; position: absolute; left: -22px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .2); }

/* Barras simples (indicadores) */
.bar-track { height: 8px; border-radius: 99px; background: rgba(var(--brand-rgb), .1); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--brand); }
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.mini-bars .mb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.mini-bars .mb-bar { width: 100%; max-width: 34px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.mini-bars .mb-label { font-size: .68rem; color: var(--text-soft); }
.mini-bars .mb-val { font-size: .7rem; font-weight: 600; }

/* Chat (WhatsApp, solicitudes, IA) */
.chat-box { display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto; background: var(--surface-2); border-radius: 12px; min-height: 320px; max-height: 60vh; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; font-size: .9rem; }
.msg.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--border-soft); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: rgba(139, 92, 246, .1); border: 1px solid rgba(139, 92, 246, .25); border-bottom-left-radius: 4px; }
.msg .meta { display: block; font-size: .68rem; opacity: .7; margin-top: 4px; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin: 0 2px; animation: blink 1.2s infinite; opacity: .4; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: 1; } }

/* Notificaciones */
.notif-dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #ef4444; color: #fff; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.notif-menu { width: 340px; max-width: 92vw; padding: 0; border-radius: 14px; overflow: hidden; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); text-decoration: none; color: inherit; font-size: .85rem; }
.notif-item:hover { background: rgba(var(--brand-rgb), .05); }
.notif-item.unread { background: rgba(var(--brand-rgb), .06); }

/* Select2 con Bootstrap 5 + modo oscuro */
.select2-container--bootstrap-5 .select2-selection { border-radius: 10px; min-height: 38px; }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown { background-color: var(--bs-body-bg); color: var(--bs-body-color); border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered { color: var(--bs-body-color); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field { background: var(--surface); color: var(--bs-body-color); border-color: var(--border-soft); }
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--highlighted { background: var(--brand); color: #fff; }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--selected { background: var(--brand); color: #fff; }

/* SweetAlert en modo oscuro */
[data-bs-theme="dark"] .swal2-popup { background: var(--surface); color: var(--bs-body-color); }
[data-bs-theme="dark"] .swal2-title, [data-bs-theme="dark"] .swal2-html-container { color: var(--bs-body-color); }
[data-bs-theme="dark"] .swal2-input, [data-bs-theme="dark"] .swal2-textarea, [data-bs-theme="dark"] .swal2-select { background: var(--surface-2); color: var(--bs-body-color); }
.swal2-popup { border-radius: 16px !important; font-family: var(--bs-body-font-family); }

.modal-content { border-radius: 16px; border: 0; }
[data-bs-theme="dark"] .modal-content { background: var(--surface); }
.modal-header { border-bottom-color: var(--border-soft); }
.modal-footer { border-top-color: var(--border-soft); }
.offcanvas { background: var(--surface); }

/* Calendario */
.fc { --fc-border-color: var(--border-soft); --fc-today-bg-color: rgba(var(--brand-rgb), .07); --fc-button-bg-color: var(--brand); --fc-button-border-color: var(--brand); --fc-button-hover-bg-color: rgba(var(--brand-rgb), .85); --fc-button-active-bg-color: rgba(var(--brand-rgb), .75); --fc-page-bg-color: var(--surface); }
.fc .fc-toolbar-title { font-size: 1.1rem; font-weight: 700; text-transform: capitalize; }
.fc .fc-button { border-radius: 8px; font-size: .82rem; text-transform: capitalize; }
.fc-event { border-radius: 6px; padding: 1px 3px; font-size: .78rem; cursor: pointer; }
@media (max-width: 767.98px) { .fc .fc-toolbar { flex-direction: column; gap: 8px; } }

/* Horarios / slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.slot { border: 1px solid var(--border-soft); background: var(--surface); border-radius: 10px; padding: 8px 4px; text-align: center; font-weight: 600; cursor: pointer; }
.slot:hover { border-color: var(--brand); color: var(--brand); }
.slot.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* =========================================================================
   Pantallas de acceso (login, registro, recuperación) a pantalla completa
   ========================================================================= */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, .18), transparent 40%),
              radial-gradient(circle at 85% 85%, rgba(255, 255, 255, .12), transparent 45%),
              linear-gradient(135deg, var(--brand), #312e81 70%, #1e1b4b);
}
.auth-hero::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(255, 255, 255, .06); right: -160px; top: -160px; }
.auth-logo { display: inline-flex; align-items: center; background: #fff; border-radius: 14px; padding: 8px 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); }
.auth-logo { max-width: 100%; }
.auth-logo img { height: 44px; width: auto; max-width: min(240px, 60vw); object-fit: contain; display: block; }
@media (max-width: 576px) { .auth-logo { padding: 6px 10px !important; } .auth-logo img { height: 34px !important; } }
.auth-hero h1 { font-size: clamp(1.8rem, 3vw, 2.7rem); font-weight: 800; line-height: 1.15; }
.auth-hero p { opacity: .85; font-size: 1.05rem; max-width: 520px; }
.auth-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 560px; position: relative; z-index: 1; }
.auth-feat { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15); border-radius: 14px; padding: 14px; backdrop-filter: blur(4px); }
.auth-feat i { font-size: 1.3rem; }
.auth-feat b { display: block; margin-top: 4px; }
.auth-feat small { opacity: .8; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; overflow-y: auto; }
.auth-form { width: 100%; max-width: 430px; }
.auth-form h2 { font-weight: 800; font-size: 1.7rem; }
.auth-form .form-control, .auth-form .form-select { padding: .7rem .9rem; }
.auth-form .input-group-text { border-radius: 10px; background: var(--surface-2); }
.auth-form .input-group > .form-control { border-radius: 0 10px 10px 0; }
.auth-form .input-group > .form-control:not(:last-child) { border-radius: 0; }
.auth-form .input-group > .btn:last-child { border-radius: 0 10px 10px 0; }
.btn-social { display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--border-soft); background: var(--surface); padding: .65rem; font-weight: 600; }
.btn-social:hover { background: var(--surface-2); }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-soft); font-size: .8rem; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }
.empresa-preview { display: none; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(var(--brand-rgb), .08); margin-bottom: 12px; }
.empresa-preview img { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; background: #fff; }
.auth-theme { position: fixed; top: 14px; right: 14px; z-index: 5; }
@media (max-width: 991.98px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 22px; min-height: auto; }
  .auth-hero .auth-feats, .auth-hero .hero-foot { display: none; }
  .auth-hero p { font-size: .95rem; margin-bottom: 0; }
  .auth-form-side { padding: 28px 18px 40px; align-items: flex-start; }
}

/* Página pública (encuesta) */
.public-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, rgba(var(--brand-rgb), .12), var(--surface-2)); }
.rating-stars { display: flex; gap: 8px; justify-content: center; font-size: 2.3rem; }
.rating-stars i { cursor: pointer; color: #d1d5db; transition: transform .1s; }
.rating-stars i.on { color: #f59e0b; }
.rating-stars i:hover { transform: scale(1.15); }
.nps-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.nps-scale button { border: 1px solid var(--border-soft); background: var(--surface); border-radius: 8px; padding: 8px 0; font-weight: 600; }
.nps-scale button.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Utilidades */
.cursor-pointer { cursor: pointer; }
.text-soft { color: var(--text-soft) !important; }
.min-w-0 { min-width: 0; }
.fw-600 { font-weight: 600; }
.ls-tight { letter-spacing: -.01em; }
.hover-lift { transition: transform .15s, box-shadow .15s; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.preview-img { max-width: 100%; max-height: 80vh; border-radius: 12px; }
.markdown p:last-child { margin-bottom: 0; }

/* ---------- Editor de horario semanal ---------- */
.horario-dia{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem 1rem;padding:.65rem .25rem;border-bottom:1px solid var(--border-soft)}
.horario-dia:last-child{border-bottom:0}
.horario-dia .form-check{min-width:130px}
.horario-turnos{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;flex:1}
.horario-turnos .turno{display:flex;align-items:center;gap:.4rem}
.horario-turnos .turno input{width:132px}
.horario-dia .cerrado{display:none}
.horario-dia.off .horario-turnos{display:none}
.horario-dia.off .cerrado{display:inline}
/* ---------- Checklist de permisos ---------- */
.perm-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:.5rem}
.perm-item{display:flex;align-items:center;gap:.6rem;padding:.55rem .75rem;border:1px solid var(--border-soft);border-radius:.6rem;background:var(--surface-2);cursor:pointer}
.perm-item i.bi{color:var(--brand)}
.tabs-scroll{overflow-x:auto;flex-wrap:nowrap;white-space:nowrap}
/* ---------- Portal: reserva por pasos ---------- */
.stepper{display:flex;gap:.5rem;flex-wrap:wrap}
.stepper .step{display:flex;align-items:center;gap:.4rem;padding:.4rem .8rem;border-radius:99px;background:var(--surface);border:1px solid var(--border-soft);color:var(--text-soft);font-size:.85rem}
.stepper .step b{display:inline-grid;place-items:center;width:1.4rem;height:1.4rem;border-radius:50%;background:var(--surface-2);font-size:.75rem}
.stepper .step.active{border-color:var(--brand);color:var(--brand);font-weight:600}
.stepper .step.active b,.stepper .step.done b{background:var(--brand);color:#fff}
.dias-scroll{display:flex;gap:.5rem;overflow-x:auto;padding-bottom:.25rem}
.dia-btn{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;min-width:64px;padding:.5rem .4rem;border-radius:12px;border:1px solid var(--border-soft);background:var(--surface);color:inherit;line-height:1.2}
.dia-btn b{font-size:1.2rem}
.dia-btn small{font-size:.7rem;color:var(--text-soft);text-transform:capitalize}
.dia-btn.active{background:var(--brand);border-color:var(--brand);color:#fff}
.dia-btn.active small{color:rgba(255,255,255,.85)}
.dia-btn.off{opacity:.4;cursor:not-allowed}
/* Filas con columna flexible: avatar/ícono + texto + acciones en una sola línea */
.data-row:has(> .flex-fill) { display: flex; align-items: center; gap: 12px; }
.data-row > .flex-fill { min-width: 0; }
