/* Panel de administración. Usa las variables y botones de styles.css. */
.admin { min-height: 100vh; background: radial-gradient(1200px 600px at 85% -10%, rgba(224, 178, 82, 0.09), transparent 60%), var(--bg); }
.admin::after { z-index: 0; }
.admin main { position: relative; z-index: 1; }
.admin .muted { color: var(--muted); }
.admin-wrap { width: min(1320px, calc(100% - 32px)); margin: 0 auto; }

.admin-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(8, 8, 8, 0.82);
  border-top: 3px solid transparent;
  border-image: var(--tricolor) 1;
  box-shadow: 0 1px 0 var(--line);
}
.admin-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.admin-bar .logo-seal { width: 44px; height: 44px; }
.admin-user { display: flex; align-items: center; gap: 12px; }
.admin-who { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.admin-who i { width: 8px; height: 8px; border-radius: 50%; background: #5bd68a; box-shadow: 0 0 0 3px rgba(91, 214, 138, 0.15); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-sm .icon-line { width: 16px; height: 16px; }
.btn-danger { border-color: rgba(255, 138, 101, 0.4); color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: rgba(255, 138, 101, 0.08); }
.icon-round {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.icon-round:hover { border-color: var(--gold); color: var(--gold); }
.icon-round .icon-line { width: 18px; height: 18px; }

/* Carga */
.boot { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 60vh; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ingreso */
.login { display: grid; place-items: center; min-height: calc(100vh - 71px); padding: 32px 16px; }
.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%), var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 34px 30px 30px;
  box-shadow: var(--shadow);
}
.login-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--gold-soft); color: var(--gold); margin-bottom: 18px; }
.login-card h1 { font-size: 46px; line-height: 1; margin: 8px 0 6px; }
.login-card .muted { font-size: 15px; margin-bottom: 8px; }
.login-card .btn { margin-top: 22px; }
.pass-field { position: relative; }
.pass-field input { padding-right: 76px; }
.pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--gold); font-size: 13px; font-weight: 700; padding: 8px 10px; }

/* Encabezado y resumen */
.dash { padding: 34px 0 72px; }
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; }
.dash-head h1 { font-size: clamp(40px, 5vw, 64px); line-height: 0.95; margin-top: 8px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--surface); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #5bd68a; animation: pulse 2s ease-in-out infinite; }
.live.is-off i { background: var(--danger); animation: none; }
.live.is-wait i { background: var(--gold); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(91, 214, 138, 0.18); } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 20px;
  display: grid;
  gap: 4px;
  min-width: 0;
}
.stat span { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.stat strong { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1.05; color: var(--gold); }
.stat small { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tablero */
.board { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); gap: 18px; align-items: start; }
.calendar, .day {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
}
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.cal-head h2 { font-size: clamp(30px, 3vw, 40px); }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-week { margin-bottom: 8px; }
.cal-week span { text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 92px;
  padding: 10px 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.cal-day:hover { border-color: rgba(224, 178, 82, 0.55); transform: translateY(-1px); }
.cal-num { font-weight: 700; font-size: 16px; }
.cal-count { font-size: 12px; font-weight: 700; color: var(--gold-ink); background: var(--gold); border-radius: 999px; padding: 2px 8px; }
.cal-fill { position: absolute; left: 10px; right: 10px; bottom: 9px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.cal-fill i { display: block; height: 100%; background: var(--gold-grad); border-radius: 4px; }
.cal-day.is-full .cal-fill i { background: var(--danger); }
.cal-day.is-full .cal-count { background: var(--danger); }
.cal-day.is-out { opacity: 0.38; }
.cal-day.is-past:not(.is-today) { opacity: 0.55; }
.cal-day.is-out.is-past { opacity: 0.28; }
.cal-day.is-today .cal-num { display: inline-grid; place-items: center; min-width: 28px; height: 28px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.cal-day.is-selected { border-color: var(--gold); background: linear-gradient(180deg, rgba(224, 178, 82, 0.12), rgba(224, 178, 82, 0.03)), var(--surface-2); box-shadow: 0 0 0 3px var(--gold-soft); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 8px; }
.cal-legend i { width: 18px; height: 4px; border-radius: 4px; display: block; }
.lg-free { background: rgba(255, 255, 255, 0.12); }
.lg-mid { background: var(--gold-grad); }
.lg-full { background: var(--danger); }

/* Detalle del día */
.day { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow: auto; }
.day-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.day-head h2 { font-size: clamp(28px, 2.6vw, 36px); line-height: 1; margin: 6px 0 4px; }
.day-head .muted { font-size: 14px; }
.day-close { display: none; }
.day-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin: 16px 0 14px; }
.day-bar i { display: block; height: 100%; background: var(--gold-grad); transition: width 0.3s ease; }
.hours-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hour-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: stretch; }
.hour-row time { font-family: var(--display); font-size: 20px; color: var(--muted); padding-top: 10px; }
.slot-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 52px;
  padding: 10px 12px 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.hour-row.is-free .slot-card { border-style: dashed; background: transparent; }
.free-label { color: var(--muted); font-size: 14px; }
.hour-row.is-booked time { color: var(--gold); }
.hour-row.is-booked .slot-card { border-color: rgba(224, 178, 82, 0.35); border-left: 3px solid var(--gold); align-items: flex-start; }
.hour-row.is-cont .slot-card { border-left: 3px solid rgba(224, 178, 82, 0.35); font-size: 14px; }
.hour-row.is-blocked .slot-card { border-left: 3px solid var(--muted); background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 8px, transparent 8px 16px), var(--surface-2); }
.hour-row.is-past { opacity: 0.55; }
.hour-row.is-now time { color: var(--text); }
.hour-row.is-now time::after { content: "Ahora"; display: block; font-family: var(--font); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #5bd68a; }
.client { display: grid; gap: 3px; min-width: 0; flex: 1 1 220px; }
.client-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.client-top strong { font-size: 17px; }
.client p { font-size: 14px; }
.client b { color: var(--gold); }
.client .muted { font-size: 13px; }
.note-box { margin-top: 4px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); color: var(--text); font-style: italic; }
.client-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--muted); border-radius: 999px; padding: 2px 8px; }
.tag-gold { border-color: rgba(224, 178, 82, 0.5); color: var(--gold); }
.cancelled { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--muted); font-size: 14px; }
.cancelled summary { cursor: pointer; font-weight: 700; }
.cancelled ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.cancelled time { font-family: var(--display); color: var(--muted); margin-right: 6px; }

/* Diálogo */
.confirm {
  width: min(440px, calc(100% - 32px));
  border: 1px solid var(--line-2);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  padding: 26px;
  box-shadow: var(--shadow);
}
.confirm::backdrop { background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); }
.confirm h3 { font-size: 22px; margin-bottom: 8px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .board { grid-template-columns: 1fr; }
  .day { position: static; max-height: none; }
  .day-close { display: inline-grid; }
}
@media (max-width: 620px) {
  .admin-bar .logo-text small { display: none; }
  .dash-head { flex-direction: column; align-items: start; }
  .stat strong { font-size: 32px; }
  .calendar, .day { padding: 16px; border-radius: 22px; }
  .cal-week, .cal-grid { gap: 4px; }
  .cal-day { min-height: 64px; padding: 6px; border-radius: 12px; }
  .cal-num { font-size: 14px; }
  .cal-count { font-size: 0; padding: 0; width: 8px; height: 8px; }
  .cal-fill { left: 6px; right: 6px; bottom: 6px; }
  .hour-row { grid-template-columns: 48px 1fr; }
  .client-actions { width: 100%; }
}
