:root {
  /* ===== TEMA OSCURO (por defecto) ===== */
  --bg: #0d1b2f;
  --bg-grad: #14263f;      /* extremo cálido del degradado del fondo */
  --bg-deep: #0a1120;      /* huecos muy profundos */
  --panel: #16263d;
  --panel2: #1e3350;
  --line: #243752;
  --text: #f4f5f2;
  --muted: #b9c2d0;
  --label: #8fa0b8;
  --accent: #00a038;
  --accent2: #22c55e;
  --ok: #17c05b;
  --ok2: #22c55e;
  --danger: #e5484d;
  --salmon: #ff9b8f;
  --warn: #f5a524;
  --on-accent: #0b1522;    /* texto sobre botones verdes */
  --hdr: rgba(13, 27, 47, .9);
  --pop: rgba(22, 38, 61, .96);
  --tinte: rgba(30, 51, 80, .5);
  --soft: rgba(255, 255, 255, .16);
  --soft2: rgba(255, 255, 255, .1);
  --sombra: 0 12px 40px rgba(0, 0, 0, .55);
  /* Colores por sala (Reservas del día del panel de administración) */
  --rc0: #3fd26b; --rc1: #5da2ff; --rc2: #f2b13a;
  --rc3: #e879f9; --rc4: #2dd4bf; --rc5: #fb7185;
}

/* ===== TEMA CLARO ===== */
:root[data-tema="claro"] {
  --bg: #f5f5f2;
  --bg-grad: #e9eee9;
  --bg-deep: #e6e8e1;
  --panel: #ffffff;
  --panel2: #f1f2ec;
  --line: #dee1d9;
  --text: #0d1a2e;
  --muted: #55616f;
  --label: #5d6a7d;
  --accent: #00a038;
  --accent2: #00782c;
  --ok: #0e9447;
  --ok2: #0a7833;
  --danger: #d33b45;
  --salmon: #e2685a;
  --warn: #8a4d00;
  --on-accent: #0b1522;
  --hdr: rgba(245, 245, 242, .92);
  --pop: rgba(255, 255, 255, .97);
  --tinte: rgba(13, 26, 46, .05);
  --soft: rgba(13, 26, 46, .16);
  --soft2: rgba(13, 26, 46, .08);
  --sombra: 0 12px 40px rgba(13, 26, 46, .16);
  --rc0: #078a35; --rc1: #1f6fe0; --rc2: #b97700;
  --rc3: #b321d0; --rc4: #0e9f8f; --rc5: #d63d5c;
}
@media (prefers-color-scheme: light) {
  :root[data-tema="auto"] {
    --bg: #f5f5f2;
    --bg-grad: #e9eee9;
    --bg-deep: #e6e8e1;
    --panel: #ffffff;
    --panel2: #f1f2ec;
    --line: #dee1d9;
    --text: #0d1a2e;
    --muted: #55616f;
    --label: #5d6a7d;
    --accent: #00a038;
    --accent2: #00782c;
    --ok: #0e9447;
    --ok2: #0a7833;
    --danger: #d33b45;
    --salmon: #e2685a;
    --warn: #8a4d00;
    --on-accent: #0b1522;
    --hdr: rgba(245, 245, 242, .92);
    --pop: rgba(255, 255, 255, .97);
    --tinte: rgba(13, 26, 46, .05);
    --soft: rgba(13, 26, 46, .16);
    --soft2: rgba(13, 26, 46, .08);
    --sombra: 0 12px 40px rgba(13, 26, 46, .16);
    --rc0: #078a35; --rc1: #1f6fe0; --rc2: #b97700;
    --rc3: #b321d0; --rc4: #0e9f8f; --rc5: #d63d5c;
  }
}
* { box-sizing: border-box; }
/* Ocultar la barra de desplazamiento en toda la app (se sigue deslizando igual) */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, var(--bg-grad) 0%, var(--bg) 55%) fixed;
  color: var(--text);
  /* Vista tipo app: pantalla fija (sin scroll de página) */
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Marca de agua: logo fijo y muy sutil detrás de todo el contenido */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url('assets/marca-agua.png') center / min(440px, 82vw) no-repeat;
  opacity: .06;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------- Header ---------- */
/* Header: logo a un lado + salas registradas al otro lado */
.app-header {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
  padding: 8px 16px;
  background: var(--hdr);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
  flex: 0 0 auto;
}
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand strong { color: var(--accent2); }
.brand-logo { width: 190px; height: auto; object-fit: contain; }

/* Sala actual: su logo en la esquina superior derecha */
.sala-actual {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px 4px 4px;
  color: var(--text); cursor: pointer;
  font-size: .82rem; font-weight: 700;
  margin-right: 6px;
  max-width: 180px;
  transition: border-color .15s, transform .12s;
}
.sala-actual:hover { border-color: var(--accent); transform: translateY(-1px); }
.sala-actual span:not(.sala-chip-foto) {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sala-chip-foto {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
  display: grid; place-items: center;
  font-size: 1rem;
  border: 2px solid var(--soft);
}
/* Logo/foto de la sala en las tarjetas */
.room-foto {
  height: 120px; margin: -14px -14px 12px;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
}
.room-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Vista previa en el editor de sala */
.sala-foto-edit { display: grid; place-items: center; margin-bottom: 12px; }
.sala-foto-edit img {
  width: 84px; height: 84px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--line);
}
.sala-chip.inactive { opacity: .5; }

/* Vista previa de la foto horizontal (portada) de la sala */
.portada-preview {
  display: grid; place-items: center; margin-bottom: 8px;
  border: 1px dashed var(--line); border-radius: 10px;
  background: var(--panel2); overflow: hidden; min-height: 70px;
}
.portada-preview img { width: 100%; height: 132px; object-fit: cover; display: block; }
.portada-preview span { color: var(--muted); font-size: .84rem; padding: 14px; }

.header-actions { display: flex; gap: 8px; margin-left: auto; flex: 0 0 auto; }

main {
  flex: 1 1 auto;
  min-height: 0; /* clave: permite scroll interno en un flex child */
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px 104px;
}

/* ---------- Botones ---------- */
.btn {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 16px; font-size: .95rem;
  transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.2); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: .85rem; border-radius: 8px; }
.btn-big { width: 100%; padding: 13px; font-size: 1.05rem; margin-top: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- Paneles ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

/* ---------- Tipografía de títulos (referencia: Barlow Condensed) ---------- */
h1, h2, .auth-title {
  font-family: "Barlow Condensed", "Barlow", sans-serif;
  font-style: italic; font-weight: 900;
  text-transform: uppercase; letter-spacing: .3px;
}
h2 { margin: 0; font-size: 1.5rem; line-height: 1.05; }
h3.sub {
  margin: 24px 0 8px; font-size: .8rem; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--label); font-style: normal;
  font-family: "Barlow", sans-serif;
}
.verde { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Calendario ---------- */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-h { text-align: center; font-size: .8rem; color: var(--muted); padding: 4px 0; text-transform: uppercase; }
.cal-day {
  position: relative; aspect-ratio: 1;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-size: .95rem;
  transition: transform .1s, box-shadow .1s;
}
.cal-day:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0, 160, 56, .35); }
.cal-day.today { border-color: var(--accent2); }
.cal-day.sel { background: var(--accent); border-color: var(--accent); }
.cal-day.dis { opacity: .3; cursor: not-allowed; }
.cal-day .dot {
  position: absolute; top: 3px; right: 4px;
  font-size: .62rem; background: var(--accent2); color: var(--on-accent);
  border-radius: 999px; padding: 1px 5px; font-weight: 700;
}

/* ---------- Salas ---------- */
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.room-card {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  transition: transform .12s, box-shadow .12s;
}
.room-card h3 { margin: 0; font-size: 1.05rem; }
.room-card .price { font-size: 1.4rem; font-weight: 800; color: var(--accent2); }
.room-card .price span { font-size: .8rem; color: var(--muted); font-weight: 400; }
.room-card .cap { color: var(--muted); font-size: .9rem; }
.feats { margin: 2px 0 6px; padding-left: 18px; color: var(--muted); font-size: .85rem; display: grid; gap: 2px; }
.room-card .btn { margin-top: auto; }
.room-card.inactive { opacity: .55; }

/* ---------- Horarios ---------- */
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.slot {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); padding: 12px; font-size: 1rem;
  display: flex; flex-direction: column; gap: 3px; align-items: center;
  transition: transform .1s, box-shadow .1s;
}
.slot small { font-size: .78rem; color: var(--muted); }
.slot.available { border-color: var(--ok); background: rgba(23, 192, 91, .12); }
.slot.available:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(23, 192, 91, .35); }
.slot.reserved, .slot.blocked, .slot.past { opacity: .45; cursor: not-allowed; text-decoration: line-through; }

/* ---------- Confirmación ---------- */
.summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 16px;
}
.summary span { display: block; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.summary strong { font-size: 1rem; }
.summary strong.accent, .accent { color: var(--accent2); }
label { display: block; margin: 10px 0; font-size: .9rem; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); margin: 0; }
label.check input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); }
input, select {
  width: 100%; margin-top: 5px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 9px;
  color: var(--text); padding: 9px 11px; font-size: .95rem;
}
input:focus, select:focus { outline: 2px solid var(--accent); }

.success { text-align: center; padding: 20px 0; display: grid; gap: 8px; justify-items: center; }
.ok-mark {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--ok); color: #06240f; font-size: 2rem; font-weight: 800;
  display: grid; place-items: center;
  animation: pop .35s ease;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* Selección de rango de horas */
.slot.in-range { border-color: var(--accent); background: rgba(0, 160, 56, .2); box-shadow: inset 0 0 0 1px var(--accent); }
.range-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-top: 14px; padding: 12px 16px;
  background: var(--panel2); border: 1px solid var(--accent); border-radius: 12px;
}
.range-bar > span { font-weight: 700; }

/* Mis reservas / historial */
.mine-item {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px; display: grid; gap: 6px;
}
.mine-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.badge { font-size: .7rem; padding: 3px 10px; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.badge-next { background: rgba(23, 192, 91, .18); color: var(--ok2); }
.badge-past { background: var(--soft2); color: var(--muted); }
.mine-detail { color: var(--muted); font-size: .9rem; }
.mine-item .btn { justify-self: start; }
.res-past { opacity: .55; }
.res-past .res-time { color: var(--muted); }
.hist-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.hist-filters select { width: auto; min-width: 200px; margin-top: 0; }
.hist-filters input { flex: 1; min-width: 180px; margin-top: 0; }
/* ================= PANEL DE ADMINISTRACIÓN ================= */
.admin-head {
  display: flex; align-items: center; gap: 12px;
  margin: 0 2px 14px; padding-top: 2px;
}
.admin-head-ico {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.45rem;
  background: linear-gradient(135deg, rgba(0, 160, 56, .28), rgba(0, 160, 56, .06));
  border: 1px solid rgba(0, 160, 56, .5);
  box-shadow: 0 6px 18px rgba(0, 160, 56, .22);
}
.admin-head h1 { font-size: 1.45rem; line-height: 1.05; margin: 0; }
.admin-head p { margin: 4px 0 0; }

/* Pestañas del panel: barra scrollable con indicador inferior (referencia) */
.admin-tabs {
  display: flex; gap: 2px; flex-wrap: nowrap;
  overflow-x: auto; margin: 0 0 18px; padding: 0;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
  position: sticky; top: 0; z-index: 20;
  background: var(--hdr);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 13px 13px; margin-bottom: -1px;
  background: none; border: 0; border-bottom: 3px solid transparent;
  color: var(--muted); font-weight: 600; font-size: .93rem;
  white-space: nowrap; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 700; }
.admin-tab .pill { background: var(--danger); color: #fff; box-shadow: none; }

/* ---------- Reservas del día (referencia del diseño) ---------- */
.admin-day {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 8px; margin-bottom: 12px;
}
.admin-day .ib {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  background: var(--panel2); border: 1px solid var(--line);
  color: var(--text); font-size: 22px; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s, transform .1s;
}
.admin-day .ib:hover { background: var(--soft); }
.admin-day .ib:active { transform: scale(.92); }
.admin-day .mid { flex: 1; text-align: center; min-width: 0; line-height: 1.25; }
.admin-day .mid b { display: block; font-size: 17px; font-weight: 600; text-transform: capitalize; }
.admin-day .mid span { color: var(--muted); font-size: 13.5px; }
.admin-day .today {
  flex: none; font-size: 13.5px; font-weight: 600; color: var(--ok2);
  background: rgba(23, 192, 91, .14); border: 1px solid rgba(23, 192, 91, .4);
  border-radius: 10px; padding: 9px 12px; cursor: pointer;
  transition: background .15s, transform .1s;
}
.admin-day .today:hover { background: rgba(23, 192, 91, .24); }
.admin-day .today:active { transform: scale(.95); }
.admin-day .today[hidden] { display: none; }

.admin-stats { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin: 0 0 12px; }
.admin-stats .stat { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; }
.admin-stats .stat span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.admin-stats .stat b { display: block; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }

.admin-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 4px; padding: 2px 0 10px; scrollbar-width: none; }
.admin-chips::-webkit-scrollbar { display: none; }
.admin-chips .chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font-weight: 600; font-size: 14.5px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.admin-chips .chip:active { transform: scale(.95); }
.admin-chips .chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); }
.admin-chips .chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.admin-chips .chip.on i { box-shadow: 0 0 0 1px var(--bg); }

.res-list { display: grid; gap: 10px; }
.res-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.res-row {
  display: grid; grid-template-columns: 82px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px;
}
.res-time { border-right: 3px solid var(--rc, var(--accent)); padding-right: 12px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.res-time b { display: block; font-size: 21px; font-weight: 600; }
.res-time span { color: var(--muted); font-size: 13.5px; }
.res-who { min-width: 0; }
.res-who b { display: block; font-size: 17px; font-weight: 600; line-height: 1.2; }
.res-who span { display: block; color: var(--muted); font-size: 13.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-price { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-acts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.res-acts button {
  padding: 12px; font-weight: 600; font-size: 14.5px;
  border: 0; background: none; color: var(--text); cursor: pointer;
  transition: background .15s;
}
.res-acts button + button { border-left: 1px solid var(--line); color: var(--danger); }
.res-acts button:hover { background: var(--panel2); }
.res-ask {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: rgba(229, 72, 77, .12);
  border-top: 1px solid var(--line); font-weight: 600; font-size: 14.5px;
}
.res-ask div { display: flex; gap: 8px; }
.res-ask button { padding: 8px 14px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-weight: 600; cursor: pointer; }
.res-ask .yes { background: var(--danger); border-color: var(--danger); color: #fff; }
.res-empty {
  text-align: center; padding: 38px 20px; color: var(--muted);
  background: var(--panel); border: 1px dashed var(--line); border-radius: 16px;
}
.res-empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

@media (max-width: 480px) {
  .res-row { grid-template-columns: 74px 1fr auto; gap: 10px; padding: 12px 14px; }
  .res-time b { font-size: 19px; }
  .res-who b { font-size: 15.5px; }
}

.res-item {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 8px;
}
.res-time { font-weight: 800; color: var(--accent2); min-width: 110px; text-align: center; font-size: .95rem; }
.res-info { flex: 1; min-width: 160px; }
.res-info strong { font-size: 1rem; }
.res-info > div { font-size: .85rem; color: var(--muted); }
.res-price { font-weight: 700; }
.res-actions { display: flex; gap: 6px; }

.hour-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.hour-row strong { width: 100px; }
.hour-row input[type="time"] { width: 110px; margin-top: 0; }
.hour-row .check { margin: 0; }

.block-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  align-items: end;
}
.block-form label { margin: 0; }
.block-form .btn { height: fit-content; }

.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat span { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.stat strong { font-size: 1.35rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: .92rem; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; }

.row { display: flex; gap: 8px; margin-top: 12px; }
.row.wrap { flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(5, 7, 16, .7);
  display: none; place-items: center; z-index: 120; padding: 16px;   /* por encima del dock */
}
.modal.open { display: grid; }
.modal-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px; width: 100%; max-width: 420px;
  max-height: 88vh; overflow-y: auto;
}
.modal-box h3 { margin: 0 0 12px; }

/* Barra de acciones fija al pie del modal (el botón guardar siempre visible) */
.modal-acciones {
  position: sticky;
  bottom: -22px;                 /* pega al borde inferior del modal */
  z-index: 2;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 12px 0 22px;
  margin: 14px -22px -22px;
  box-shadow: 0 -8px 18px rgba(5, 7, 16, .35);
}
.modal-acciones .btn-primary { flex: 1; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: calc(92px + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 80px);
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  padding: 12px 22px; border-radius: 999px; font-size: .92rem;
  opacity: 0; transition: all .3s; z-index: 130; pointer-events: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { border-color: var(--ok); }
#toast.warn { border-color: var(--warn); }
#toast.error { border-color: var(--danger); }

/* Carga y conexión */
.loading { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; }
.loading p { color: var(--muted); text-align: center; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ PANTALLA DE ARRANQUE (splash) ============
   Igualador de 5 barras verdes + marca "+ MÚSICA" abajo. */
.splash {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .45s ease, visibility .45s;
}
.splash.fuera { opacity: 0; visibility: hidden; pointer-events: none; }
.sp-barras {
  display: flex; align-items: center;
  gap: clamp(12px, 3vw, 29px);
  transform: translateY(-4vh);
}
.sp-barras i {
  display: block;
  width: clamp(14px, 4.2vw, 41px);
  height: clamp(74px, 15vh, 205px);
  border-radius: 999px;
  background: var(--accent);
  transform-origin: center;
  animation: sp-barrera 1.1s ease-in-out infinite;
}
.sp-barras i:nth-child(1) { animation-duration: 1.35s; animation-delay: -.15s; }
.sp-barras i:nth-child(2) { animation-duration: 1s;   animation-delay: -.5s; }
.sp-barras i:nth-child(3) { animation-duration: .85s; animation-delay: -.75s; }
.sp-barras i:nth-child(4) { animation-duration: 1.2s; animation-delay: -.3s; }
.sp-barras i:nth-child(5) { animation-duration: .95s; animation-delay: -.6s; }
@keyframes sp-barrera {
  0%, 100% { transform: scaleY(.3); }
  50%      { transform: scaleY(1); }
}
.sp-marca {
  position: absolute; left: 50%; bottom: 8.5%;
  transform: translateX(-50%);
  width: min(47vw, 190px);
}
.sp-marca img { width: 100%; height: auto; display: block; }
@media (prefers-reduced-motion: reduce) {
  .sp-barras i { animation: none; transform: scaleY(.7); }
}

/* Logo según el tema: se muestra una u otra versión (blanca / oscura) */
img.logo-tema-b { display: none; }
:root[data-tema="claro"] img.logo-tema-o { display: none; }
:root[data-tema="claro"] img.logo-tema-b { display: unset; }
@media (prefers-color-scheme: light) {
  :root[data-tema="auto"] img.logo-tema-o { display: none; }
  :root[data-tema="auto"] img.logo-tema-b { display: unset; }
}
.conn-error { max-width: 500px; margin: 60px auto; background: var(--panel); border: 1px solid var(--danger); border-radius: 14px; padding: 24px; }
.conn-error h2 { margin: 0 0 10px; }
.conn-error ol { padding-left: 20px; display: grid; gap: 4px; margin: 10px 0; }
.conn-error code { background: var(--panel2); padding: 2px 7px; border-radius: 6px; }
.conn-error a { color: var(--accent2); }

/* ---------- Vista tipo app (móvil, safe-area) ---------- */
html { -webkit-tap-highlight-color: transparent; }
body { touch-action: manipulation; }
.app-header {
  padding-top: max(8px, env(safe-area-inset-top));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}
main {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}
@media (max-width: 560px) {
  /* Header: logo grande y centrado arriba */
  .app-header {
    gap: 6px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: 8px;
  }
  .brand-logo { width: 150px; }
  .app-header { gap: 12px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .sala-actual { font-size: .76rem; padding: 3px 10px 3px 3px; margin-right: 2px; max-width: 130px; }
  .sala-actual .sala-chip-foto { width: 28px; height: 28px; }
  .header-actions { margin-left: auto; }
  .header-actions { gap: 4px; }
  .header-actions .btn { padding: 7px 9px; font-size: .95rem; white-space: nowrap; }
  .header-actions .txt { display: none; }
  /* La campana en mobile queda como píldora compacta (solo el ícono) */
  .header-actions .btn-notif { height: 40px; padding: 0 12px; }
  .header-actions .btn-notif .notif-txt { display: none; }

  /* Panel y calendario ajustados */
  main { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .panel { padding: 12px; border-radius: 14px; }
  .panel-head { margin-bottom: 12px; gap: 8px; }
  .panel-head h2 { font-size: 1.3rem; }
  .cal-grid { gap: 3px; }
  .cal-h { font-size: .68rem; padding: 2px 0; }
  .cal-day { font-size: .85rem; border-radius: 8px; }
  .cal-day .dot { top: 2px; right: 3px; font-size: .55rem; padding: 0 4px; }
  .cal-nav .btn-sm { padding: 5px 8px; font-size: .8rem; }

  /* Cuadrículas */
  .slots-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .slot { padding: 10px; font-size: .92rem; }
  .rooms-grid { grid-template-columns: 1fr; }
  .room-card { padding: 12px; }
  .res-item { gap: 8px; }
  .res-actions { width: 100%; }
}

/* ---------- Instrumentos y lugar ---------- */
.lugar-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.lugar-tab {
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 10px; padding: 8px 14px; font-size: .9rem;
  transition: background .15s, color .15s;
}
.lugar-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.inst-card {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.inst-card h3 { margin: 0; font-size: 1.05rem; }
.inst-card p { margin: 0; font-size: .9rem; }
.inst-photo {
  height: 130px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
  display: grid; place-items: center;
  border: 1px solid var(--line);
}
.inst-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inst-emoji { font-size: 3rem; }
.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.place-photo {
  margin: 0; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel2);
}
.place-photo img { width: 100%; height: 170px; object-fit: cover; display: block; }
.place-photo figcaption { padding: 10px 12px; font-size: .9rem; color: var(--muted); }

@media (max-width: 560px) {
  .inst-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .inst-photo { height: 100px; }
  .inst-emoji { font-size: 2.4rem; }
  .place-grid { grid-template-columns: 1fr; }
  .place-photo img { height: 140px; }
}

/* ---------- Barra inferior flotante (5 opciones) ---------- */
.dock-container {
  position: fixed;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 14px; right: 14px;
  max-width: 440px;
  margin: 0 auto;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transition: transform .34s cubic-bezier(.22, .9, .28, 1), opacity .26s ease, visibility 0s linear .34s;
}
.dock-container[hidden] { display: none; }
/* Al abrir el panel de notificaciones o de ajustes la barra inferior se oculta y vuelve al cerrar */
#notif-drop.open ~ .dock-container, #ajustes-drop.open ~ .dock-container {
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(100% + 30px));
  transition: transform .34s cubic-bezier(.22, .9, .28, 1), opacity .26s ease, visibility 0s linear 0s;
}
.bottom-nav {
  pointer-events: auto;
  width: 100%;
  height: 64px;
  background: var(--pop);
  backdrop-filter: blur(12px);
  border-radius: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  position: relative;
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 10px; font-weight: 600; gap: 2px; height: 100%;
  letter-spacing: .2px;
  transition: color .15s ease, transform .1s ease;
}
.nav-btn:active { transform: scale(.93); }
.nav-btn.active { color: var(--accent2); font-weight: 700; }
.nav-btn.active svg { color: var(--accent2); }

/* Botón central elevado (Reservar) */
.nav-btn-center {
  position: relative; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 6px; border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 10px; font-weight: 600; letter-spacing: .2px;
}
.nav-circle-btn {
  position: absolute; top: -22px;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent);
  border: 4px solid var(--bg);
  box-shadow: 0 6px 20px rgba(0, 160, 56, .45);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), background .15s ease;
}
.nav-btn-center:active .nav-circle-btn { transform: scale(.92); }
.nav-btn-center.active .nav-circle-btn { background: #00a038; box-shadow: 0 8px 24px rgba(0, 160, 56, .6); }
.nav-btn-center.active { color: var(--accent2); font-weight: 700; }
.nav-center-label { position: relative; z-index: 1; }

.home-indicator {
  width: 120px; height: 4px;
  background: var(--line); border-radius: 9999px; margin-top: 8px;
}

/* En el Mapa (celular) la barra de 5 opciones va transparente: los íconos
   flotan sobre el mapa, sin cápsula de fondo. En escritorio el riel no cambia. */
@media (max-width: 699px) {
  body.nav-mapa .bottom-nav {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.nav-mapa .nav-btn,
  body.nav-mapa .nav-btn-center { text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
  body.nav-mapa .nav-btn svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55)); }
  body.nav-mapa .nav-circle-btn { border-color: transparent; }
  body.nav-mapa .home-indicator { background: transparent; }
}

/* ---------- Visor de fotos (arrastrar / zoom) ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 10, 20, .97);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  touch-action: none;
}
.viewer-img {
  max-width: 94vw; max-height: 72vh;
  object-fit: contain;
  cursor: grab;
  user-select: none; -webkit-user-drag: none;
  will-change: transform;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 12px 40px rgba(0, 0, 0, .6);
}
.viewer-img.grabbing { cursor: grabbing; }
.viewer-close {
  position: absolute; top: max(14px, env(safe-area-inset-top)); right: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; font-size: 1.1rem; line-height: 1;
}
.viewer-controls { display: flex; gap: 10px; }
.viewer-controls .btn { min-width: 52px; padding: 10px 12px; font-size: 1.1rem; }
.viewer-hint { color: var(--muted); font-size: .82rem; text-align: center; margin: 0; max-width: 420px; }

/* ---------- Bandas ---------- */
.band-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto;
  background: var(--panel);
  border: 2px solid var(--soft);
  display: grid; place-items: center;
  overflow: hidden;
}
.band-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.band-emoji { font-size: 1.15rem; }
.band-avatar-lg { width: 48px; height: 48px; font-size: 1.4rem; }

/* Franja superior de la reserva: logo + nombre de la banda */
.mine-band {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 160, 56, .22), rgba(34, 197, 94, .12));
}
.mine-band-info { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mine-band-info strong { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tarjeta de reserva con cabecera vertical de la banda (estilo Más Fútbol) */
.mine-card {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}
.mine-card-top {
  position: relative;
  height: 155px;                      /* formato vertical, como la foto de referencia */
  background: linear-gradient(135deg, var(--panel2), var(--panel));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.mine-card-top img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.mine-card-top::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6, 8, 18, .9) 0%, rgba(6, 8, 18, .35) 55%, rgba(6, 8, 18, .05) 100%);
}
.mine-card-top.sin-foto .band-emoji { font-size: 2.6rem; position: relative; z-index: 1; opacity: .85; }
.mine-card-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 12px 14px;
  color: #fff;
  display: flex; align-items: center; gap: 10px;
}
.mine-card-info strong {
  display: block; font-size: 1.2rem; line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .7);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mine-card-info span { font-size: .84rem; opacity: .92; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.mine-card-body { padding: 12px 14px; display: grid; gap: 6px; }
.mine-card.res-past .mine-card-top { filter: saturate(.5) brightness(.75); }

/* Selector de banda en la confirmación */
.band-picker {
  display: grid; gap: 10px;
  padding: 12px; margin-bottom: 14px;
  border: 1px dashed var(--line); border-radius: 14px;
  background: var(--tinte);
}
.band-preview { display: flex; align-items: center; gap: 10px; }
.lbl-band { margin: 0; }

/* Lista de bandas en el admin */
.band-admin-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  flex-wrap: wrap;
}
.band-admin-item .res-info { flex: 1; min-width: 160px; }

/* Recortador de foto: encuadre fijo (cuadrado para el logo, horizontal para la grupal) */
.crop-host { display: grid; justify-items: center; gap: 10px; margin-bottom: 14px; }
.crop-frame {
  position: relative;
  width: 216px;
  aspect-ratio: 3 / 4;                 /* formato vertical */
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-deep);
  border: 2px solid var(--line);
  touch-action: none;                   /* permite arrastrar con el dedo */
  cursor: grab;
}
.crop-frame:active { cursor: grabbing; }
.crop-canvas { width: 100%; height: 100%; display: block; }
.crop-frame.ancho { width: 100%; max-width: 340px; }
/* El logo se encuadra en círculo (igual que se ve en el perfil) */
.crop-frame.circulo { border-radius: 50%; border-width: 3px; border-color: rgba(255, 255, 255, .22); }
.crop-frame.circulo .crop-grid {
  background-size: 33.34% 33.34%;
  border-radius: 50%;
}
.crop-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .18) 1px, transparent 1px);
  background-size: 33.34% 33.34%;
}
.crop-empty {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center;
  color: var(--muted); font-size: .85rem; text-align: center;
  padding: 12px; line-height: 1.6;
}
.crop-controls { display: flex; gap: 8px; }
.crop-controls .btn { min-width: 50px; padding: 8px 10px; font-size: 1.05rem; }
.crop-hint { text-align: center; margin: 0; }

/* Integrantes (formulario de banda) */
.miembros {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
  background: var(--tinte);
}
.miembros-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.miembros-head .muted { font-weight: 400; }
.miembros > p { margin: 4px 0 0; }
.miembro-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.miembro-row input { margin: 0; }

/* Perfil de la banda */
.perfil { text-align: center; }
.perfil-foto {
  width: 132px; height: 176px;          /* formato vertical 3:4 */
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid var(--line);
  margin: 0 auto 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
}
.perfil-sin-foto { font-size: 3rem; }
.perfil h3 { margin: 0 0 8px; font-size: 1.3rem; }
.perfil .sub { text-align: left; margin: 14px 0 8px; }
.perfil-tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.tag {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px;
  font-size: .82rem; color: var(--muted);
}
.perfil-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.perfil-lista li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px;
}
.perfil-lista li span { color: var(--muted); font-size: .9rem; }
.perfil-lista li.perfil-mas {
  background: rgba(0, 160, 56, .12);
  border-style: dashed;
  justify-content: center;
}
.perfil-lista li.perfil-mas strong { color: var(--accent2); }
.mine-card-top[data-band], .band-preview[data-band] { cursor: pointer; }
.mine-card-top[data-band]:hover .mine-card-info strong { text-decoration: underline; }

/* Mis reservas (en el inicio y al reservar) */
.mine-quick { margin-bottom: 14px; }
.buscador-mine { display: block; margin-bottom: 10px; font-size: .85rem; color: var(--muted); }
.buscador-mine input { margin-top: 4px; }
.quick-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; flex: 0 0 auto;
  border: 2px solid var(--soft);
  cursor: zoom-in;
}
.quick-item .btn { flex: 0 0 auto; }
.quick-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  flex-wrap: wrap;
}
.quick-item:last-child { margin-bottom: 0; }
.quick-item[data-band] { cursor: pointer; }
.quick-when, .quick-what { display: flex; flex-direction: column; line-height: 1.35; }
.quick-what { text-align: right; align-items: flex-end; }
.quick-what strong { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.quick-item.res-past { opacity: .6; }

/* Perfil dentro de Mis reservas: logo arriba y datos ordenados debajo */
.perfil-mini {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 10px;
  overflow: hidden;
}
.perfil-mini-info { width: 100%; position: relative; z-index: 1; }
.perfil-mini-info h3 { margin: 2px 0 10px; font-size: 1.35rem; }
.perfil-mini-info .perfil-tags { justify-content: center; margin-bottom: 14px; }
.perfil-mini-info .perfil-lista { margin-bottom: 12px; max-width: 460px; margin-left: auto; margin-right: auto; }
.perfil-sub { text-align: center; margin: 0 0 8px; }
.perfil-vacio { text-align: center; margin: 0 0 12px; }
.perfil-acciones { justify-content: center; }

/* Logo de la banda: circular y SIN recortar (se ve completo) */
.perfil-avatar-circular {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: contain;              /* nada se corta */
  padding: 3px;
  border: 2px solid var(--soft);
  background: radial-gradient(circle at 50% 40%, var(--line), var(--bg-deep));
  display: grid; place-items: center;
  flex: 0 0 auto;
  position: relative; z-index: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  cursor: zoom-in;
}
.perfil-avatar-circular.grande { width: 112px; height: 112px; margin: 0 auto 10px; }
.perfil-avatar-circular.sm { width: 44px; height: 44px; padding: 2px; border-width: 1px; }
.perfil-avatar-circular.perfil-sin-foto { font-size: 2rem; cursor: default; }
.perfil-avatar-circular.grande.perfil-sin-foto { font-size: 2.6rem; }

/* Foto grupal horizontal: recubre todo el cuadro, sin tapar los botones */
.perfil-fondo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;                 /* llena todo el cuadro */
  object-position: center;
  opacity: .28;
  pointer-events: none;
  z-index: 0;
}
.perfil { position: relative; overflow: hidden; }
.perfil > *:not(.perfil-fondo) { position: relative; z-index: 1; }

/* Foto grupal en la tarjeta de reserva */
.mine-fondo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: .45; }
.mine-card-txt { min-width: 0; }
.mine-card-txt strong { display: block; }

/* Sección de foto grupal en el formulario */
.grupo-foto {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
  background: var(--tinte);
}
.grupo-foto .miembros-head { margin-bottom: 8px; }
.crop-titulo { margin: 0 0 8px; font-weight: 700; font-size: .95rem; text-align: center; }
.band-mini-grupo {
  width: 56px; height: 40px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line); flex: 0 0 auto;
}

/* Alquiler de instrumentos */
.tag-alquiler {
  align-self: flex-start;
  background: rgba(245, 165, 36, .16);
  border-color: rgba(245, 165, 36, .45);
  color: var(--warn);
  margin-top: 2px;
}
.alquiler-precio {
  font-size: 1.3rem; font-weight: 800; color: var(--accent2);
  margin-top: auto;
}
.alquiler-precio span { font-size: .8rem; color: var(--muted); font-weight: 400; }
.alquiler-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px; margin-bottom: 14px;
  background: var(--tinte);
}
.alquiler-box-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.alquiler-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 6px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.alquiler-item:last-of-type { margin-bottom: 0; }
.alquiler-item:hover { border-color: var(--accent); }
.alquiler-item input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); }
.alquiler-item-name { flex: 1; min-width: 0; }
.alquiler-item-price { color: var(--accent2); font-weight: 700; font-size: .9rem; }
.alquiler-confirmado {
  margin: 10px 0; padding: 10px 12px;
  border: 1px dashed var(--line); border-radius: 12px;
  text-align: left;
}
.alquiler-confirmado strong { display: block; margin-bottom: 4px; font-size: .95rem; }

/* En pantallas bajas el marco se achica para que todo entre en el modal */
@media (max-height: 760px) {
  .crop-frame { width: 170px; }
  .crop-frame.ancho { width: 100%; max-width: 260px; }
}

@media (max-width: 560px) {
  .band-avatar { width: 34px; height: 34px; }
  .mine-band { padding: 8px 10px; }
}

/* ================= ACCESO / REGISTRO ================= */
#view-auth {
  padding: 18px 16px 40px;
  min-height: 100%;
  align-items: flex-start;
}
.auth-wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
@keyframes authIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.auth-logo { width: min(230px, 70vw); margin: 6px auto 18px; object-fit: contain; align-self: center; }
.auth-titulo { display: flex; flex-direction: column; gap: 10px; }
.auth-title { margin: 0; text-align: left; font-size: clamp(2.1rem, 11vw, 2.9rem); line-height: .98; }
.auth-sub { margin: 6px 0 0; font-size: 16px; line-height: 1.4; font-weight: 500; color: var(--muted); }

/* Tarjeta contenedora de cada paso */
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 18px 20px;
  box-shadow: var(--sombra);
  animation: authIn .26s ease both;
}

/* Botones grandes para elegir el perfil */
.auth-roles { display: flex; flex-direction: column; gap: 14px; margin: 20px 0 16px; }
.auth-rol {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel2); border: 2px solid transparent;
  border-radius: 18px; padding: 16px; cursor: pointer;
  color: var(--text); text-align: left;
  transition: transform .12s, filter .15s, border-color .15s;
}
.auth-rol:hover { transform: translateY(-2px); filter: brightness(1.08); }
.auth-rol-fijo {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--on-accent); border-color: transparent;
  box-shadow: 0 8px 22px rgba(0, 160, 56, .35);
}
.auth-rol-lar { border-color: var(--line); }
.auth-rol-lar:hover { border-color: var(--accent); }
.auth-rol-ic { width: 52px; height: 52px; flex: none; border-radius: 15px; display: grid; place-items: center; background: var(--soft2); }
.auth-rol-fijo .auth-rol-ic { background: rgba(11, 21, 34, .16); }
.auth-rol-lar .auth-rol-ic { background: var(--tinte); }
.auth-rol-ic svg { width: 28px; height: 28px; }
.auth-rol-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.auth-rol strong { font-size: 1.18rem; font-weight: 700; }
.auth-rol-txt > span { font-size: .9rem; line-height: 1.35; font-weight: 500; color: var(--muted); }
.auth-rol-fijo strong { color: var(--on-accent); }
.auth-rol-fijo .auth-rol-txt > span { color: rgba(11, 21, 34, .78); font-weight: 600; }
.auth-rol-go { font-size: 1.7rem; line-height: 1; opacity: .5; flex: none; }
.auth-cuenta { margin: 6px 0 4px; text-align: center; font-size: 1rem; font-weight: 500; color: var(--muted); }
.auth-redes { margin-top: 14px; text-align: center; }
.auth-link {
  background: none; border: none; padding: 10px 4px;
  color: var(--accent2); font-size: 1rem; font-weight: 700;
}
.auth-link:hover { text-decoration: underline; }
.auth-div {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: .8rem; margin: 6px 0 14px;
}
.auth-div::before, .auth-div::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-volver { align-self: flex-start; margin-bottom: 10px; }
.auth-nota { margin-top: 14px; }

/* Botones de contacto en la pantalla de ayuda */
.auth-ayuda-contacto { gap: 8px; }
.auth-ayuda-contacto .btn {
  background: var(--panel2); border: 1.5px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 8px 14px; text-decoration: none;
}
.auth-ayuda-contacto .btn:hover { border-color: var(--accent); color: var(--accent); }

/* Panel de pedidos de ayuda (administración) */
.ayuda-item { margin-bottom: 10px; }
.ayuda-item.ayuda-resuelta { opacity: .6; }
.ayuda-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ayuda-msj { font-style: italic; opacity: .8; }

/* Formularios */
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.auth-form .check { margin: 0; }

/* Campos con validación */
.campo { display: block; margin: 0; }
.campo-lbl { display: block; font-size: .85rem; font-weight: 600; color: var(--label); margin-bottom: 6px; letter-spacing: .2px; }
.campo-lbl .req { color: var(--danger); }
.campo input, .campo textarea, .campo select {
  width: 100%; margin-top: 0;
  background: var(--panel2); border: 1.5px solid var(--line); border-radius: 12px;
  color: var(--text); padding: 12px 13px; font-size: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
.campo textarea { resize: vertical; }
.campo input::placeholder, .campo textarea::placeholder { color: var(--label); opacity: .7; }
.campo input:focus, .campo textarea:focus, .campo select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 160, 56, .22);
}
.campo.error input, .campo.error textarea { border-color: var(--danger); }
.campo.error input:focus, .campo.error textarea:focus { box-shadow: 0 0 0 3px rgba(229, 72, 77, .22); }
.campo.ok input, .campo.ok textarea { border-color: var(--ok); }
.campo-msg { display: none; font-size: .82rem; font-weight: 600; margin-top: 6px; }
.campo.error .campo-msg { display: block; color: var(--danger); }
.campo.ok .campo-msg { display: block; color: var(--ok); }
.campo.ok .campo-msg::before { content: '✓ '; }
.campo.checking .campo-msg { display: block; color: var(--muted); }

/* Contraseña: mostrar / ocultar */
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 46px; }
.pass-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 8px; font-size: 1.05rem; line-height: 1;
  color: var(--muted); border-radius: 8px;
}
.pass-eye:hover { background: var(--soft2); }

/* Medidor de fuerza de la contraseña */
.fuerza { display: flex; align-items: center; gap: 5px; margin-top: 7px; }
.fuerza i { flex: 1 1 0; height: 4px; border-radius: 999px; background: var(--line); transition: background .2s; }
.fuerza[data-n="1"] i:nth-child(-n+1) { background: var(--danger); }
.fuerza[data-n="2"] i:nth-child(-n+2) { background: var(--warn); }
.fuerza[data-n="3"] i:nth-child(-n+3) { background: var(--accent2); }
.fuerza[data-n="4"] i { background: var(--ok); }
.fuerza-txt { margin-left: 6px; font-size: .76rem; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* Foto de perfil / logo */
.auth-foto { display: flex; align-items: center; gap: 14px; }
.auth-foto .sala-foto-edit { margin: 0; }
.auth-foto-txt { display: flex; flex-direction: column; gap: 4px; }

/* Botón grande de envío */
.btn-lg { padding: 14px; font-size: 1.05rem; border-radius: 12px; }

.center { text-align: center; }
.dias-sel { display: flex; flex-wrap: wrap; gap: 10px; }
.dias-sel .check { margin: 0; }
.btn-block { width: 100%; }

/* ================= MI CUENTA / PERFIL ================= */
.user-card { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.user-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
  display: grid; place-items: center;
  font-size: 1.6rem; font-weight: 800; color: var(--accent2);
  border: 2px solid var(--line); overflow: hidden; flex: 0 0 auto;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-datos { display: flex; flex-direction: column; gap: 2px; font-size: .92rem; }
.user-datos strong { font-size: 1.05rem; }

.mini-fotos { display: flex; flex-wrap: wrap; gap: 10px; }
.mini-foto { position: relative; }
.mini-foto img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; display: block; }
.mini-foto button { position: absolute; top: 4px; right: 4px; font-size: .68rem; padding: 2px 6px; }

.fav-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px 10px 6px 6px; cursor: pointer;
  color: var(--text); text-align: left;
}
.fav-item:hover { border-color: var(--accent); }
.fav-item img, .fav-item .sala-chip-foto { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.fav-item span { display: flex; flex-direction: column; font-size: .82rem; font-weight: 700; }
.fav-item small { font-weight: 500; color: var(--muted); }

.notif {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--panel2); border: 1px solid var(--line);
  border-left: 3px solid var(--line); border-radius: 10px;
}
.notif.nueva { border-left-color: var(--accent); background: rgba(0, 160, 56, .1); }
.notif strong { font-size: .92rem; }
.notif span { font-size: .86rem; }
.notif small { font-size: .72rem; }

.badge-notif {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff;
  font-size: .66rem; font-weight: 800;
  border-radius: 999px; padding: 2px 6px; min-width: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.btn-icono { position: relative; }

/* ================= CAMPANA DE NOTIFICACIONES (píldora estilo app) ================= */
.btn-notif {
  position: relative; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px 0 14px;
  border-radius: 999px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text); font-weight: 700; font-size: .9rem;
  cursor: pointer; white-space: nowrap;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s, transform .12s;
}
.btn-notif:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-notif:active { transform: scale(.94); }
.notif-svg {
  width: 19px; height: 19px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 2.1;
  stroke-linecap: round; stroke-linejoin: round;
}
.notif-txt { line-height: 1; }
.btn-notif .badge-notif { top: -6px; right: -6px; border: 2px solid var(--hdr); }
/* Logo de Instagram en la cabecera: chip redondo con el isologotipo real, a juego con el diseño */
.btn-ig {
  position: relative; flex: 0 0 auto;
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--panel2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.btn-ig svg { width: 25px; height: 25px; display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); }
.btn-ig:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: 0 4px 14px rgba(0, 160, 56, .28); }
.btn-ig:active { transform: scale(.94); }
/* Con avisos sin leer: acento verde de la app + campana que se sacude */
.btn-notif.tiene-nuevas {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 160, 56, .09);
  box-shadow: 0 0 0 3px rgba(0, 160, 56, .15), 0 4px 16px rgba(0, 160, 56, .35);
}
.btn-notif.tiene-nuevas .notif-svg { animation: notif-sacudida 2.8s ease-in-out infinite; transform-origin: 50% 4px; }
@keyframes notif-sacudida {
  0%, 58%, 100% { transform: rotate(0); }
  62% { transform: rotate(14deg); }
  67% { transform: rotate(-12deg); }
  72% { transform: rotate(8deg); }
  77% { transform: rotate(-5deg); }
  82% { transform: rotate(0); }
}

/* ================= PANEL DE NOTIFICACIONES / AJUSTES (desde arriba) ================= */
#notif-drop, #ajustes-drop {
  position: fixed; inset: 0; z-index: 85;
  visibility: hidden; pointer-events: none;
}
#notif-drop.open, #ajustes-drop.open { visibility: visible; pointer-events: auto; }
#notif-backdrop, #ajustes-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 12, 24, .55);
  opacity: 0; transition: opacity .3s;
}
#notif-drop.open #notif-backdrop, #ajustes-drop.open #ajustes-backdrop { opacity: 1; }
.notif-sheet {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--pop);
  transform: translateY(-102%);
  transition: transform .38s cubic-bezier(.22, .9, .28, 1);
}
#notif-drop.open .notif-sheet, #ajustes-drop.open .notif-sheet { transform: translateY(0); }
.notif-sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--pop);
}
.notif-sheet-head h3 {
  margin: 0; font-size: 1.35rem; line-height: 1.05;
  text-transform: uppercase; font-style: italic; font-weight: 800;
}
.notif-sheet-head p { margin: 4px 0 0; }
.notif-sheet-tools { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.notif-cerrar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--panel2); border: 1px solid var(--line);
  color: var(--muted); font-size: 1rem; cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s, color .15s, transform .12s;
}
.notif-cerrar:hover { color: var(--text); background: var(--soft); }
.notif-cerrar:active { transform: scale(.9); }
.notif-sheet-body {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 16px 22px;
  -webkit-overflow-scrolling: touch;
}
.notif-sec { margin: 8px 0 16px; }
.notif-sec h4 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 8px; font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
}
.notif-sec h4 .n {
  background: var(--soft2); color: var(--text);
  border-radius: 999px; padding: 1px 8px; font-size: .72rem; letter-spacing: 0;
}
.notif-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
  position: relative; padding-right: 30px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.notif-item:hover { border-color: var(--accent); }
.notif-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.notif-flecha {
  flex: 0 0 auto; align-self: center; width: 16px; height: 16px;
  color: var(--label);
  transition: color .15s, transform .15s;
}
.notif-item:hover .notif-flecha { color: var(--accent); transform: translateX(2px); }
.notif-item:hover .notif-txt strong { color: var(--accent2); }
.notif-item.nueva {
  border-left-color: var(--accent);
  background: rgba(0, 160, 56, .07);
}
.notif-item.nueva::after {
  content: ''; position: absolute; top: 14px; right: 12px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 160, 56, .22);
}
.notif-chip {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .95rem; font-weight: 900;
}
.notif-chip.ok { background: rgba(0, 160, 56, .16); color: var(--ok); }
.notif-chip.warn { background: rgba(229, 72, 77, .14); color: var(--danger); }
.notif-chip.info { background: rgba(47, 125, 225, .16); color: var(--accent2); }
.notif-txt { min-width: 0; flex: 1; }
.notif-txt strong { display: block; font-size: .95rem; line-height: 1.2; }
.notif-txt span { display: block; color: var(--muted); font-size: .84rem; margin-top: 2px; line-height: 1.35; }
.notif-txt small { color: var(--label); font-size: .74rem; }
.notif-vacio {
  text-align: center; padding: 36px 20px; color: var(--muted);
  background: var(--panel); border: 1px dashed var(--line); border-radius: 16px;
}
.notif-vacio b { display: block; color: var(--text); font-size: 1rem; margin-bottom: 4px; }

/* Tarjeta de reserva resaltada al llegar desde una notificación */
.res-destacada {
  outline: 2px solid var(--accent); outline-offset: 1px;
  box-shadow: 0 0 0 4px rgba(0, 160, 56, .18);
  transition: box-shadow .3s, outline-color .3s;
}

/* ================= AJUSTES (perfil) ================= */
.aj-cuenta {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; margin-bottom: 4px;
}
.aj-avatar {
  width: 64px; height: 64px;
  background: var(--accent); border-color: var(--accent);
  color: var(--on-accent); font-size: 1.7rem;
}
.aj-cuenta-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.aj-cuenta-txt > strong { font-size: 1.2rem; font-weight: 700; }
.aj-cuenta-txt > span { font-size: .88rem; font-weight: 500; color: var(--muted); }
.aj-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.aj-badges .badge { font-size: .7rem; }
.aj-editar {
  align-self: flex-start; margin-top: 5px;
  background: none; border: none; padding: 6px 0;
  color: var(--accent2); font-size: .95rem; font-weight: 700; cursor: pointer;
}
.aj-editar:hover { text-decoration: underline; }

.aj-lbl {
  margin: 20px 0 8px 4px;
  font-size: .8rem; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--label);
}
.aj-card {
  display: flex; flex-direction: column;
  background: var(--pop); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden;
}
.aj-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 56px; padding: 10px 16px;
  background: none; border: none; border-top: 1px solid var(--line);
  color: var(--text); font-family: inherit; font-size: 1rem; font-weight: 600;
  text-align: left; cursor: pointer;
}
.aj-row:first-child { border-top: none; }
.aj-row:hover { background: rgba(0, 160, 56, .08); }
.aj-ico { color: var(--accent); flex: none; }
.aj-chev { color: var(--label); flex: none; margin-left: auto; }
.aj-txt { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.aj-txt small { font-size: .82rem; font-weight: 500; color: var(--muted); word-break: break-word; }
.aj-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; cursor: pointer; }
.aj-apariencia { flex-wrap: wrap; cursor: default; }
.aj-apariencia:hover { background: none; }
.aj-seg { display: flex; gap: 8px; width: 100%; padding-left: 36px; }
#aj-apariencia-admin { padding-left: 0; }
.aj-seg button {
  flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--text);
  font-family: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
}
.aj-seg button:hover { border-color: var(--accent); }
.aj-seg button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* Filas informativas (datos del usuario, sin chevron ni hover) */
.aj-row.aj-dato { cursor: default; }
.aj-row.aj-dato:hover { background: none; }
.aj-row.aj-dato .aj-ico { color: var(--label); opacity: .85; }
.aj-row .aj-valor { margin-left: auto; font-size: .95rem; font-weight: 700; color: var(--text); }
.aj-salir {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 52px; margin-top: 20px;
  background: none; border: 2px solid var(--salmon); border-radius: 16px;
  color: var(--salmon); font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
}
.aj-salir:hover { background: rgba(255, 155, 143, .12); }
.aj-salir .aj-ico { color: var(--salmon); }

/* Aviso del filtro de Mis reservas (Próximas / Historial) */
.filtro-aviso {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(0, 160, 56, .1); border: 1px solid rgba(0, 160, 56, .4);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 12px;
  font-size: .9rem; color: var(--text);
}
.filtro-aviso strong { color: var(--accent2); }
.filtro-aviso .btn { margin-left: auto; }

/* Ayuda y términos (modales de Ajustes) */
.ayuda-lista { margin: 0 0 14px; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: .93rem; }
.terminos p { margin: 0 0 10px; font-size: .92rem; color: var(--muted); }
.terminos strong { color: var(--text); }

/* Tarjeta resumen de la cuenta madre (Ajustes del panel de administración) */
#cm-resumen {
  display: flex; gap: 12px; align-items: center;
  background: linear-gradient(135deg, rgba(0, 160, 56, .12), transparent 65%), var(--panel2);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px;
}
.cm-ava {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--accent); color: var(--on-accent); font-size: 1.4rem;
}
.cm-ava img { width: 100%; height: 100%; object-fit: cover; }
.cm-datos { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-datos strong { font-size: 1.02rem; }
.cm-datos .muted.small { font-size: .78rem; }
.cm-badge {
  align-self: flex-start;
  font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  background: rgba(0, 160, 56, .16); border: 1px solid rgba(0, 160, 56, .4);
  color: var(--ok2); border-radius: 999px; padding: 2px 9px;
}

/* ================= FAVORITAS EN LA TARJETA ================= */
.room-top { position: relative; }
.fav-btn {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(10, 18, 32, .72); border: 1px solid var(--line);
  color: #fff; font-size: 1rem; line-height: 1; cursor: pointer;
  backdrop-filter: blur(4px);
}
.fav-btn.on { color: #ff9b8f; border-color: #ff9b8f; }
.room-ubic { font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.room-equip { font-size: .78rem; color: var(--accent2); margin: 6px 0; }

/* ================= FICHA DE LA SALA ================= */
.ficha-logo {
  width: 96px; height: 96px; border-radius: 20px; object-fit: cover;
  margin: 0 auto 12px; display: block; border: 2px solid var(--line);
}
.ficha-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.ficha-grid > div {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 10px;
  display: flex; flex-direction: column; font-size: .9rem;
}
.ficha-dir, .ficha-desc { font-size: .88rem; color: var(--muted); }
.ficha-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; font-size: .76rem; color: var(--muted);
}
.chip-alt { border-color: var(--accent); color: var(--accent2); }
.dia-fila, .hora-fila {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: .88rem;
  border-bottom: 1px solid var(--line);
}
.dia-fila strong { min-width: 130px; font-weight: 600; }
.dia-fila span { color: var(--muted); }
.hora-fila strong { min-width: 110px; }
.hora-fila .check { margin: 0 6px 0 0; }
.dias-fila { margin-bottom: 10px; }

/* ================= SOLICITUDES DE SALAS ================= */
.pill {
  background: var(--accent); color: #fff;
  border-radius: 999px; padding: 0 6px; font-size: .7rem; font-weight: 800;
}
.sol-card {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; margin-bottom: 12px;
}
.sol-card.pendiente { border-color: #d9a441; }
.sol-card.rechazada, .sol-card.suspendida { opacity: .85; }
.sol-top { display: flex; gap: 12px; align-items: flex-start; }
.sol-logo {
  width: 56px; height: 56px; border-radius: 14px; object-fit: cover;
  background: var(--panel); flex: 0 0 auto; border: 1px solid var(--line);
}
.sol-logo.sin-foto { display: grid; place-items: center; font-size: 1.4rem; }
.sol-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.sol-desc { font-size: .86rem; color: var(--muted); margin: 8px 0; }

/* ================= CUENTAS ================= */
.tabla { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tabla th, .tabla td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabla th { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .4px; }
.acciones-td { display: flex; flex-wrap: wrap; gap: 6px; }

/* ================= PANEL DEL DUE�O ================= */
#view-panel { padding: 12px 14px 30px; }
.panel-estado { margin-bottom: 12px; }
.hora-fila input[type=time] { width: auto; }
.res-item.cancelada, .quick-item.cancelada { opacity: .6; text-decoration: line-through; }

@media (max-width: 480px) {
  .ficha-grid { grid-template-columns: 1fr; }
  .sol-top { flex-wrap: wrap; }
  .dia-fila strong, .hora-fila strong { min-width: 88px; }
}
/* ================= MAPA ================= */
#mapa {
  width: 100%;
  height: 62vh;
  min-height: 320px;
  max-height: 560px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
}
#mapa-picker {
  width: 100%;
  height: 300px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.leaflet-container { font: inherit; background: var(--bg); }
/* En tema oscuro, el mapa (OpenStreetMap) se oscurece sin cambiar de proveedor */
:root[data-tema="oscuro"] .leaflet-tile-pane,
:root[data-tema="auto"] .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.9) saturate(.7);
}
@media (prefers-color-scheme: light) {
  :root[data-tema="auto"] .leaflet-tile-pane { filter: none; }
}
.leaflet-popup-content-wrapper {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
.leaflet-popup-content { margin: 12px 14px; }
.leaflet-popup-tip { background: var(--panel); border: 1px solid var(--line); }
.leaflet-popup-close-button { color: var(--muted) !important; }
.leaflet-control-attribution {
  background: var(--hdr) !important;
  color: var(--muted) !important;
  font-size: 9px;
}
.leaflet-control-attribution a { color: var(--accent2) !important; }
.leaflet-bar a { background: var(--panel) !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-bar a:hover { background: var(--panel2) !important; }

/* ---------- Google Maps (cuando se carga una clave en Ajustes) ---------- */
/* El popup es el mismo que en OpenStreetMap: sólo cambia la "cápsula" que dibuja Google */
#mapa .gm-style-iw-c {
  background: var(--panel) !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5) !important;
  padding: 10px 12px !important;
  color: var(--text) !important;
}
#mapa .gm-style-iw-d {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: auto !important;
  overflow: visible !important;
  color: var(--text) !important;
}
#mapa div[class*="gm-style-iw-t"] { background: var(--panel) !important; border-color: var(--panel) !important; }
#mapa img.gm-ui-hover-effect { filter: invert(1) !important; opacity: .75 !important; }
#mapa img.gm-ui-hover-effect:hover { opacity: 1 !important; }
#mapa .gm-style-iw .pop-detalle { color: var(--text); }

/* Marcadores con el logo de la sala */
.mk-wrap { background: transparent; border: none; }
.mk-sala {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
  border: 2px solid var(--accent);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5), 0 0 0 2px rgba(255, 255, 255, .85);
  display: grid; place-items: center; overflow: hidden;
  font-size: .9rem;
  transition: transform .15s;
}
.mk-sala img { width: 100%; height: 100%; object-fit: cover; }
.mk-sala:hover { transform: scale(1.12); }
/* Sala sin logo propio: círculo verde con el logo de Más Música en negro */
.mk-sala.mk-marca { background: var(--accent); border-color: var(--accent); }
.mk-sala.mk-marca img { width: 16px; height: 16px; object-fit: contain; }
.mk-res {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  display: grid; place-items: center; font-size: .72rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
}
/* Tu ubicación: círculo verde con el logo de Más Música en negro */
.mk-yo {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
}
.mk-yo img { width: 14px; height: 14px; object-fit: contain; display: block; }

/* Contenido del popup */
.pop { display: flex; flex-direction: column; gap: 3px; min-width: 190px; max-width: 240px; }
.pop-logo {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  margin-bottom: 4px; border: 1px solid var(--line);
}
.pop-logo.sin-foto, .pop-logo.res {
  display: grid; place-items: center; font-size: 1.3rem;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
}
.pop-logo.res { background: var(--accent); border-color: #fff; }
.pop strong { font-size: .95rem; }
.pop .badge { align-self: flex-start; margin-top: 4px; }
.pop-acciones { gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* Popup con el detalle de la sala: foto horizontal, logo, dirección y teléfono */
.pop-detalle { gap: 0; min-width: 232px; max-width: 266px; padding-bottom: 2px; }
.pop-cover { position: relative; margin-bottom: 4px; }
.pop-cover-img {
  display: block; width: 100%; height: 116px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line);
  cursor: zoom-in; background: var(--panel2);
}
.pop-cover-chica .pop-cover-img { height: 74px; }
.pop-cover.sin-foto::before {
  content: '🎸'; display: grid; place-items: center;
  height: 92px; font-size: 1.8rem; border-radius: 10px;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
}
.pop-detalle .pop-logo {
  position: absolute; left: 8px; bottom: -16px;
  width: 48px; height: 48px; margin: 0;
  border-radius: 50%; border: 2px solid var(--panel);
  object-fit: cover; background: var(--panel2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}
.pop-detalle .pop-logo.sin-foto {
  display: grid; place-items: center; font-size: 1.3rem;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
}
.pop-datos { display: flex; flex-direction: column; gap: 3px; padding-top: 6px; }
.pop-nombre { font-size: 1rem; line-height: 1.2; margin-left: 4px; }
.pop-linea { display: flex; align-items: center; gap: 4px; font-size: .85rem; line-height: 1.3; }
.pop-linea.muted { color: var(--muted); }
.pop-tel { color: var(--accent2); font-weight: 600; text-decoration: none; }
.pop-tel:hover { text-decoration: underline; }
.pop-acciones a.btn { text-decoration: none; }
.mapa-acciones { margin: 10px 0; align-items: center; }
.mapa-ayuda { margin: 10px 0 0; }

/* ---------- Lista de salas junto al mapa ---------- */
.mapa-lista { margin-top: 16px; }
.mapa-lista .sub { margin: 0 0 10px; }
.mapa-lista-items { display: grid; gap: 10px; grid-template-columns: 1fr; }
/* Encabezado de la lista: título + controles ‹ › (los controles son solo de escritorio) */
.mapa-lista-head { margin: 0 0 10px; }
.mapa-lista-head .sub { margin: 0; }
.mapa-lista-ctrl { display: none; }
.mapa-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
  transition: border-color .15s, transform .15s;
}
.mapa-item[data-mapa-item] { cursor: pointer; }
.mapa-item[data-mapa-item]:hover { border-color: var(--accent); transform: translateY(-1px); }
.mapa-item.sin-punto { opacity: .85; }
.mapa-item-foto {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 50%;
  overflow: hidden; display: grid; place-items: center; font-size: 1.4rem;
  background: linear-gradient(135deg, var(--panel2), var(--panel));
  border: 2px solid var(--accent);
}
.mapa-item-foto img { width: 100%; height: 100%; object-fit: cover; }
.mapa-item-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mapa-item-info strong { font-size: .95rem; }
.mapa-item-info .small { font-size: .78rem; }
.mapa-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mapa-item-dist {
  flex: 0 0 auto; font-size: .72rem; font-weight: 700; color: var(--accent2);
  background: rgba(23, 192, 91, .14); border: 1px solid rgba(23, 192, 91, .35);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.mapa-item-dir { overflow: hidden; text-overflow: ellipsis; }
.mapa-item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mapa-item-acciones { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.mapa-item-acciones a.btn { text-decoration: none; text-align: center; }
@media (min-width: 720px) {
  .mapa-lista-items { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ---------- Hoja de salas del mapa ---------- */
/* En escritorio la lista queda debajo del mapa, como siempre */
.mapa-hoja { display: block; }
.mapa-hoja-btn { display: none; }
.mapa-hoja-cuerpo { display: block; }

/* ---------- Mapa a pantalla completa (celular) ----------
   El mapa cubre TODA la pantalla; el título, los botones y las 5 opciones
   flotan por encima. La lista de salas se pliega en una hoja flotante. */
@media (max-width: 699px) {
  body.nav-mapa #app-header { display: none; }
  body.nav-mapa main#view-mapa { padding: 0; max-width: none; overflow: hidden; }
  body.nav-mapa #view-mapa > .panel {
    background: none; border: none; border-radius: 0; padding: 0; height: 100%;
  }
  body.nav-mapa #mapa {
    position: fixed; inset: 0;
    width: 100vw; height: 100vh; height: 100dvh;
    min-height: 0; max-height: none;
    border: none; border-radius: 0; z-index: 0;
  }
  body.nav-mapa #pane-mapa .mapa-ayuda { display: none; }

  /* Los dos botones del mapa: abajo a la derecha, apilados, junto a las 5 opciones */
  body.nav-mapa #view-mapa .panel-head {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(98px + env(safe-area-inset-bottom));
    top: auto; left: auto;
    z-index: 6; margin: 0; padding: 0;
    background: none; border: none; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    flex-direction: column; align-items: flex-end;
  }
  body.nav-mapa #view-mapa .panel-head h2 { display: none; }
  body.nav-mapa #view-mapa .panel-head .row { flex-direction: column; gap: 10px; margin: 0; flex-wrap: nowrap; }
  body.nav-mapa #view-mapa .panel-head .btn {
    width: 44px; height: 44px; padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.15rem; line-height: 1; color: var(--text);
    background: var(--pop);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .07);
    transition: transform .12s ease, border-color .15s ease, color .15s ease;
  }
  body.nav-mapa #view-mapa .panel-head .btn:hover { border-color: var(--accent); color: var(--accent2); }
  body.nav-mapa #view-mapa .panel-head .btn:active { transform: scale(.92); }
  body.nav-mapa .mapa-btn-txt { display: none; }
  body.nav-mapa #mapa-fallback:not([hidden]) {
    position: fixed; left: 16px; right: 16px;
    top: calc(70px + env(safe-area-inset-top));
    z-index: 6; margin: 0; padding: 14px;
    background: var(--pop); border: 1px solid var(--line); border-radius: 14px;
  }

  /* Hoja de salas flotante, un poco más separada del logo central del mapa */
  body.nav-mapa #mapa-hoja {
    position: fixed; left: 12px; right: 12px;
    bottom: calc(112px + env(safe-area-inset-bottom));
    z-index: 6;
    display: flex; flex-direction: column; align-items: stretch;
    pointer-events: none;
  }
  /* Tirador: solo una línea horizontal (sin recuadro) para deslizar y ver las salas */
  body.nav-mapa .mapa-hoja-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    pointer-events: auto; align-self: center;
    padding: 13px 44px; margin: 0;
    background: none; border: none; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    cursor: grab; touch-action: none;
  }
  body.nav-mapa .mapa-hoja-btn:active { cursor: grabbing; }
  body.nav-mapa .mapa-hoja-linea {
    display: block; width: 54px; height: 5px; border-radius: 999px;
    background: var(--muted); opacity: .9;
    box-shadow: 0 1px 7px rgba(0, 0, 0, .6);
    transition: width .16s ease, background .16s ease, opacity .16s ease;
  }
  body.nav-mapa .mapa-hoja-btn:hover .mapa-hoja-linea,
  body.nav-mapa .mapa-hoja-btn:active .mapa-hoja-linea {
    width: 72px; background: var(--accent2); opacity: 1;
  }
  /* La hoja: crece siguiendo el dedo (altura animada) */
  body.nav-mapa .mapa-hoja-cuerpo {
    pointer-events: auto;
    width: 100%; max-height: 0; overflow: hidden;
    margin-bottom: 0;
    transition: max-height .3s cubic-bezier(.22, .61, .36, 1), margin-bottom .3s ease;
  }
  body.nav-mapa #mapa-hoja.abierta .mapa-hoja-cuerpo { margin-bottom: 10px; }
  body.nav-mapa .mapa-hoja-card {
    padding: 14px;
    max-height: 46vh; overflow-y: auto; overscroll-behavior: contain;
    background: linear-gradient(180deg, var(--panel2), var(--panel));
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border: 1px solid var(--line); border-radius: 22px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .05);
  }
  body.nav-mapa #mapa-lista { margin-top: 0; }
  body.nav-mapa #mapa-sin-ubicacion:not(:empty) { margin-bottom: 10px; }
  /* Cada sala dentro de la hoja: foto + datos arriba, botones abajo */
  body.nav-mapa .mapa-item {
    display: grid;
    grid-template-columns: 54px 1fr;
    grid-template-areas: "foto info" "acc acc";
    align-items: start;
    gap: 10px 12px;
    padding: 12px;
    border-radius: 14px;
  }
  body.nav-mapa .mapa-item-foto { grid-area: foto; }
  body.nav-mapa .mapa-item-info { grid-area: info; gap: 3px; }
  body.nav-mapa .mapa-item-acciones {
    grid-area: acc;
    flex-direction: row; flex-wrap: wrap;
    gap: 6px; margin-top: 2px; padding-top: 10px;
    border-top: 1px solid var(--line);
  }
  body.nav-mapa .mapa-item-acciones .btn { flex: 1 1 auto; }
  body.nav-mapa .mapa-item-acciones .btn-primary { flex: 1 1 100%; }
  /* El contador "n / N" y el botón de ocultar la lista son solo de escritorio */
  body.nav-mapa .mapa-indice { display: none; }
  body.nav-mapa #view-mapa #mapa-lista-toggle { display: none; }
}

/* ---------- Mapa a pantalla completa (escritorio) ----------
   En pantallas anchas el mapa también cubre toda la ventana: el riel
   lateral flota sobre el mapa, los botones 📍/🔎 van abajo a la derecha
   sobre el mapa y la lista de salas es un panel lateral siempre visible. */
@media (min-width: 701px) {
  body.nav-mapa #app-header { display: none; }
  body.nav-mapa main#view-mapa { padding: 0; max-width: none; overflow: hidden; }
  body.nav-mapa #view-mapa > .panel {
    background: none; border: none; border-radius: 0; padding: 0; height: 100%;
  }
  body.nav-mapa #mapa {
    position: fixed; inset: 0;
    width: 100vw; height: 100vh; height: 100dvh;
    min-height: 0; max-height: none;
    border: none; border-radius: 0; z-index: 0;
  }
  /* Los textos de ayuda quedan ocultos (el mapa es a pantalla completa) */
  body.nav-mapa #pane-mapa .mapa-ayuda { display: none; }

  /* El riel lateral queda transparente, flotando sobre el mapa */
  body.nav-mapa .dock-container { background: transparent; }
  body.nav-mapa .bottom-nav {
    background: transparent; border-color: transparent; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  body.nav-mapa .nav-btn, body.nav-mapa .nav-btn-center {
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  }
  body.nav-mapa .nav-btn svg { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55)); }

  /* Control de zoom y créditos de OpenStreetMap: abajo a la izquierda
     (a la izquierda del panel de salas, afuera del riel) */
  body.nav-mapa #mapa .leaflet-top.leaflet-left {
    left: 16px; top: auto; bottom: 64px;
  }
  body.nav-mapa #mapa .leaflet-control-attribution {
    position: fixed;
    left: 16px; right: auto; bottom: 16px;
    margin: 0;
    background: rgba(8, 12, 24, .62); color: rgba(255, 255, 255, .78);
    border-radius: 999px; padding: 3px 10px; font-size: .7rem;
  }
  body.nav-mapa #mapa .leaflet-control-attribution a { color: rgba(255, 255, 255, .9); }

  /* Botones 📍 / 🔎 / ✕ flotantes, a la izquierda del panel de salas.
     Cuando la lista se oculta, los 3 botones viajan juntos al borde derecho */
  body.nav-mapa #view-mapa .panel-head {
    position: fixed;
    right: calc(min(392px, 35vw) + 32px);
    bottom: 18px;
    top: auto; left: auto;
    z-index: 96; margin: 0; padding: 0;
    background: none; border: none; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    flex-direction: column; align-items: flex-end;
    transition: right .34s cubic-bezier(.22, .9, .28, 1);
  }
  body.nav-mapa.salas-oculta #view-mapa .panel-head { right: 16px; }
  body.nav-mapa #view-mapa .panel-head h2 { display: none; }
  body.nav-mapa #view-mapa .panel-head .row { flex-direction: column; gap: 10px; margin: 0; flex-wrap: nowrap; }
  body.nav-mapa #view-mapa .panel-head .btn {
    width: 48px; height: 48px; padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.2rem; line-height: 1; color: var(--text);
    background: var(--pop);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .07);
    transition: transform .12s ease, border-color .15s ease, color .15s ease;
  }
  body.nav-mapa #view-mapa .panel-head .btn:hover { border-color: var(--accent); color: var(--accent2); }
  body.nav-mapa #view-mapa .panel-head .btn:active { transform: scale(.92); }
  body.nav-mapa .mapa-btn-txt { display: none; }

  /* Aviso (mapa sin internet): tarjeta flotante arriba, a la izquierda del panel */
  body.nav-mapa #mapa-fallback:not([hidden]) {
    position: fixed; left: auto; right: calc(min(392px, 35vw) + 32px);
    top: 18px; bottom: auto;
    z-index: 96; margin: 0; padding: 14px; display: block;
    background: var(--pop); border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
    transition: right .34s cubic-bezier(.22, .9, .28, 1);
  }
  body.nav-mapa.salas-oculta #mapa-fallback:not([hidden]) { right: 16px; }

  /* Lista de salas: panel lateral derecho (se puede ocultar con el botón ✕) */
  body.nav-mapa #mapa-hoja {
    position: fixed;
    top: 16px; right: 16px; bottom: 16px; left: auto;
    width: min(392px, 35vw);
    z-index: 6;
    display: flex; flex-direction: column; align-items: stretch;
    pointer-events: none;
    transition: transform .34s cubic-bezier(.22, .9, .28, 1), opacity .24s ease;
  }
  /* Con el botón ✕ la lista se guarda y el mapa queda a pantalla completa */
  body.nav-mapa.salas-oculta #mapa-hoja {
    transform: translateX(calc(100% + 28px));
    opacity: 0;
    pointer-events: none;
  }
  /* Sin tirador en escritorio: el panel queda abierto */
  body.nav-mapa .mapa-hoja-btn { display: none; }
  body.nav-mapa .mapa-hoja-cuerpo {
    pointer-events: auto;
    width: 100%;
    flex: 1 1 auto; min-height: 0;
    max-height: none !important;   /* siempre abierto en escritorio */
    margin-bottom: 0; overflow: hidden;
    display: flex; flex-direction: column;
    background: var(--pop);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .05);
  }
  body.nav-mapa .mapa-hoja-card {
    padding: 14px;
    max-height: none; overflow: hidden;
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
  }

  /* ---------- Carrusel horizontal de salas (solo escritorio) ----------
     Las tarjetas se deslizan de costado: con el mouse el arrastre sigue
     al cursor y con rueda/trackpad funciona el scroll nativo. */
  body.nav-mapa .mapa-lista { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  body.nav-mapa .mapa-lista-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin: 0 0 10px;
  }
  body.nav-mapa .mapa-lista-head .sub {
    margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  body.nav-mapa .mapa-lista-ctrl { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
  body.nav-mapa .mapa-indice {
    font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .6px;
    background: var(--panel2); border: 1px solid var(--line); border-radius: 999px;
    padding: 2px 10px; white-space: nowrap;
  }
  body.nav-mapa .mapa-flecha {
    width: 32px; height: 32px; flex: 0 0 32px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.2rem; line-height: 1; font-weight: 700;
    color: var(--text); background: var(--panel2);
    border: 1px solid var(--line); border-radius: 50%;
    cursor: pointer; transition: border-color .15s, color .15s, transform .12s;
  }
  body.nav-mapa .mapa-flecha:hover:not(:disabled) { border-color: var(--accent); color: var(--accent2); }
  body.nav-mapa .mapa-flecha:active:not(:disabled) { transform: scale(.9); }
  body.nav-mapa .mapa-flecha:disabled { opacity: .35; cursor: default; }
  body.nav-mapa .mapa-lista-items {
    display: flex; gap: 12px; flex: 1 1 auto; min-height: 0;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    padding: 2px 2px 10px;
    scrollbar-width: none;
    user-select: none; -webkit-user-select: none;
    cursor: grab;
  }
  body.nav-mapa .mapa-lista-items::-webkit-scrollbar { display: none; }
  body.nav-mapa .mapa-item {
    flex: 0 0 auto;
    scroll-snap-align: center;
    display: flex; flex-direction: column; justify-content: space-between;
    align-items: stretch;
    width: min(78%, 330px);
    max-width: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
  }
  body.nav-mapa .mapa-item-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
  body.nav-mapa .mapa-item-acciones {
    margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  }
  body.nav-mapa #mapa-lista { margin-top: 0; }
  body.nav-mapa #mapa-sin-ubicacion:not(:empty) { margin-bottom: 10px; }
}

/* ================= RESUMEN DEL INICIO ================= */
#view-mapa { padding: 12px 14px 30px; }
.resumen-stats { margin-bottom: 14px; }
.resumen-stats .stat { text-align: center; }
.promo-list { display: grid; gap: 8px; }
.promo {
  display: flex; flex-direction: column; gap: 3px;
  background: linear-gradient(135deg, rgba(0, 160, 56, .16), var(--panel2));
  border: 1px solid var(--accent);
  border-radius: 12px; padding: 10px 12px; cursor: pointer;
}
.promo strong { font-size: .95rem; }
.promo span { font-size: .84rem; color: var(--muted); }
.alert-list { display: grid; gap: 8px; }
.alert {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 12px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--line);
  border-left: 3px solid var(--line);
}
.alert.nueva { border-left-color: var(--accent); background: rgba(0, 160, 56, .1); }
.alert strong { font-size: .9rem; }
.alert span { font-size: .84rem; }
.alert small { font-size: .72rem; }

/* Selector mapa / lista */
.seg {
  display: inline-flex; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px;
}
.seg-btn {
  border: none; background: transparent; color: var(--muted);
  font-size: .78rem; font-weight: 700; padding: 5px 12px;
  border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.seg-btn.active { background: var(--accent); color: #fff; }

/* =====================================================================
   FORMATO ESCRITORIO (pantallas anchas)
   El dock inferior pasa a ser un riel lateral y el contenido se amplía.
   ===================================================================== */
@media (min-width: 701px) {
  /* El contenido se corre para dejar lugar al riel (solo si el riel está visible) */
  body:has(#dock-container:not([hidden])) { padding-left: 108px; }

  /* ---------- Riel lateral con las 5 opciones ---------- */
  .dock-container {
    top: 0; bottom: auto; left: 0; right: auto;
    width: 108px; height: 100vh; height: 100dvh;
    max-width: none; margin: 0;
    padding: 14px 10px;
    align-items: stretch;
    justify-content: flex-start;
    z-index: 95;
  }
  .bottom-nav {
    display: flex; flex-direction: column; gap: 4px;
    width: 100%; height: auto;
    background: var(--pop);
    box-shadow: none;
    border-radius: 18px;
    padding: 8px;
    grid-template-columns: none;
  }
  .nav-btn {
    height: 58px; border-radius: 14px;
    gap: 4px; font-size: 11px;
    transition: color .15s ease, background .15s ease;
  }
  .nav-btn:hover { color: var(--text); background: rgba(0, 160, 56, .1); }
  .nav-btn:active { transform: none; }
  .nav-btn.active { background: rgba(0, 160, 56, .18); }
  .nav-btn-center {
    justify-content: center; gap: 5px;
    height: 72px; padding: 0; border-radius: 14px;
    transition: background .15s ease;
  }
  .nav-btn-center:hover { background: rgba(0, 160, 56, .1); }
  .nav-btn-center:active { transform: none; }
  .nav-circle-btn {
    position: static;
    width: 36px; height: 36px; border-width: 0;
    box-shadow: 0 4px 14px rgba(0, 160, 56, .45);
  }
  .nav-btn-center:active .nav-circle-btn { transform: scale(.94); }
  .nav-btn-center.active .nav-circle-btn { box-shadow: 0 6px 18px rgba(0, 160, 56, .6); }
  .home-indicator { display: none; }

  /* ---------- Cabecera y contenido ---------- */
  .app-header { padding: 10px 26px; gap: 18px; }
  .brand-logo { width: 226px; }
  .sala-actual { max-width: 260px; font-size: .88rem; }
  main { max-width: 1300px; padding: 22px 26px 48px; }
  #view-mapa, #view-panel { padding: 22px 26px 48px; }
  #view-auth { padding: 34px 26px 48px; align-items: flex-start; }
  .auth-wrap { max-width: 500px; }

  .panel { padding: 24px; }
  .panel-head h2 { font-size: 1.75rem; }
  .admin-head h1 { font-size: 1.85rem; }
  .admin-head-ico { width: 54px; height: 54px; font-size: 1.7rem; border-radius: 16px; }

  /* Panel de notificaciones: pantalla completa en escritorio */
  .notif-sheet-head { padding: 18px 22px 14px; }

  /* ---------- Inicio: calendario y resumen lado a lado ---------- */
  #step-1 {
    display: grid;
    grid-template-columns: minmax(330px, 440px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }

  /* ---------- Grillas más generosas ---------- */
  .rooms-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
  .slots-grid { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; }
  .stats-cards { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .place-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

  /* ---------- Mapa más grande ---------- */
  #mapa {
    height: calc(100dvh - 300px);
    min-height: 460px;
    max-height: 780px;
  }
  #mapa-picker { height: 380px; }

  /* ---------- Modales y visor ---------- */
  .modal { padding: 28px; }
  .modal-box { max-width: 640px; }
  .viewer-img { max-width: 84vw; max-height: 86vh; }
  #toast { bottom: 34px; }
}

/* ---------- Extras de escritorio ---------- */
@media (min-width: 701px) {
  /* Perfil y avisos en dos columnas */
  #view-mine {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
    align-items: start;
  }
  /* Feedback al pasar el mouse (en táctil no aplica) */
  .room-card, .inst-card, .mine-card, .place-photo, .promo, .alert {
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  }
  .room-card:hover, .inst-card:hover, .mine-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .38);
    border-color: var(--accent);
  }
  /* Teclado: foco visible */
  .btn:focus-visible, .nav-btn:focus-visible, .nav-btn-center:focus-visible,
  input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent2);
    outline-offset: 2px;
  }
}

/* =====================================================================
   ESCRITORIO v2 — todas las medidas de computadora (1024 px en adelante)
   Se adapta de notebook 1280x720 hasta monitores 2K/4K.
   Solo CSS: no cambia la lógica de la app.
   ===================================================================== */
@media (min-width: 1024px) {
  :root { --riel: clamp(96px, 7vw, 140px); }
  html { font-size: clamp(16px, .5vw + 9.5px, 22px); }
  body:has(#dock-container:not([hidden])) { padding-left: var(--riel); }
  .dock-container { width: var(--riel); }
  .nav-btn { height: clamp(58px, 7.5vh, 76px); font-size: clamp(11px, .2vw + 8.5px, 14px); }
  .nav-btn svg { width: 24px; height: 24px; }

  .app-header { padding: 10px clamp(22px, 2.4vw, 56px); }
  .brand-logo { width: clamp(200px, 15vw, 320px); }

  main, #view-mapa, #view-panel {
    max-width: clamp(1100px, 90vw, 2000px);
    padding: clamp(16px, 2.4vh, 32px) clamp(22px, 2.4vw, 56px) 40px;
  }

  /* ---------- Inicio: ocupa toda la pantalla, sin huecos vacíos ---------- */
  #step-1 {
    grid-template-columns: minmax(420px, 1.15fr) minmax(0, 1fr);
    gap: clamp(16px, 1.6vw, 32px);
    align-items: stretch;
    height: clamp(520px, calc(100dvh - 170px), 1100px);
  }
  #step-1[hidden] { display: none; }
  #step-1 > .panel {
    display: flex; flex-direction: column; min-height: 0;
    padding: clamp(18px, 1.6vw, 34px);
  }
  #step-1 .panel-head { margin-bottom: clamp(10px, 1.6vh, 20px); }
  #step-1 .panel-head h2 { font-size: clamp(1.6rem, 1.2vw + 1rem, 2.4rem); }

  /* Calendario: las celdas se estiran para llenar el alto */
  #step-1 .cal-grid {
    flex: 1 1 auto; min-height: 0;
    gap: clamp(6px, .6vw, 12px);
    grid-template-rows: auto;
    grid-auto-rows: minmax(44px, 1fr);
  }
  #step-1 .cal-h { font-size: clamp(.8rem, .3vw + .6rem, 1rem); align-self: end; }
  #step-1 .cal-day {
    aspect-ratio: auto; min-height: 0;
    font-size: clamp(1rem, .5vw + .75rem, 1.5rem);
    border-radius: clamp(10px, .8vw, 16px);
  }
  #step-1 .cal-day .dot { font-size: clamp(.62rem, .2vw + .5rem, .85rem); top: 5px; right: 7px; }
  #step-1 .panel > .muted.small { margin: clamp(10px, 1.5vh, 18px) 0 0; font-size: clamp(.8rem, .2vw + .7rem, 1rem); }

  /* Resumen: tarjetas grandes en 2 columnas que llenan la columna */
  #inicio-resumen .resumen-stats {
    flex: 1 1 auto; min-height: 0; margin: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(110px, 1fr);
    gap: clamp(12px, 1.2vw, 24px);
  }
  #inicio-resumen .stat {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    border-radius: clamp(14px, 1.1vw, 22px); padding: 18px;
  }
  #inicio-resumen .stat span { font-size: clamp(.9rem, .35vw + .7rem, 1.2rem); margin-bottom: 8px; }
  #inicio-resumen .stat strong {
    font-family: "Barlow Condensed", "Barlow", sans-serif; font-style: italic; font-weight: 900;
    font-size: clamp(2.6rem, 2.4vw + 1.4rem, 5.5rem); line-height: 1; color: var(--accent2);
  }
  #inicio-resumen > .row { margin-top: clamp(12px, 1.6vh, 20px); }

  /* ---------- Resto de pantallas: grillas que aprovechan el ancho ---------- */
  .rooms-grid, .place-grid { grid-template-columns: repeat(auto-fill, minmax(clamp(280px, 19vw, 400px), 1fr)); gap: clamp(16px, 1.4vw, 28px); }
  .slots-grid { grid-template-columns: repeat(auto-fill, minmax(clamp(175px, 12vw, 260px), 1fr)); }
  #view-mine { grid-template-columns: repeat(auto-fit, minmax(clamp(360px, 28vw, 560px), 1fr)); }
  #mapa { height: calc(100dvh - 230px); min-height: 460px; max-height: 1200px; }
  .modal-box { max-width: clamp(640px, 42vw, 960px); }
}

/* Notebook bajita (1366x768 o menos de alto): se compacta para no hacer scroll */
@media (min-width: 1024px) and (max-height: 800px) {
  .app-header { padding-top: 6px; padding-bottom: 6px; }
  .brand-logo { width: 190px; }
  #step-1 { height: calc(100dvh - 140px); min-height: 480px; }
  #step-1 > .panel { padding: 16px 20px; }
  #inicio-resumen .resumen-stats { grid-auto-rows: minmax(90px, 1fr); }
}

/* Monitores grandes / 4K: se limita el ancho para que nada quede estirado */
@media (min-width: 2200px) {
  main, #view-mapa, #view-panel { max-width: 2200px; }
}

/* =====================================================================
   PANEL DE ADMINISTRACIÓN — menú lateral y agenda (escritorio)
   ===================================================================== */
.admin-tab-group { display: none; }
.admin-stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.admin-stats .stat:nth-child(3) b { color: var(--warn); }

@media (min-width: 1024px) {
  #view-admin:not([hidden]) {
    display: grid; grid-template-columns: clamp(196px, 13.5vw, 232px) minmax(0, 1fr);
    column-gap: clamp(20px, 2vw, 36px); align-content: start; align-items: start;
  }
  #view-admin > .admin-head { grid-column: 1 / -1; }
  #view-admin > .admin-tabs {
    grid-column: 1; grid-row: 2 / span 40;
    position: sticky; top: 12px; align-self: start;
    max-height: calc(100dvh - 150px); overflow-y: auto; scrollbar-width: thin;
    flex-direction: column; gap: 1px; overflow-x: visible;
    margin: 0; padding: 8px 8px 10px;
    background: var(--pop); border: 1px solid var(--line); border-radius: 18px;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  #view-admin > .tab { grid-column: 2; min-width: 0; }
  .admin-tab-group {
    display: block; padding: 10px 10px 4px;
    font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--label);
  }
  .admin-tab-group:first-child { padding-top: 0; }
  #view-admin > .admin-tabs .admin-tab {
    width: 100%; margin: 0; padding: 7px 10px;
    justify-content: space-between; text-align: left; white-space: normal;
    border: 0; border-radius: 9px; font-size: .9rem;
  }
  #view-admin > .admin-tabs .admin-tab:hover { background: var(--tinte); }
  #view-admin > .admin-tabs .admin-tab.active { background: rgba(0, 160, 56, .18); color: var(--accent2); }

  /* Agenda: salas en columnas, horas en filas */
  .agenda { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 20px; }
  .ag-head, .ag-body {
    display: grid; grid-template-columns: 56px repeat(var(--n, 3), minmax(0, 1fr)); column-gap: 10px;
  }
  .ag-room { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; font-weight: 600; }
  .ag-room i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
  .ag-body { margin-top: 8px; }
  .ag-hours { position: relative; }
  .ag-hours span { position: absolute; left: 0; transform: translateY(-50%); font-size: .78rem; color: var(--label); font-variant-numeric: tabular-nums; }
  .ag-col {
    position: relative;
    background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent var(--hpx));
    border-bottom: 1px solid var(--line);
  }
  .ag-res {
    position: absolute; left: 0; right: 0; box-sizing: border-box;
    display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; overflow: hidden; line-height: 1.2;
    border-radius: 10px; border: 1px solid var(--rc, var(--accent));
    background: var(--panel2);
    background: color-mix(in srgb, var(--rc, var(--accent)) 22%, var(--panel));
    transition: box-shadow .15s ease;
  }
  .ag-res:hover, .ag-res:focus-within { box-shadow: 0 8px 20px rgba(0, 0, 0, .3); z-index: 2; }
  .ag-res b { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ag-res span { font-size: .8rem; color: var(--muted); }
  .ag-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ag-res.pend { background: transparent; border-style: dashed; border-color: var(--warn); }
  .ag-res .ag-pend { color: var(--warn); font-weight: 600; }
  .ag-acts { position: absolute; right: 6px; bottom: 6px; display: none; gap: 4px; }
  .ag-res:hover .ag-acts, .ag-res:focus-within .ag-acts { display: flex; }
  .ag-acts button, .ag-ask button {
    font-size: .76rem; font-weight: 600; padding: 4px 9px; cursor: pointer;
    border-radius: 8px; border: 1px solid var(--soft); background: var(--panel); color: var(--text);
  }
  .ag-acts button + button { color: var(--danger); }
  .ag-ask {
    position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; align-items: center; gap: 6px;
    padding: 4px 6px; border-radius: 8px; background: var(--pop); font-size: .78rem; font-weight: 600;
  }
  .ag-ask span { color: var(--text); flex: 1; }
  .ag-ask .yes { background: var(--danger); border-color: transparent; color: #fff; }
}


/* =====================================================================
   INICIO DEL PANEL (resumen) y promociones con flyer / redes
   ===================================================================== */
.admin-tab.admin-tab-inicio { font-weight: 700; color: var(--accent2); }
.admin-tab.admin-tab-inicio::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px rgba(0, 160, 56, .25);
  margin-right: 8px; vertical-align: middle;
}
@media (min-width: 1024px) {
  #view-admin > .admin-tabs .admin-tab.admin-tab-inicio {
    font-size: .95rem; margin-bottom: 6px; padding: 8px 10px;
    background: linear-gradient(135deg, rgba(0, 160, 56, .30), rgba(0, 160, 56, .10));
    border: 1px solid rgba(0, 160, 56, .5);
  }
}

.inicio-saludo h2 { margin: 0; font-size: 1.35rem; }
.inicio-saludo p { margin: 2px 0 0; }
.inicio-stats { margin-top: 14px; }

.inicio-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; margin-top: 14px; align-items: stretch;
}
@media (max-width: 720px) { .inicio-grid { grid-template-columns: 1fr; } }

.inicio-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 16px; min-width: 0; display: flex; flex-direction: column;
}
.inicio-card.ancha { grid-column: 1 / -1; }
.inicio-card h3 { margin: 0 0 8px; font-size: .95rem; }
.inicio-pie { margin-top: auto; padding-top: 12px; }

/* Próximas reservas: una fila por reserva, en columnas alineadas */
.inicio-prox { list-style: none; margin: 0; padding: 0; }
.inicio-prox li {
  display: grid; grid-template-columns: 108px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.inicio-prox li:last-child { border-bottom: 0; }
.inicio-prox time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inicio-prox .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inicio-prox .sala { font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* Accesos rápidos: botones que reparten el alto de la tarjeta */
.inicio-links { display: grid; grid-auto-rows: 1fr; gap: 8px; flex: 1; }
.inicio-link {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 14px; min-height: 42px;
  border-radius: 10px; background: var(--panel2); border: 1px solid var(--line);
  color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer;
}
.inicio-link:hover { background: var(--tinte); }
.inicio-link span { flex: 1; }
.inicio-link .n { background: var(--danger); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .78rem; }
.inicio-link i { font-style: normal; color: var(--muted); font-size: 1.2rem; line-height: 1; }

/* Promociones activas */
.promo-admin-card {
  display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line);
}
.promo-admin-card:first-of-type { padding-top: 0; }
.promo-admin-card:last-of-type { border-bottom: 0; padding-bottom: 0; }
.promo-admin-card .res-info { min-width: 0; }
.promo-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; flex: none; background: var(--panel2); }
.promo-flyer-img { display: block; width: 100%; max-height: 300px; object-fit: contain; border-radius: 12px; margin: 8px 0; background: var(--panel2); }
.promo-flyer-edit img { max-width: 220px; max-height: 220px; border-radius: 10px; display: block; margin: 6px 0; }

/* Promociones en el Inicio: el flyer es lo principal */
.promos-publico { margin: 0 0 16px; }
.promos-tit { margin: 0 0 10px; font-size: 1.05rem; }
.promo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.promo-grid > :only-child { max-width: 420px; }
.promo-hero {
  display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 16px;
}
.promo-hero:hover { border-color: var(--accent); }
.promo-hero-img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: contain; background: #0a1322; }
.promo-hero-info { padding: 10px 12px 12px; display: grid; gap: 3px; }
.promo-hero-info strong { font-size: .95rem; }
.promo-hero-info > span {
  color: var(--muted); font-size: .84rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.promo-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.promo-link {
  font-size: .8rem; font-weight: 600; color: var(--accent2); text-decoration: none;
  background: rgba(0, 160, 56, .12); border: 1px solid rgba(0, 160, 56, .35);
  border-radius: 999px; padding: 3px 10px;
}
.promo-link:hover { background: rgba(0, 160, 56, .22); }
.promo-flyer-img { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 12px; margin: 8px 0; background: #0a1322; }

/* El mismo formato de menú lateral para el panel de sala */
@media (min-width: 1024px) {
  #view-panel:not([hidden]) {
    display: grid; grid-template-columns: clamp(196px, 13.5vw, 232px) minmax(0, 1fr);
    column-gap: clamp(20px, 2vw, 36px); align-content: start; align-items: start;
  }
  #view-panel > .admin-head { grid-column: 1 / -1; }
  #view-panel > #panel-estado { grid-column: 1 / -1; }
  #view-panel > .admin-tabs {
    grid-column: 1; grid-row: 2 / span 40;
    position: sticky; top: 12px; align-self: start;
    max-height: calc(100dvh - 150px); overflow-y: auto; scrollbar-width: thin;
    flex-direction: column; gap: 1px; overflow-x: visible;
    margin: 0; padding: 8px 8px 10px;
    background: var(--pop); border: 1px solid var(--line); border-radius: 18px;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  #view-panel > .tab { grid-column: 2; min-width: 0; }
  #view-panel > .admin-tabs .admin-tab {
    width: 100%; margin: 0; padding: 7px 10px;
    justify-content: space-between; text-align: left; white-space: normal;
    border: 0; border-radius: 9px; font-size: .9rem;
  }
  #view-panel > .admin-tabs .admin-tab:hover { background: var(--tinte); }
  #view-panel > .admin-tabs .admin-tab.active { background: rgba(0, 160, 56, .18); color: var(--accent2); }
  #view-panel > .admin-tabs .admin-tab.admin-tab-inicio { font-size: .95rem; margin-bottom: 6px; padding: 8px 10px; }
}

/* Encabezado del panel de sala: el botón Volver queda a la derecha */
#view-panel > .admin-head .btn { margin-left: auto; }
#view-panel > #panel-estado:empty { display: none; }

/* ---------- Movimientos de la sala ---------- */
.mov-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mov-nav { display: flex; align-items: center; gap: 8px; }
.mov-nav .btn:disabled { opacity: .4; cursor: not-allowed; }
.mov-mes { text-transform: capitalize; min-width: 160px; text-align: center; }
.mov-stats { margin-top: 14px; }
.mov-wrap { overflow-x: auto; margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; }
.mov-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 560px; }
.mov-table th, .mov-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.mov-table th { background: var(--panel2); color: var(--label); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.mov-table tr:last-child td { border-bottom: 0; }
.mov-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mov-table tr.anulada td { color: var(--muted); }
.mov-table tr.anulada td:nth-child(3) { text-decoration: line-through; }
.mov-estado { font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--panel2); }
.mov-estado.ok { color: var(--accent2); }
.mov-estado.pend { color: var(--warn); }
.mov-estado.off { color: var(--muted); }
.mov-foot { margin: 10px 0 0; font-size: .82rem; color: var(--muted); }

/* ---------- Cuentas de control (administrador y dueño de sala) ---------- */
body.modo-control #nav-instrumentos,
body.modo-control #btn-filtro-fav,
body.modo-control #fav-ver,
body.modo-control #ficha-fav,
body.modo-control #mine-favoritas,
body.modo-control #mine-integrantes,
body.modo-control label:has(> #pd-instrumentos) { display: none !important; }

/* =====================================================================
   RISEL LATERAL DE ESCRITORIO (5 opciones): ícono + etiqueta, alineado
   con el menú del panel de administración
   ===================================================================== */
@media (min-width: 1024px) {
  :root { --riel: clamp(228px, 16vw, 262px); }
  body:has(#dock-container:not([hidden])) { padding-left: var(--riel); }

  .dock-container {
    top: 0; bottom: auto; left: 0; right: auto;
    width: var(--riel); height: 100vh; height: 100dvh;
    max-width: none; margin: 0; padding: 18px 10px;
    align-items: stretch; justify-content: flex-start;
    background: transparent;
  }
  .bottom-nav {
    display: flex; flex-direction: column; gap: 4px;
    width: 100%; height: 100%; padding: 10px;
    background: var(--pop); border: 1px solid var(--line); border-radius: 18px;
    box-shadow: none; grid-template-columns: none;
  }

  /* Cada opción: una fila con ícono y texto a la izquierda */
  .nav-btn, .nav-btn-center {
    flex-direction: row; justify-content: flex-start; align-items: center;
    gap: 10px; width: 100%; height: 48px; padding: 0 12px;
    border-radius: 12px; font-size: .92rem; font-weight: 600; letter-spacing: 0; white-space: nowrap;
    color: var(--muted); text-align: left;
    transition: background .15s ease, color .15s ease;
  }
  .nav-btn svg { width: 20px; height: 20px; flex: none; }
  .nav-btn:hover, .nav-btn-center:hover { background: rgba(0, 160, 56, .1); color: var(--text); }
  .nav-btn:active, .nav-btn-center:active { transform: none; }
  .nav-btn.active, .nav-btn-center.active {
    background: rgba(0, 160, 56, .18); color: var(--accent2); font-weight: 700;
    box-shadow: inset 3px 0 0 var(--accent);
  }
  .nav-btn.active svg, .nav-btn-center.active svg { color: var(--accent2); }

  /* "Mapa" deja de ser un círculo que sobresale y queda como una fila más */
  .nav-btn-center { padding-bottom: 0; justify-content: flex-start; }
  .nav-circle-btn {
    position: static; width: 30px; height: 30px; border-width: 0; border-radius: 9px;
    background: var(--accent); box-shadow: none; flex: none;
    display: flex; align-items: center; justify-content: center;
  }
  .nav-circle-btn svg { width: 16px; height: 16px; }
  .nav-btn-center.active .nav-circle-btn { background: var(--accent); box-shadow: none; }
  .nav-center-label { font-size: inherit; }
  .home-indicator { display: none; }
}

/* Administración y Panel de sala: visibles también en celular (cuentas de administración).
   En estas cuentas se oculta "Instrumentos" (body.modo-control), por lo que la barra
   sigue mostrando 5 opciones y el botón central (Mapa) queda perfectamente centrado. */
#nav-admin:not([hidden]),
#nav-panel:not([hidden]) { display: flex; }
/* Etiqueta corta en celular; la larga en el riel de escritorio */
.nav-label-largo { display: none; }
@media (min-width: 1024px) {
  .nav-label-largo { display: inline; }
  .nav-label-corto { display: none; }
}

/* ================= COMUNIDAD (solo músicos) ================= */
.comu-tabs { display: flex; gap: 6px; margin: 4px 0 14px; flex-wrap: wrap; }
.comu-tab {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 10px; border-radius: 12px; cursor: pointer;
  background: var(--soft2); color: var(--muted);
  border: 1px solid var(--line); font: inherit; font-size: .88rem; font-weight: 600;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.comu-tab:hover { color: var(--text); }
.comu-tab.active { background: rgba(0, 160, 56, .16); color: var(--accent2); border-color: var(--accent); font-weight: 700; }
.comu-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.comu-filtros { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.comu-lista, .comu-chats, #comu-siguiendo { display: flex; flex-direction: column; gap: 10px; }
.comu-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel2);
}
.comu-avatar {
  flex: none; width: 46px; height: 46px; border-radius: 50%; overflow: hidden;
  background: var(--soft2); display: inline-flex; align-items: center; justify-content: center;
}
.comu-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.comu-avatar-letra { background: rgba(0, 160, 56, .18); color: var(--accent2); font-weight: 800; font-size: 1.1rem; }
.comu-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.comu-info strong { font-size: .95rem; color: var(--text); }
.comu-user { color: var(--muted); font-weight: 500; font-size: .82rem; }
.comu-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.comu-tag { font-size: .72rem; padding: 2px 9px; border-radius: 999px; background: var(--soft2); color: var(--muted); border: 1px solid var(--line); }
.comu-me-sigue { align-self: flex-start; font-size: .7rem; padding: 2px 9px; border-radius: 999px; background: rgba(0, 160, 56, .16); color: var(--accent2); font-weight: 700; }
.comu-acciones { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.comu-sub { margin: 14px 0 8px; font-size: .9rem; color: var(--muted); }
.comu-chat-item {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; cursor: pointer;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel2);
  font: inherit; color: var(--text);
}
.comu-chat-item:hover { border-color: var(--accent); }
.comu-chat-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.comu-chat-info strong { font-size: .93rem; }
.comu-chat-info .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comu-chat { display: flex; flex-direction: column; gap: 10px; }
.comu-chat-head { display: flex; align-items: center; gap: 10px; }
.comu-chat-nombre { display: flex; flex-direction: column; line-height: 1.15; flex: 1 1 auto; min-width: 0; }
.comu-hilo {
  display: flex; flex-direction: column; gap: 8px;
  max-height: min(52vh, 420px); min-height: 180px; overflow-y: auto;
  padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-deep);
}
.comu-burbuja {
  max-width: 82%; padding: 8px 11px; border-radius: 14px; font-size: .9rem;
  display: flex; flex-direction: column; gap: 2px; word-break: break-word;
}
.comu-burbuja .comu-texto { white-space: pre-wrap; }
.comu-burbuja.mio { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.comu-burbuja.otro { align-self: flex-start; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.comu-hora { font-size: .65rem; opacity: .75; align-self: flex-end; }
.comu-form { display: flex; gap: 8px; align-items: center; }
.comu-form input {
  flex: 1 1 auto; min-width: 0; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--text); font: inherit;
}
.comu-form input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
