:root {
  --bg: #eef6f9;
  --surface: #ffffff;
  --ink: #16303c;
  --muted: #5a7380;
  --line: #d4e4eb;
  --brand: #0a7ea4;
  --brand-dark: #065a78;
  --accent: #e85d4c;
  --ok: #1e7a46;
  --warn: #9a6b00;
  --mint: #d8f0ea;
  --sky: #d7eef8;
  --shadow: 0 12px 36px rgba(6, 55, 72, 0.1);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Nunito Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(10, 126, 164, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 10%, rgba(216, 240, 234, 0.9), transparent 50%),
    linear-gradient(180deg, #f4fafc 0%, var(--bg) 45%, #e8f2f6 100%);
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(960px, calc(100% - 2rem)); margin: 0 auto; }

.site-header {
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
}
.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 3px;
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.brand strong { display: block; line-height: 1.1; }
.brand small { color: var(--muted); }
.header-nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.header-nav a { color: var(--muted); font-weight: 600; text-decoration: none; }
.header-nav a:hover { color: var(--brand); }

.main-wrap { padding: 1.5rem 0 3rem; }
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  padding: 1.25rem 0 2rem;
}

.hero {
  background:
    linear-gradient(135deg, rgba(6, 90, 120, 0.92), rgba(10, 126, 164, 0.88) 55%, rgba(45, 160, 170, 0.85)),
    radial-gradient(circle at 85% 20%, rgba(255,255,255,0.22), transparent 40%);
  color: #fff;
  border-radius: calc(var(--radius) + 4px);
  padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.hero h1 { margin: 0 0 0.4rem; font-size: clamp(1.5rem, 4vw, 2rem); }
.hero p { margin: 0; opacity: 0.95; max-width: 38rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card h2, .card h3 { margin-top: 0; }

.agenda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}
.agenda-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.agenda-card:hover {
  transform: translateY(-2px);
  border-color: #9fc3ce;
  text-decoration: none;
}
.agenda-card strong { display: block; margin-bottom: 0.35rem; font-size: 1.05rem; }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #e7f3f6;
  color: var(--brand-dark);
}
.badge.orden { background: #f8ebe8; color: #8d2f24; }

.steps {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.steps li {
  background: #e8eef2;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
}
.steps li.active { background: var(--brand); color: #fff; }

label { display: block; font-weight: 700; margin: 0.85rem 0 0.35rem; }
input, select, textarea, button, .btn {
  font: inherit;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #fff;
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-width: 0;
  padding: 0;
  border-radius: 4px;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(15,95,117,.25);
  border-color: var(--brand);
}
.help { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 0; }
.password-match { font-weight: 700; min-height: 1.25em; }
.password-match.is-match { color: var(--ok); }
.password-match.is-mismatch { color: var(--accent); }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.slot-grid label {
  margin: 0;
  font-weight: 600;
}
.slot-grid input { display: none; }
.slot-grid span {
  display: block;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.25rem;
  background: #fff;
  cursor: pointer;
}
.slot-grid input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 0.8rem 1.1rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(0.95); text-decoration: none; }
.btn-secondary { background: #e8eef2; color: var(--ink); }
.btn-secondary:hover { text-decoration: none; }
.btn-danger { background: #8d2f24; color: #fff; }
.btn-small { padding: 0.4rem 0.7rem; font-size: 0.85rem; border-radius: 8px; }

.alert {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}
.alert-ok { background: #e5f7ec; color: var(--ok); }
.alert-error { background: #fdecea; color: var(--accent); }
.alert-info { background: #e7f3f6; color: var(--brand-dark); }

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.summary-list span { color: var(--muted); }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; }
.status {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  border: 1px solid transparent;
}
/* Estados — colores fuertes e identificatorios */
.status-confirmado { background: #2563eb; color: #fff; border-color: #1d4ed8; }
.status-presente { background: #0d9488; color: #fff; border-color: #0f766e; }
.status-en_atencion { background: #7c3aed; color: #fff; border-color: #6d28d9; }
.status-atendido,
.status-asistio { background: #64748b; color: #fff; border-color: #475569; }
.status-ausente { background: #ea580c; color: #fff; border-color: #c2410c; }
.status-cancelado { background: #dc2626; color: #fff; border-color: #b91c1c; }

.estado-row-confirmado { background: #eff6ff !important; box-shadow: inset 6px 0 0 #2563eb; }
.estado-row-presente { background: #f0fdfa !important; box-shadow: inset 6px 0 0 #0d9488; }
.estado-row-en_atencion { background: #f5f3ff !important; box-shadow: inset 6px 0 0 #7c3aed; }
.estado-row-atendido { background: #f1f5f9 !important; box-shadow: inset 6px 0 0 #64748b; }
.estado-row-ausente { background: #fff7ed !important; box-shadow: inset 6px 0 0 #ea580c; }
.estado-row-cancelado { background: #fef2f2 !important; box-shadow: inset 6px 0 0 #dc2626; opacity: 0.85; }

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: end;
}
.filters .actions { margin: 0; }

.qr-box {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #f8fbfc;
}
.qr-box canvas {
  background: #fff;
  border-radius: 8px;
  flex: 0 0 auto;
}
.qr-canvas {
  width: 180px;
  height: 180px;
  background: #fff;
  border-radius: 8px;
  flex: 0 0 auto;
}
.qr-canvas img, .qr-canvas canvas {
  display: block;
  width: 180px !important;
  height: 180px !important;
}
.qr-box strong { display: block; margin-bottom: 0.35rem; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--line);
}
.swatch.libre { background: #f7faf8; border-color: #c5d9cc; }
.swatch.confirmado,
.swatch.ocupado { background: #2563eb; border-color: #2563eb; }
.swatch.presente { background: #0d9488; border-color: #0d9488; }
.swatch.en-atencion { background: #7c3aed; border-color: #7c3aed; }
.swatch.atendido { background: #94a3b8; border-color: #94a3b8; }
.swatch.ausente { background: #ea580c; border-color: #ea580c; }
.swatch.cancelado { background: #dc2626; border-color: #dc2626; }
.swatch.sobreturno { background: #a21caf; border-color: #a21caf; }

.agenda-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 1rem;
}

/* Day view estilo agenda / Outlook */
.dayview-toolbar-card { padding: 0.9rem 1rem; }
.dayview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.dayview-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.dayview-date {
  display: flex;
  flex-direction: column;
  margin-left: 0.35rem;
  line-height: 1.2;
}
.dayview-date strong { font-size: 1.05rem; }
.dayview-date span { color: var(--muted); font-size: 0.86rem; font-weight: 600; }
.dayview-filters {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.dayview-filters input[type="date"],
.dayview-filters select {
  width: auto;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.dayview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.7rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  align-items: center;
}
.dayview-card { padding: 0; overflow: hidden; }
.dayview { background: #fff; }
.dayview-head,
.dayview-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 44px;
}
.dayview-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f6f8;
  border-bottom: 1px solid #cfd8de;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.dayview-head .dayview-col-time,
.dayview-head .dayview-col-appt { padding: 0.55rem 0.75rem; }
.dayview-body {
  max-height: calc(100vh - 260px);
  overflow: auto;
}
.dayview-row { border-bottom: 1px solid #e6edf1; }
.dayview-row:hover { background: #fafcfd; }
.dayview-col-time {
  padding: 0.35rem 0.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  color: #5b6b75;
  border-right: 1px solid #e6edf1;
  background: #fafbfc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.dayview-col-appt {
  padding: 0.2rem 0.35rem;
  min-width: 0;
}
.appt-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 38px;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}
.appt-free {
  border: 1px dashed #c5d0d6;
  background: repeating-linear-gradient(-45deg, #fbfcfd, #fbfcfd 6px, #f5f8fa 6px, #f5f8fa 12px);
  color: #7a8a94;
  font-weight: 600;
  font-size: 0.88rem;
}
.appt-free:hover {
  border-color: #2f6fed;
  color: #2f6fed;
  background: #eef4ff;
  text-decoration: none;
}
.appt-free em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
  opacity: 0.85;
}
.appt-past {
  color: #b0b8be;
  font-size: 0.85rem;
  padding-left: 0.55rem;
}
.appt-busy {
  background: #2563eb;
  color: #fff;
  box-shadow: inset 5px 0 0 rgba(0,0,0,0.22);
  border: 1px solid transparent;
}
.appt-busy.appt-confirmado { background: #2563eb; border-color: #1d4ed8; }
.appt-busy.appt-presente { background: #0d9488; border-color: #0f766e; }
.appt-busy.appt-en_atencion { background: #7c3aed; border-color: #6d28d9; }
.appt-busy.appt-atendido,
.appt-busy.appt-asistio { background: #64748b; border-color: #475569; }
.appt-busy.appt-ausente { background: #ea580c; border-color: #c2410c; }
.appt-busy.appt-cancelado { background: #dc2626; border-color: #b91c1c; }
/* Sobreturno: borde magenta, sin tapar el color de estado */
.appt-busy.appt-st {
  outline: 2px solid #e879f9;
  outline-offset: 1px;
}
.appt-busy.appt-confirmado.appt-st { background: #2563eb; }
.appt-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.appt-main strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appt-meta {
  font-size: 0.78rem;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appt-side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.appt-busy .status {
  background: rgba(0,0,0,0.28);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}
.appt-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.appt-actions a,
.appt-actions button,
.appt-actions-inline a,
.appt-actions-inline button {
  appearance: none;
  border: 0;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.28rem 0.45rem;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.appt-actions a:hover,
.appt-actions button:hover {
  background: rgba(255,255,255,0.3);
  text-decoration: none;
}
.appt-actions button.danger,
.appt-actions-inline button.danger { background: rgba(141, 47, 36, 0.85); }
.appt-actions form {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0;
}
.appt-actions-inline a,
.appt-actions-inline button {
  background: #e8eef2;
  color: var(--ink);
}
.appt-actions-inline button.danger {
  background: #8d2f24;
  color: #fff;
}
.dayview-order-table td,
.dayview-order-table th { vertical-align: middle; }

.dayview-row.is-focused {
  outline: 2px solid #2f6fed;
  outline-offset: -2px;
  background: #eef4ff !important;
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.18);
  z-index: 1;
  position: relative;
}
.dayview-row.is-focused .dayview-col-time {
  background: #dce8ff;
  color: #1d4fbf;
}
.dayview-row.is-now {
  position: relative;
  background: #fff8e8;
  scroll-margin-top: 3rem;
}
.dayview-row.is-now .dayview-col-time {
  background: #ffe6b0;
  color: #8a5a00;
  font-weight: 800;
}
.dayview-row.is-now::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: #e6a100;
  z-index: 2;
}
tr.is-now-row {
  outline: 2px solid #f0a500;
  outline-offset: -2px;
}
tr.is-now-row td:first-child {
  box-shadow: inset 4px 0 0 #f0a500;
}

@media (max-width: 900px) {
  .dayview-head,
  .dayview-row { grid-template-columns: 58px 1fr; }
  .appt-block { flex-direction: column; align-items: flex-start; }
  .appt-side { width: 100%; justify-content: space-between; }
  .dayview-body { max-height: none; }
}

@media (max-width: 640px) {
  .header-inner { align-items: flex-start; flex-direction: column; }
  .summary-list li { flex-direction: column; gap: 0.15rem; }
  .qr-box { justify-content: center; text-align: center; }
  .dayview-toolbar { align-items: stretch; }
  .dayview-filters { width: 100%; }
  .dayview-filters input,
  .dayview-filters select { flex: 1; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0.55rem 0.35rem 0;
  font-weight: 700;
  color: var(--ink);
  width: auto;
}
.chip input[type="checkbox"] {
  width: 1.05rem !important;
  height: 1.05rem;
  min-width: 1.05rem;
  padding: 0 !important;
  margin: 0;
  border-radius: 4px;
  flex: 0 0 auto;
  accent-color: var(--brand);
}
.dias-check {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}
.dias-check .chip {
  margin: 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.dias-check .chip:has(input:checked) {
  background: #e7f3f6;
  border-color: var(--brand);
  color: var(--brand-dark);
}
.dias-check .chip:hover {
  border-color: #9fc3ce;
}
.dayview-row.is-st .dayview-col-time { color: #a21caf; font-weight: 800; }
.dayview-row.is-presente .dayview-col-time { color: #0d9488; font-weight: 800; }
.dayview-row.is-en-atencion .dayview-col-time { color: #7c3aed; font-weight: 800; }

/* Modal PDF */
body.pdf-modal-open { overflow: hidden; }
.pdf-modal[hidden] { display: none !important; }
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pdf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 30, 40, 0.55);
}
.pdf-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  height: min(90vh, 900px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pdf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
}
.pdf-modal-header strong { font-size: 1rem; }
.pdf-modal-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.pdf-modal-body {
  flex: 1;
  min-height: 0;
  background: #525659;
}
.pdf-modal-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #525659;
}

/* ——— Login staff (admin / recepción / consultorio) ——— */
.login-body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}
.login-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: stretch;
  padding: clamp(1.5rem, 4vw, 3rem);
}
.login-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 20%, rgba(255,255,255,0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(216, 240, 234, 0.35), transparent 50%),
    linear-gradient(155deg, var(--brand-dark) 0%, var(--brand) 48%, #1aa0a8 100%);
}
.login-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent 85%);
  pointer-events: none;
}
.login-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  width: min(440px, 100%);
  margin: auto 0;
  animation: loginFadeUp .55s ease both;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}
.login-brand:hover { text-decoration: none; color: inherit; }
.login-brand .brand-logo,
.login-brand .brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.login-brand .brand-mark {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  font-size: 1.1rem;
}
.login-brand .brand-logo {
  background: #fff;
  padding: 4px;
  border: 0;
}
.login-brand strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.15;
}
.login-brand small {
  display: block;
  opacity: 0.85;
  font-weight: 600;
  margin-top: 0.15rem;
}
.login-display {
  font-family: "Source Serif 4", "Nunito Sans", serif;
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.02em;
  max-width: 16ch;
  animation: loginFadeUp .65s ease .08s both;
}
.login-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.login-points li {
  position: relative;
  padding-left: 1.35rem;
  font-weight: 600;
  font-size: 0.95rem;
  opacity: 0.95;
}
.login-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #9fe3d6;
  box-shadow: 0 0 0 3px rgba(159, 227, 214, 0.28);
}
.login-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0.88;
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background:
    radial-gradient(circle at 90% 10%, var(--sky), transparent 35%),
    radial-gradient(circle at 10% 90%, var(--mint), transparent 40%),
    linear-gradient(180deg, #f7fbfd 0%, #eef5f8 100%);
}
.login-card {
  width: min(420px, 100%);
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(212, 228, 235, 0.95);
  border-radius: 22px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.8) inset,
    0 18px 48px rgba(6, 55, 72, 0.1);
  padding: clamp(1.4rem, 3vw, 2rem);
  backdrop-filter: blur(10px);
  animation: loginFadeUp .55s ease .12s both;
}
.login-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-dark);
  background: linear-gradient(90deg, var(--sky), var(--mint));
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  margin-bottom: 0.85rem;
}
.login-role-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
  flex: 0 0 auto;
}
.login-card h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
}
.login-lead {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}
.login-form label { margin-top: 0.95rem; }
.login-form label:first-of-type { margin-top: 0; }
.login-form input {
  border-radius: 12px;
  border-color: #c9dae3;
  background: #fbfdfe;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.login-form input:focus {
  background: #fff;
  outline: 2px solid color-mix(in srgb, var(--brand) 28%, transparent);
  border-color: var(--brand);
}
.btn-login {
  width: 100%;
  margin-top: 0.35rem;
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #a83228));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .15s ease, filter .15s ease;
}
.btn-login:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}
.login-foot {
  margin: 1.25rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}
.login-foot a { color: var(--brand-dark); }

.login-panel-recepcion .login-hero-bg {
  background:
    radial-gradient(ellipse 70% 55% at 15% 20%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(155deg, #066377 0%, #0a8a9e 50%, #2aa89a 100%);
}
.login-panel-consultorio .login-hero-bg {
  background:
    radial-gradient(ellipse 70% 55% at 15% 20%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(155deg, #0a5f7a 0%, #0a7ea4 48%, #3d8fd0 100%);
}
.login-panel-admin .login-hero-bg {
  background:
    radial-gradient(ellipse 70% 55% at 15% 20%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(155deg, #064e63 0%, #0a7ea4 48%, #1a9a8f 100%);
}

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

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero {
    min-height: auto;
    padding: 1.5rem 1.25rem 1.75rem;
  }
  .login-hero-content { gap: 1.15rem; margin: 0; width: 100%; }
  .login-display { max-width: none; font-size: 1.55rem; }
  .login-points { display: none; }
  .login-panel { padding: 1.25rem 1rem 2rem; }
}

/* ——— Configuración root ——— */
.config-card h3 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.05rem;
  color: var(--brand-dark);
}
.config-preview {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: linear-gradient(120deg, var(--sky), var(--mint));
}
.config-preview-swatches {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.config-preview-swatches span {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.config-preview-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.config-preview-brand strong { display: block; }
.config-preview-brand small { color: var(--muted); }
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 1rem;
}
.config-span-2 { grid-column: 1 / -1; }
.color-field {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.color-field input[type="color"] {
  width: 48px;
  height: 44px;
  padding: 0.2rem;
  border-radius: 10px;
  cursor: pointer;
  flex: 0 0 auto;
}
.color-field input[type="text"],
.color-field input:not([type="color"]) {
  flex: 1;
}
.config-reset {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
@media (max-width: 700px) {
  .config-grid { grid-template-columns: 1fr; }
  .config-span-2 { grid-column: auto; }
}
