/* Panel interno */

/* ---------- Login ---------- */
.login-page { display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 85% 10%, rgba(43, 88, 214, 0.4), transparent 45%), linear-gradient(160deg, #0b0b0b, #262626); }
.login-wrap { width: 100%; max-width: 400px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #fff; font-weight: 800; font-size: 1.4rem; margin-bottom: 20px; }
.login-brand b { color: var(--accent-light); }
.login-logo { width: 110px; height: 110px; border-radius: 50%; background: #fff; object-fit: cover; box-shadow: 0 0 0 5px var(--accent), 0 14px 34px rgba(0, 0, 0, 0.5); animation: badge-in 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }
.login-wrap h1 { margin: 0 0 4px; font-size: 1.4rem; }

/* ---------- Estructura ---------- */
.admin-main { max-width: 1180px; margin: 0 auto; padding: 16px 16px 48px; }

.today-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px; border-radius: var(--radius);
  background: radial-gradient(circle at 90% 0%, rgba(43, 88, 214, 0.5), transparent 50%), linear-gradient(135deg, #0b0b0b, #2a2a2a);
  color: #fff; box-shadow: var(--shadow); margin-bottom: 14px; position: relative; overflow: hidden;
}
.today-banner::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; border: 24px solid rgba(143, 178, 255, 0.18); }
.today-eyebrow { margin: 0; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-light); }
.today-main { display: flex; align-items: baseline; gap: 12px; }
.today-total { margin: 0; font-size: 3rem; font-weight: 800; line-height: 1; }
.today-caption { margin: 0; font-size: 1rem; font-weight: 600; }
.today-date { margin: 4px 0 0; color: var(--brand-100); font-size: 0.9rem; }
.today-date::first-letter { text-transform: uppercase; }
.today-breakdown { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.today-chip { padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.12); font-size: 0.85rem; font-weight: 600; }
.today-chip strong { font-size: 1.1rem; margin-right: 4px; }
.today-banner .btn { position: relative; z-index: 1; }

.mail-mode { margin-bottom: 14px; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff;
  font-weight: 700; cursor: pointer; white-space: nowrap; min-height: 44px;
}
.tab[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: inset 0 -3px 0 var(--accent); }

.agenda-layout { display: grid; gap: 14px; }
.card h2 { margin: 0 0 12px; font-size: 1.05rem; }

.date-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.date-nav .input { width: auto; min-height: 44px; flex: 1 1 160px; }
.date-heading { margin: 0 0 4px; font-size: 1.25rem; }
.date-heading::first-letter { text-transform: uppercase; }
.date-meta { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--border); background: #fff; font-weight: 600; font-size: 0.85rem; cursor: pointer; min-height: 36px; }
.filter[aria-pressed="true"] { background: var(--brand-50); border-color: var(--brand); color: var(--brand); }
.filter .n { opacity: 0.7; margin-left: 4px; }

/* ---------- Lista de citas ---------- */
.appt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.appt {
  background: #fff; border: 1px solid var(--border); border-left: 6px solid var(--warn);
  border-radius: 14px; padding: 14px; display: grid; grid-template-columns: 72px 1fr; gap: 12px;
}
.appt.s-confirmada { border-left-color: var(--ok); }
.appt.s-cancelada { border-left-color: var(--danger); opacity: 0.72; }
.appt.s-cancelada .appt-name { text-decoration: line-through; }
.appt-time { font-weight: 800; font-size: 1.05rem; color: var(--brand-700); line-height: 1.2; }
.appt-time small { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.appt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; justify-content: space-between; }
.appt-name { margin: 0; font-size: 1.05rem; font-weight: 800; }
.appt-meta { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.9rem; color: var(--muted); }
.appt-meta a { color: var(--brand-600); font-weight: 600; text-decoration: none; }
.appt-meta a:hover { text-decoration: underline; }
.appt-process { font-weight: 700; color: var(--text); }
.appt-topic { margin: 8px 0 0; padding: 10px 12px; background: var(--bg); border-radius: 10px; font-size: 0.92rem; white-space: pre-wrap; word-break: break-word; }
.appt-topic b { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 2px; }
.appt-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.appt-wa { font-size: 0.75rem; color: var(--muted); margin-top: 8px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-pendiente { background: var(--warn-bg); color: var(--warn); }
.pill-confirmada { background: var(--ok-bg); color: var(--ok); }
.pill-cancelada { background: var(--danger-bg); color: var(--danger); }
.pill-atendida { background: var(--info-bg); color: var(--info); }
.pill-no_asistio { background: var(--neutral-bg); color: var(--neutral); }
.pill-virtual { background: #f1eafd; color: #6b3fc4; }
.pill-presencial { background: var(--brand-50); color: var(--brand); }
.pill-virtual::before, .pill-presencial::before { display: none; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }

.btn-toggle[aria-pressed="true"].att-atendida { background: var(--info); border-color: var(--info); color: #fff; }
.btn-toggle[aria-pressed="true"].att-no_asistio { background: var(--neutral); border-color: var(--neutral); color: #fff; }

.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-state svg { width: 44px; height: 44px; margin: 0 auto 8px; color: var(--brand-100); }

/* ---------- Feriados y herramientas ---------- */
.holiday-form { display: grid; gap: 10px; }
.holiday-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.holiday-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.holiday-list strong::first-letter { text-transform: uppercase; }
.holiday-list span { color: var(--muted); font-size: 0.9rem; display: block; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.tool-row:last-child { border-bottom: 0; }
.tool-row p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.tool-result { font-size: 0.88rem; margin-top: 8px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--brand-700); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-weight: 600; box-shadow: var(--shadow); z-index: 50; max-width: calc(100% - 32px);
}
.toast.is-error { background: var(--danger); }

@media (min-width: 560px) {
  .holiday-form { grid-template-columns: 180px 1fr auto; align-items: end; }
}

@media (min-width: 960px) {
  .agenda-layout { grid-template-columns: 340px 1fr; align-items: start; }
  .agenda-side { position: sticky; top: 76px; }
  .today-total { font-size: 3.5rem; }
}

/* ---------- Aviso para activar notificaciones ---------- */
.push-prompt {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px; margin-bottom: 14px; border-radius: var(--radius);
  background: var(--accent-50); border: 1.5px solid #cdd9ff;
}
.push-prompt > div { flex: 1 1 200px; }
.push-prompt strong { display: block; }
.push-prompt p { margin: 2px 0 0; font-size: 0.88rem; color: var(--muted); }
.push-prompt .push-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.push-prompt .push-icon svg { width: 22px; height: 22px; }
