/* =====================================================================
   ESTILOS DE TODO EL SISTEMA
   >>> CONFIGURABLE: los colores principales están en :root (aquí abajo).
   ===================================================================== */
:root {
  --fondo: #f1f2f5;        /* fondo general */
  --superficie: #ffffff;   /* tarjetas y paneles */
  --tinta: #1c2133;        /* texto principal */
  --suave: #667086;        /* texto secundario */
  --borde: #dfe2ea;
  --acento: #46327d;       /* color de botones principales */
  --acento-hover: #35245f;
  --acento-suave: #eeeafa;
  --peligro: #b3261e;
  --radio: 10px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--tinta);
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Estructura (computadora) ---------- */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); height: 100%; }
.side {
  background: var(--superficie);
  border-right: 1px solid var(--borde);
  padding: 28px 22px 22px;
  display: flex; flex-direction: column; gap: 24px;
  overflow-y: auto;
}
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.side h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.marca {
  margin: -18px 0 0;
  color: var(--suave);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.side h2 { font-size: 13px; color: var(--suave); font-weight: 600; margin: 0 0 10px; }
.enlace-admin { font-size: 13px; color: var(--acento); text-decoration: none; padding: 7px 0; font-weight: 700; }
.enlace-admin:hover { text-decoration: underline; }
.btn-nuevo { margin-top: auto; }
.main { min-width: 0; padding: 18px; overflow: auto; }
#calendario {
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 16px;
  height: calc(100vh - 40px);
  box-shadow: 0 4px 18px rgba(28, 33, 51, .05);
}

.resumen-panel {
  height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 6px 2px 20px;
}
.resumen-cabecera {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-bottom: 18px; padding: 4px 2px 14px; border-bottom: 1px solid var(--borde);
}
.resumen-cabecera-controles { display: flex; align-items: center; gap: 8px; }
.resumen-abrir-agenda { min-height: 38px !important; padding: 7px 12px !important; border-color: var(--acento) !important; color: var(--acento) !important; font-size: 12px !important; font-weight: 800 !important; }
.resumen-cabecera h2 { margin: 2px 0 4px; font-size: 26px; letter-spacing: -.02em; }
.resumen-cabecera p { margin: 0; color: var(--suave); font-size: 13px; }
.resumen-etiqueta { color: var(--acento) !important; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 11px !important; }
.resumen-periodos { display: flex; gap: 6px; padding: 5px; border: 1px solid var(--borde); border-radius: 10px; background: var(--superficie); }
.resumen-periodo { border: 0; background: transparent; color: var(--suave); border-radius: 7px; padding: 8px 11px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.resumen-periodo:hover { background: var(--fondo); }
.resumen-periodo.activo { background: var(--acento); color: #fff; box-shadow: 0 4px 12px rgba(44, 90, 168, .18); }
.resumen-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.resumen-kpis article { min-height: 92px; display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; }
.kpi-icono { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--acento-suave); color: var(--acento); font-weight: 900; }
.resumen-kpis strong { display: block; font-size: 25px; line-height: 1; }
.resumen-kpis p { margin: 7px 0 0; color: var(--suave); font-size: 12px; }
.resumen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.panel-resumen { min-width: 0; background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; overflow: hidden; }
.panel-resumen-titulo { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--borde); }
.panel-resumen-titulo h3 { margin: 0; font-size: 15px; }
.panel-resumen-titulo span { color: var(--suave); font-size: 11px; }
.ranking-lista { padding: 8px 16px 12px; }
.ranking-fila { display: grid; grid-template-columns: minmax(0, 1fr) 90px; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid #eef0f4; }
.ranking-fila:last-child { border-bottom: 0; }
.ranking-cabecera { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.ranking-cabecera > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-cabecera b { display: inline-grid; place-items: center; width: 21px; height: 21px; margin-right: 7px; border-radius: 50%; background: var(--fondo); color: var(--suave); font-size: 10px; }
.ranking-cabecera strong { font-size: 12px; }
.ranking-color { width: 9px; height: 9px; display: inline-block; border-radius: 50%; margin-right: 7px; }
.barra-dato { height: 7px; overflow: hidden; border-radius: 999px; background: var(--fondo); }
.barra-dato span { height: 100%; display: block; border-radius: 999px; background: var(--acento); }
.ranking-fila small { color: var(--suave); text-align: right; font-size: 10px; }
.estados-lista { padding: 10px 16px 14px; }
.estado-fila { min-height: 43px; display: grid; grid-template-columns: 108px minmax(0, 1fr) 28px; align-items: center; gap: 10px; font-size: 12px; }
.estado-nombre { display: flex; align-items: center; gap: 7px; color: var(--suave); }
.estado-punto { width: 9px; height: 9px; border-radius: 50%; background: var(--suave); }
.estado-pendiente { background: #e3a21a; }.estado-confirmada { background: var(--acento); }.estado-completada { background: #3a9b6b; }.estado-cancelada { background: #d85b58; }.estado-no_asistio { background: #7e8493; }
.estado-barra { height: 8px; background: var(--fondo); border-radius: 999px; overflow: hidden; }
.estado-barra i { height: 100%; min-width: 0; display: block; border-radius: 999px; background: var(--acento); }
.estado-fila strong { text-align: right; }
.proximas-lista { padding: 4px 16px; }
.cita-resumen { width: 100%; min-height: 58px; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid #eef0f4; background: transparent; color: var(--tinta); text-align: left; font: inherit; cursor: pointer; }
.cita-resumen:last-child { border-bottom: 0; }
.cita-resumen:hover { background: var(--fondo); }
.cita-fecha, .cita-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cita-fecha b, .cita-info b { font-size: 12px; }
.cita-fecha small, .cita-info small { color: var(--suave); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resumen-vacio { margin: 0; padding: 24px 16px; text-align: center; color: var(--suave); font-size: 13px; }

.filtros { display: flex; flex-direction: column; gap: 5px; }
.filtros label {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  min-height: 38px; padding: 7px 8px; margin: 0 -8px; border-radius: 8px;
}
.filtros label:hover { background: var(--fondo); }
.filtros input { accent-color: var(--acento); width: 16px; height: 16px; }
.swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }

.leyenda { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; color: var(--suave); }
.dot { display: inline-block; width: 18px; height: 10px; border-radius: 3px; margin-right: 10px; border: 2px solid var(--suave); }
.dot-pendiente { border-style: dashed; }
.dot-confirmada { background: var(--suave); }
.dot-completada { background: var(--suave); opacity: .45; }
.dot-cancelada { border-style: dotted; opacity: .4; }

/* ---------- Botones y campos ---------- */
.btn {
  font: inherit; padding: 9px 16px; border-radius: var(--radio);
  border: 1px solid var(--borde); background: var(--superficie); color: var(--tinta); cursor: pointer;
  text-decoration: none; display: inline-block; text-align: center;
  min-height: 40px;
}
.btn:hover { background: var(--fondo); border-color: #c6cad4; }
.btn.primario { background: var(--acento); color: #fff; border-color: var(--acento); }
.btn.primario:hover { background: var(--acento-hover); }
.btn.peligro { color: var(--peligro); border-color: var(--peligro); background: transparent; }
.btn.peligro:hover { background: #fff4f3; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tab:focus-visible {
  outline: 2px solid var(--acento); outline-offset: 2px;
}

dialog {
  border: 1px solid var(--borde); border-radius: 16px; padding: 0; width: min(580px, 94vw);
  max-height: 94vh; overflow-y: auto;
  box-shadow: 0 24px 70px rgba(28, 33, 51, .28);
  color: var(--tinta);
}
dialog::backdrop { background: rgba(28, 33, 51, .45); }
#detalleDia {
  width: min(440px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 24px));
  border: 0;
  border-radius: 18px;
  overflow: hidden;
}
.detalle-dia-cabecera {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 18px 14px; border-bottom: 1px solid var(--borde);
}
.detalle-dia-cabecera p { margin: 0 0 4px; color: var(--acento); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.detalle-dia-cabecera h3 { margin: 0; font-size: 18px; text-transform: capitalize; }
.detalle-dia-cerrar { width: 36px; height: 36px; border: 1px solid var(--borde); border-radius: 50%; background: var(--superficie); color: var(--suave); font-size: 24px; line-height: 1; cursor: pointer; }
.detalle-dia-contenido { max-height: 56vh; overflow-y: auto; padding: 8px; }
.detalle-dia-cita {
  width: 100%; min-height: 76px; display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  border: 0; border-bottom: 1px solid #eef0f4; background: transparent; color: var(--tinta); text-align: left; font: inherit;
  padding: 10px 8px;
}
button.detalle-dia-cita { cursor: pointer; }
button.detalle-dia-cita:hover { background: #f7f7fb; }
.detalle-dia-cita:last-child { border-bottom: 0; }
.detalle-dia-hora { font-size: 13px; font-weight: 800; color: var(--acento); }
.detalle-dia-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.detalle-dia-info b { font-size: 14px; }
.detalle-dia-info small { font-size: 12px; color: var(--suave); }
.detalle-dia-info em { font-size: 11px; color: var(--suave); font-style: normal; white-space: normal; }
.detalle-dia-vacio { padding: 38px 16px; text-align: center; color: var(--suave); font-size: 13px; }
.detalle-dia-acciones { display: flex; justify-content: flex-end; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--borde); }
form { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
form h3 { margin: 0; font-size: 20px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--suave); font-weight: 700; flex: 1; min-width: 0; }
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--tinta); width: 100%; min-width: 0;
  padding: 10px 12px; border: 1px solid var(--borde); border-radius: var(--radio); background: #fff;
}
input:hover, select:hover, textarea:hover { border-color: #bdc3d1; }
input:focus, select:focus, textarea:focus { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); outline: none; }
textarea { resize: vertical; }
.fila { display: flex; gap: 14px; }
#modalTitulo:focus { outline: none; }
.aviso-lectura { margin: 0; padding: 10px 12px; border-radius: var(--radio); background: var(--acento-suave); color: var(--acento); font-size: 13px; font-weight: 600; }

/* ---------- Acceso: ventana de ingreso y cambio de contraseña ---------- */
body.sin-sesion .layout, body.sin-sesion .firma { visibility: hidden; }
dialog.acceso {
  width: min(400px, calc(100vw - 32px)); border: 0; border-radius: 24px; padding: 0;
  background: var(--superficie); overflow: visible;
  box-shadow: 0 32px 90px rgba(17, 10, 40, .5), 0 0 0 1px rgba(255, 255, 255, .06);
}
dialog.acceso[open] { animation: acceso-entra .45s cubic-bezier(.2, .8, .2, 1); }
#login::backdrop {
  background:
    radial-gradient(circle at 18% 12%, rgba(141, 112, 214, .55), transparent 42%),
    radial-gradient(circle at 88% 90%, rgba(176, 48, 90, .35), transparent 40%),
    linear-gradient(140deg, #1d1538 0%, #34256a 52%, #170f2c 100%);
}
#dlgClave::backdrop { background: rgba(23, 15, 44, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.acceso-tarjeta { padding: 36px 32px 28px; gap: 15px; }
.acceso-marca { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.acceso-logo {
  width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(140deg, #5a41a3, #8d70d6); color: #fff;
  font: 500 23px/1 Georgia, "Times New Roman", serif; letter-spacing: .04em;
  box-shadow: 0 12px 28px rgba(70, 50, 125, .38), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.acceso-marca p { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--suave); }
.acceso h2 { margin: 8px 0 0; text-align: center; font-size: 25px; letter-spacing: -.02em; }
.acceso-sub { margin: -8px 0 6px; text-align: center; color: var(--suave); font-size: 14px; line-height: 1.4; }
.acceso input { border-radius: 12px; padding: 12px 14px; background: #fbfbfd; }
.campo-clave { position: relative; display: block; }
.campo-clave input { padding-right: 46px; }
.ver-clave {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: var(--suave);
  cursor: pointer; display: grid; place-items: center;
}
.ver-clave:hover { background: var(--fondo); color: var(--tinta); }
.ver-clave svg { width: 19px; height: 19px; }
.acceso-error:empty { display: none; }
.acceso-error { padding: 9px 12px; border-radius: 10px; background: #fdf0ef; font-size: 13px; font-weight: 600; }
.acceso-error.ok { color: #14633a; background: #e5f6ec; }
.acceso-boton {
  width: 100%; padding: 13px; margin-top: 2px; border-radius: 12px; font-size: 15px; font-weight: 700;
  background: linear-gradient(140deg, #46327d, #6a4fb8); border: 0; box-shadow: 0 8px 20px rgba(70, 50, 125, .3);
}
.acceso-boton:hover { background: linear-gradient(140deg, #35245f, #5a41a3); }
.acceso button[disabled] { opacity: .7; cursor: progress; }
.acceso-pie { margin: 0; text-align: center; color: var(--suave); font-size: 12px; }
.acceso-acciones { display: flex; gap: 8px; margin-top: 2px; }
.acceso-acciones .btn { flex: 1; padding: 12px; border-radius: 12px; font-weight: 700; }
.acceso-tarjeta.sacudir { animation: sacudir .42s; }
@keyframes acceso-entra { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes sacudir {
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}
@media (prefers-reduced-motion: reduce) {
  dialog.acceso[open], .acceso-tarjeta.sacudir { animation: none; }
}

/* ---------- Usuario conectado (botón con inicial y menú) ---------- */
.side-top { position: relative; }
.side-top-derecha { display: flex; align-items: center; gap: 10px; }
.usuario-boton {
  width: 34px; height: 34px; flex: none; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(140deg, #5a41a3, #8d70d6); color: #fff; font-weight: 800; font-size: 14px;
  display: grid; place-items: center; box-shadow: 0 3px 10px rgba(70, 50, 125, .3);
}
.usuario-boton:hover { filter: brightness(1.08); }
.menu-usuario {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 230px;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 14px; padding: 6px;
  box-shadow: 0 18px 44px rgba(28, 33, 51, .18);
}
.menu-usuario-cabecera { padding: 10px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--borde); }
.menu-usuario-cabecera b { display: block; font-size: 15px; }
.menu-usuario-cabecera small { color: var(--suave); font-size: 12px; }
.menu-usuario button {
  display: block; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 10px 12px; border-radius: 9px; font: inherit; font-size: 14px; color: var(--tinta);
}
.menu-usuario button:hover { background: var(--fondo); }
.menu-usuario .salir { color: var(--peligro); }

/* Buscador de clientes del formulario de turno */
.buscador-cliente { display: flex; flex-direction: column; gap: 6px; }
.sugerencias { list-style: none; margin: 0; padding: 4px; max-height: 240px; overflow-y: auto; border: 1px solid var(--borde); border-radius: var(--radio); background: var(--superficie); }
.sugerencias li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--tinta); }
.sugerencias li b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugerencias li small { color: var(--suave); font-size: 12px; white-space: nowrap; }
.sugerencias li:hover, .sugerencias li.marcada { background: var(--acento-suave); }
.sugerencias .sugerencia-nueva { justify-content: flex-start; gap: 4px; color: var(--acento); font-weight: 700; }
.sugerencias .sugerencia-vacia { cursor: default; color: var(--suave); font-size: 13px; }
.sugerencias .sugerencia-vacia:hover { background: none; }
.acciones { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.espacio { flex: 1; }
.oculto { display: none !important; }
.resumen { margin: -8px 0 0; color: var(--suave); font-size: 13px; min-height: 18px; }
.error { margin: 0; color: var(--peligro); font-size: 14px; min-height: 18px; }
.firma {
  position: fixed;
  z-index: 40;
  left: 12px;
  bottom: 6px;
  color: var(--suave);
  font-size: 10px;
  line-height: 1.3;
  pointer-events: none;
}
.firma strong { color: var(--tinta); font-weight: 800; }

/* ---------- Turnos en el calendario ---------- */
.fc .est-pendiente { border-style: dashed !important; border-width: 2px !important; }
.fc .est-completada { opacity: .55; }
.fc .est-cancelada, .fc .est-no_asistio { opacity: .4; text-decoration: line-through; }
.fc .fc-event-title, .fc .fc-event-time { font-weight: 500; }
.fc .fc-button {
  width: auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  line-height: 1.2;
  white-space: nowrap;
  text-transform: none;
  border-radius: 8px !important;
}
.fc .fc-toolbar { margin-bottom: 14px !important; }
.fc .fc-toolbar-title { font-size: 20px; color: var(--tinta); }
.fc .fc-button-primary { background: var(--acento) !important; border-color: var(--acento) !important; }
.fc .fc-button-primary:hover, .fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--acento-hover) !important; border-color: var(--acento-hover) !important; }
.fc .fc-prev-button, .fc .fc-next-button, .fc .fc-today-button {
  min-height: 40px;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(28, 33, 51, .08);
}
.fc .fc-prev-button, .fc .fc-next-button {
  width: 40px;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.fc .fc-today-button {
  padding-left: 13px !important;
  padding-right: 13px !important;
}
.fc .fc-header-toolbar .fc-button-group {
  display: flex;
  gap: 6px;
}
.fc .fc-header-toolbar .fc-button-group > .fc-button {
  flex: 0 0 auto;
  margin: 0;
}
.fc .fc-header-toolbar .fc-toolbar-chunk:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fc .fc-col-header-cell { background: var(--fondo); }
.fc .fc-col-header-cell-cushion { padding: 10px 4px; color: var(--suave); font-size: 11px; }
.fc .fc-daygrid-day-number { color: var(--tinta); padding: 8px; }
.fc .fc-list-event-title a { color: var(--tinta); }
.fc .fc-event { border-radius: 6px; padding: 1px 2px; }

/* Vistas de lista (principal en el celular) */
.fc .li-titulo { font-weight: 600; }
.fc .li-sub { color: var(--suave); font-size: 13px; margin-top: 2px; }
.fc .fc-list-event td { padding: 12px 10px; vertical-align: top; cursor: pointer; }
.fc .fc-list-event:hover td { background: var(--fondo); }
.badge {
  display: inline-block; margin-top: 6px; font-size: 12px; padding: 2px 9px; border-radius: 20px;
  border: 1px solid var(--borde); color: var(--suave); background: var(--fondo);
}
.badge-pendiente { color: #8a5a00; background: #fff4d6; border-color: #f0d58a; }
.badge-confirmada { color: #14633a; background: #dff5e8; border-color: #a9dcbd; }

/* ---------- Pantalla de administración ---------- */
.admin { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; }
.admin header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 12px; }
.admin h1 { margin: 0; font-size: 24px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--borde); margin-bottom: 22px; overflow-x: auto; }
.tab { font: inherit; background: none; border: none; padding: 12px 16px; cursor: pointer; color: var(--suave); border-bottom: 3px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--acento); border-bottom-color: var(--acento); font-weight: 600; }
.barra { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 16px; }
.barra p { margin: 0; color: var(--suave); }
table.tabla { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.tabla th, .tabla td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--borde); }
.tabla th { font-size: 13px; color: var(--suave); font-weight: 600; background: var(--fondo); }
.tabla tr:last-child td { border-bottom: none; }
.tabla tbody tr:hover { background: #fafafd; }
.tabla tr.inactivo td:not(.celda-acciones) { opacity: .5; }
.celda-acciones { text-align: right; white-space: nowrap; }
.celda-acciones .btn { padding: 6px 12px; font-size: 13px; margin-left: 4px; }
.etiqueta { font-size: 12px; background: var(--fondo); border: 1px solid var(--borde); border-radius: 20px; padding: 2px 8px; margin-left: 8px; color: var(--suave); }
input[type="color"] { padding: 2px; height: 44px; width: 80px; cursor: pointer; }
.vacio { padding: 28px; text-align: center; color: var(--suave); background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); }
#campos { padding-bottom: 2px; }

/* =====================================================================
   VERSIÓN CELULAR (pantallas angostas)
   ===================================================================== */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .layout { display: block; height: auto; }
  .firma {
    left: 12px;
    bottom: calc(5px + env(safe-area-inset-bottom));
    width: max-content;
    max-width: calc(100% - 24px);
    font-size: 9px;
    white-space: nowrap;
  }

  /* Barra superior fija con los estilistas como botones deslizables */
  .side {
    position: sticky; top: 0; z-index: 20;
    flex-direction: column; gap: 8px;
    padding: 8px 12px 7px; border-right: none; border-bottom: 1px solid var(--borde);
    overflow: visible;
    box-shadow: 0 3px 12px rgba(28, 33, 51, .06);
  }
  .side-top { min-height: 34px; }
  .side h1 { font-size: 20px; }
  .marca { display: none; }
  .enlace-admin { display: none; }
  .sec-estados, .sec-prof h2 { display: none; }
  .filtros { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 1px; margin: 0; scrollbar-width: none; }
  .filtros::-webkit-scrollbar { display: none; }
  .filtros label {
    white-space: nowrap; min-height: 38px; padding: 5px 8px; margin: 0; gap: 7px;
    color: var(--tinta); font-weight: 600; font-size: 13px;
    border: none; border-radius: 8px; background: transparent;
  }
  .filtros input { width: 18px; height: 18px; }

  /* Botón flotante para crear turnos */
  .btn-nuevo {
    position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 30; margin: 0; padding: 15px 22px; border-radius: 999px; font-size: 16px; font-weight: 600;
    box-shadow: 0 7px 24px rgba(28, 33, 51, .28);
  }

  .main { padding: 8px; overflow: visible; }
  #calendario { height: auto; min-height: 420px; padding: 10px 6px; margin-bottom: 90px; border-radius: 12px; }

  /* Barras del calendario más cómodas para el dedo */
  .fc .fc-toolbar { gap: 8px; }
  .fc .fc-toolbar-title { font-size: 1.05rem; }
  .fc .fc-button { padding: 8px 10px; font-size: 14px; min-height: 40px; }
  .fc .fc-footer-toolbar {
    margin-top: 14px;
    justify-content: center;
    padding: 6px;
    border-radius: 12px;
    background: var(--fondo);
    border: 1px solid var(--borde);
  }
  .fc .fc-footer-toolbar .fc-toolbar-chunk { width: 100%; justify-content: center; gap: 6px; }
  .fc .fc-footer-toolbar .fc-button-group {
    width: auto;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 7px;
  }
  .fc .fc-footer-toolbar .fc-button {
    width: auto;
    min-height: 40px;
    flex: 0 0 auto;
    margin: 0 !important;
    border: 1px solid transparent !important;
    border-radius: 9px !important;
    padding: 8px 10px !important;
    font-size: 13px;
    font-weight: 800;
  }
  .fc .fc-header-toolbar { padding-bottom: 4px; }
  .fc .fc-header-toolbar .fc-toolbar-chunk { gap: 6px; }
  .fc .fc-header-toolbar .fc-button {
    min-height: 38px;
    border-radius: 9px !important;
  }
  .fc .fc-list-day-cushion { padding: 10px; }
  .fc .fc-header-toolbar.fc-toolbar { flex-wrap: wrap; }
  .fc .fc-toolbar-chunk { display: flex; align-items: center; }
  .fc .fc-list-event { font-size: 14px; }
  .fc .fc-list-event-time { white-space: nowrap; }

  /* Semana y mes: textos compactos para evitar solapamientos */
  .fc .fc-timegrid-view .fc-col-header-cell-cushion {
    font-size: 4px !important;
    line-height: 1;
    padding: 7px 1px;
    white-space: nowrap;
    text-align: center;
  }
  .fc .fc-timegrid-slot-label-cushion {
    font-size: 8px !important;
    line-height: 1;
    white-space: nowrap;
  }
  .fc .fc-timegrid-axis-cushion { min-width: 48px; }
  .fc .fc-timegrid-event {
    border-radius: 4px;
    min-height: 18px;
  }
  .fc .fc-timegrid-event .fc-event-main { padding: 1px 3px; }
  .fc .fc-timegrid-event .fc-event-main-frame {
    min-width: 0;
    align-items: flex-start;
  }
  .fc .fc-timegrid-event .fc-event-title,
  .fc .fc-timegrid-event .fc-event-time {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8px !important;
    line-height: 1.15;
  }

  .fc .fc-daygrid-view .fc-col-header-cell-cushion {
    font-size: 4px !important;
    padding: 7px 1px;
    text-align: center;
  }
  .fc .fc-daygrid-day-number {
    font-size: 12px;
    padding: 5px;
  }
  .fc .fc-daygrid-day-events { min-height: 1em; }
  .fc .fc-daygrid-event {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none;
    margin: 1px 1px !important;
    padding: 0;
  }
  .fc .fc-daygrid-event-dot { display: none !important; }
  .fc .fc-daygrid-event .fc-event-title,
  .fc .fc-daygrid-event .fc-event-time {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8px !important;
    line-height: 1.15;
  }
  .fc .fc-daygrid-more-link {
    font-size: 8px !important;
    font-weight: 700;
  }
  .fc .fc-daygrid-view .fc-daygrid-event-harness {
    margin-top: 1px;
  }
  .mes-cita {
    display: flex;
    align-items: center;
    gap: 2px;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
  }
  .mes-punto {
    width: 5px;
    height: 5px;
    flex: 0 0 5px;
    border-radius: 50%;
  }
  .mes-hora {
    font-size: 7px;
    line-height: 1;
    font-weight: 700;
  }
  .mes-nombre {
    max-width: 42px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 7px;
    line-height: 1;
  }

  /* Formulario a pantalla completa */
  dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border: none; border-radius: 0; }
  #detalleDia {
    width: calc(100% - 16px); max-width: calc(100% - 16px);
    height: auto; max-height: calc(100vh - 40px);
    border-radius: 18px; margin: auto 8px 8px;
  }
  #detalleDia .detalle-dia-contenido { max-height: calc(100vh - 210px); }
  .detalle-dia-cita {
    grid-template-columns: 66px minmax(0, 1fr);
    min-height: 82px;
  }
  .detalle-dia-cita .badge { grid-column: 2; justify-self: start; margin-top: 0; }
  form { padding: 20px 16px 0; min-height: 100%; gap: 14px; }
  form h3 { font-size: 21px; }
  input, select, textarea { font-size: 16px; padding: 12px; } /* 16px evita que el celular haga zoom */
  .fila { flex-direction: column; gap: 14px; }
  .acciones {
    position: sticky; bottom: 0; background: var(--superficie);
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--borde); margin-top: auto;
  }
  .acciones .btn { padding: 13px 18px; font-size: 16px; }

  /* La ventana de acceso sigue siendo una tarjeta centrada, no pantalla completa */
  dialog.acceso { width: calc(100% - 24px); max-width: 420px; height: fit-content; max-height: calc(100% - 24px); border-radius: 24px; margin: auto; overflow-y: auto; }
  .acceso .acceso-tarjeta { padding: 30px 22px 22px; min-height: 0; }
  .acceso h2 { font-size: 23px; }

  /* Administración: filas apiladas como tarjetas */
  .admin { padding: 14px 12px 60px; }
  .barra { flex-direction: column; align-items: stretch; }
  .barra .btn { padding: 13px; }
  .tabla thead { display: none; }
  .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
  .tabla { background: none; border: none; }
  .tabla tr { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); margin-bottom: 10px; padding: 6px 0; }
  .tabla td { border: none; padding: 6px 14px; }
  .tabla td[data-label]:not(:first-child)::before { content: attr(data-label) ": "; color: var(--suave); font-size: 13px; }
  .tabla td:first-child { font-weight: 600; font-size: 17px; }
  .celda-acciones { text-align: left; display: flex; gap: 8px; padding-top: 10px !important; }
  .celda-acciones .btn { margin: 0; padding: 10px 14px; font-size: 14px; flex: 1; }
}
