/* ==========================================================
   Hospeda Fácil — paleta azul, simple y responsiva
   ========================================================== */
:root {
  --b-950: #071733;
  --b-900: #0a1f44;
  --b-800: #0f2d63;
  --b-700: #1d4ed8;
  --b-600: #2563eb;
  --b-500: #3b82f6;
  --b-300: #93c5fd;
  --b-200: #bfdbfe;
  --b-100: #dbeafe;
  --b-50: #eff6ff;
  --bg: #f3f6fb;
  --card: #ffffff;
  --line: #e2e8f2;
  --ink: #0f1e36;
  --muted: #64748b;

  --st-green: #16a34a;  --st-green-bg: #e8f8ee;
  --st-red: #dc2626;    --st-red-bg: #fdecec;
  --st-yellow: #d39e00; --st-yellow-bg: #fff7d6;
  --st-gray: #64748b;   --st-gray-bg: #eceff4;

  --bs-primary: #1d4ed8;
  --bs-primary-rgb: 29, 78, 216;
  --bs-link-color: #1d4ed8;
  --bs-link-color-rgb: 29, 78, 216;
  --bs-link-hover-color: #0f2d63;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-color: #0f1e36;
  --bs-border-color: #e2e8f2;
  --sidebar-w: 15.5rem;
}
html { font-size: calc(100% * var(--escala, 1)); }

body { background: var(--bg); color: var(--ink); font-size: .94rem; }
a { text-decoration: none; }
.btn { border-radius: 10px; font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--b-700); --bs-btn-border-color: var(--b-700); --bs-btn-hover-bg: var(--b-800); --bs-btn-hover-border-color: var(--b-800); --bs-btn-active-bg: var(--b-900); }
.btn-outline-primary { --bs-btn-color: var(--b-700); --bs-btn-border-color: var(--b-200); --bs-btn-hover-bg: var(--b-700); --bs-btn-hover-border-color: var(--b-700); }
.btn-soft { background: var(--b-50); color: var(--b-700); border: 1px solid var(--b-100); }
.btn-soft:hover { background: var(--b-100); color: var(--b-800); }
.form-control, .form-select { border-radius: 10px; border-color: #d5deec; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--b-500); box-shadow: 0 0 0 .2rem rgba(59,130,246,.15); }
.form-label { font-weight: 500; font-size: .86rem; color: #334155; margin-bottom: .3rem; }
.has-error .form-control, .has-error .form-select { border-color: var(--st-red); }
.has-error .invalid-feedback, .help-block-error { display: block; color: var(--st-red); font-size: .82rem; }
.form-text, .hint-block { color: var(--muted); font-size: .8rem; }
.text-muted { color: var(--muted) !important; }
.badge { font-weight: 600; border-radius: 8px; padding: .35em .6em; }
.text-bg-primary { background: var(--b-700) !important; }

/* ---------- Layout del panel ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: fixed; inset: 0 auto 0 0; z-index: 1040;
  background: linear-gradient(180deg, var(--b-900) 0%, var(--b-800) 100%); color: #cfe0ff;
  display: flex; flex-direction: column; transition: transform .25s ease;
}
.sidebar .brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.1rem .9rem; color: #fff; }
.sidebar .brand-logo { width: 42px; height: 42px; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.sidebar .brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sidebar .brand-logo span { color: var(--b-700); font-weight: 800; }
.sidebar .brand-name { font-weight: 700; line-height: 1.15; font-size: .98rem; }
.sidebar .brand-sub { font-size: .72rem; color: var(--b-300); }
.sidebar nav { padding: .4rem .7rem; overflow-y: auto; flex: 1; }
.sidebar .nav-label { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: #7f9cd1; padding: .9rem .7rem .35rem; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: .75rem; color: #cfe0ff; padding: .62rem .8rem; border-radius: 11px; margin-bottom: 2px; font-weight: 500;
}
.sidebar .nav-link i { font-size: 1.12rem; width: 22px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: #fff; color: var(--b-800); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.sidebar .nav-link.active i { color: var(--b-600); }
.sidebar .side-foot { padding: .9rem 1.1rem; font-size: .72rem; color: #7f9cd1; border-top: 1px solid rgba(255,255,255,.08); }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1030; background: rgba(243,246,251,.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: .8rem; padding: .75rem 1.5rem; border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.topbar .burger { display: none; border: 0; background: #fff; border-radius: 10px; width: 40px; height: 40px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.content { padding: 1.4rem 1.5rem 3rem; }
.impersonate { background: #fff7d6; border-bottom: 1px solid #f5e3a1; color: #6b5200; padding: .45rem 1.5rem; font-size: .85rem; }
.backdrop { display: none; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .topbar { padding: .65rem 1rem; }
  .topbar .burger { display: inline-grid; place-items: center; }
  .content { padding: 1rem 1rem 3rem; }
  .backdrop.show { display: block; position: fixed; inset: 0; background: rgba(7,23,51,.45); z-index: 1035; }
}

/* ---------- Tarjetas genéricas ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(15,30,54,.04); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .95rem 1.15rem; border-bottom: 1px solid var(--line); }
.panel-h h2, .panel-h h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.panel-b { padding: 1.15rem; }
.table { --bs-table-bg: transparent; margin: 0; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; border-bottom-width: 1px; white-space: nowrap; background: #f8fafd; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { --bs-table-hover-bg: var(--b-50); }

.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; height: 100%; position: relative; overflow: hidden; }
.kpi .k-label { font-size: .78rem; color: var(--muted); font-weight: 500; }
.kpi .k-value { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin-top: .15rem; }
.kpi .k-sub { font-size: .76rem; color: var(--muted); }
.kpi .k-ico { position: absolute; right: .9rem; top: .9rem; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: var(--b-50); color: var(--b-600); }

/* ---------- Dashboard de habitaciones ---------- */
.status-filter { display: flex; gap: .5rem; flex-wrap: wrap; }
.sf-chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: .42rem .85rem; font-weight: 600; font-size: .84rem;
  display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); cursor: pointer; transition: all .15s;
}
.sf-chip .dot { width: 10px; height: 10px; border-radius: 50%; }
.sf-chip .n { background: #eef2f8; border-radius: 999px; padding: 0 .5rem; font-size: .76rem; }
.sf-chip.active { border-color: var(--b-600); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.dot.green { background: var(--st-green); } .dot.red { background: var(--st-red); } .dot.yellow { background: var(--st-yellow); } .dot.gray { background: var(--st-gray); } .dot.all { background: var(--b-600); }

.rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: .9rem; }
.room-card {
  position: relative; border-radius: 16px; padding: .85rem .9rem .8rem; background: var(--card); border: 1px solid var(--line); cursor: pointer;
  min-height: 150px; display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; text-align: left; width: 100%; color: var(--ink);
  border-top: 6px solid var(--st-gray);
}
.room-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,30,54,.10); }
.room-card.green { border-top-color: var(--st-green); background: linear-gradient(180deg, var(--st-green-bg), #fff 70%); }
.room-card.red { border-top-color: var(--st-red); background: linear-gradient(180deg, var(--st-red-bg), #fff 70%); }
.room-card.yellow { border-top-color: var(--st-yellow); background: linear-gradient(180deg, var(--st-yellow-bg), #fff 70%); }
.room-card.gray { border-top-color: var(--st-gray); background: repeating-linear-gradient(135deg, #f4f6f9, #f4f6f9 10px, #eef1f5 10px, #eef1f5 20px); color: #475569; }
.rc-num { font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.rc-name { font-weight: 600; font-size: .88rem; margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-meta { font-size: .76rem; color: var(--muted); margin-top: .15rem; }
.rc-status { margin-top: auto; padding-top: .55rem; display: flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 700; }
.green .rc-status { color: var(--st-green); } .red .rc-status { color: var(--st-red); } .yellow .rc-status { color: #a07800; } .gray .rc-status { color: var(--st-gray); }
.rc-guest { font-size: .76rem; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-more { position: absolute; top: .55rem; right: .6rem; color: var(--muted); }
.room-card.add { border: 2px dashed var(--b-200); background: var(--b-50); color: var(--b-700); align-items: center; justify-content: center; font-weight: 600; border-top-width: 2px; }
.room-card.add i { font-size: 1.8rem; }
.sorting .room-card { cursor: grab; animation: wiggle .35s ease-in-out infinite alternate; }
@keyframes wiggle { from { transform: rotate(-.6deg); } to { transform: rotate(.6deg); } }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }

.list-mini { list-style: none; padding: 0; margin: 0; }
.list-mini li { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.list-mini li:last-child { border-bottom: 0; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--b-100); color: var(--b-700); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 1.6rem 1rem; }
.empty i { font-size: 2rem; display: block; margin-bottom: .4rem; color: var(--b-300); }

/* ---------- Calendario (tape chart) ---------- */
.tape { overflow-x: auto; }
.tape table { border-collapse: separate; border-spacing: 0; min-width: 900px; width: 100%; }
.tape th, .tape td { border-bottom: 1px solid var(--line); border-right: 1px solid #eef2f8; padding: 0; height: 44px; }
.tape th.day { font-size: .72rem; text-align: center; color: var(--muted); font-weight: 600; padding: .35rem .2rem; background: #f8fafd; min-width: 54px; }
.tape th.day.today { background: var(--b-100); color: var(--b-800); }
.tape th.day.we { background: #f1f4f9; }
.tape td.room { position: sticky; left: 0; background: var(--card); z-index: 2; padding: 0 .7rem; font-weight: 700; min-width: 140px; white-space: nowrap; font-size: .85rem; }
.tape td.cell a { display: block; height: 100%; }
.tape td.cell:hover { background: var(--b-50); }
.tape .bar { display: flex; align-items: center; height: 34px; margin: 4px 2px; border-radius: 9px; padding: 0 .55rem; color: #fff; font-size: .76rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar.pendiente { background: #e3a008; } .bar.confirmada { background: var(--b-600); } .bar.checkin { background: var(--st-red); } .bar.checkout { background: #8aa0bf; } .bar.mnt { background: repeating-linear-gradient(135deg, #94a3b8, #94a3b8 6px, #a5b2c5 6px, #a5b2c5 12px); }

/* ---------- Login / auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: radial-gradient(circle at 20% 20%, #2563eb 0, transparent 45%), linear-gradient(140deg, var(--b-950), var(--b-800)); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; }
.auth-form { display: grid; place-items: center; padding: 2rem 1.2rem; }
.auth-card { width: 100%; max-width: 400px; }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- Pasos / onboarding ---------- */
.step-badge { width: 30px; height: 30px; border-radius: 50%; background: var(--b-700); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; margin-right: .5rem; }
.logo-preview { width: 120px; height: 120px; border-radius: 18px; border: 2px dashed var(--b-200); background: var(--b-50); display: grid; place-items: center; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- Página pública ---------- */
.pub-hero { position: relative; color: #fff; padding: 4.2rem 0 6.5rem; background: linear-gradient(140deg, var(--b-950), var(--b-700)); overflow: hidden; }
.pub-hero.has-cover { background-size: cover; background-position: center; }
.pub-hero.has-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(140deg, rgba(7,23,51,.86), rgba(29,78,216,.55)); }
.pub-hero > * { position: relative; }
.pub-logo { width: 84px; height: 84px; border-radius: 20px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.pub-logo img { max-width: 90%; max-height: 90%; object-fit: contain; }
.search-box { margin-top: -3.6rem; position: relative; z-index: 5; }
.search-box .panel { box-shadow: 0 20px 45px rgba(15,30,54,.14); }
.pub-room { overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.pub-room .ph { aspect-ratio: 16/10; background: linear-gradient(135deg, var(--b-100), var(--b-50)); display: grid; place-items: center; color: var(--b-300); font-size: 3rem; }
.pub-room .ph img { width: 100%; height: 100%; object-fit: cover; }
.pub-room .body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.chip { display: inline-block; background: var(--b-50); color: var(--b-700); border-radius: 999px; padding: .15rem .6rem; font-size: .74rem; margin: 0 .25rem .3rem 0; }
.price { font-size: 1.35rem; font-weight: 800; color: var(--b-800); }

/* ---------- Toasts ---------- */
.toast-zone { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: 360px; }
.toast-msg { background: var(--card); border-radius: 12px; padding: .75rem 1rem; box-shadow: 0 12px 30px rgba(15,30,54,.18); border-left: 5px solid var(--b-600); font-size: .88rem; animation: slidein .25s ease; }
.toast-msg.success { border-left-color: var(--st-green); } .toast-msg.error { border-left-color: var(--st-red); } .toast-msg.warning { border-left-color: var(--st-yellow); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.nav-tabs-soft { border: 0; gap: .35rem; flex-wrap: nowrap; overflow-x: auto; }
.nav-tabs-soft .nav-link { border: 0; border-radius: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.nav-tabs-soft .nav-link.active { background: var(--b-700); color: #fff; }
.copy-field { display: flex; gap: .4rem; }
.copy-field input { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; background: #f8fafd; }
code.k { background: #f1f5fb; color: var(--b-800); padding: .15rem .4rem; border-radius: 6px; }
pre.code { background: var(--b-950); color: #d6e4ff; border-radius: 12px; padding: 1rem; font-size: .8rem; overflow-x: auto; }

@media print {
  .sidebar, .topbar, .no-print, .impersonate, .toast-zone { display: none !important; }
  .main { margin: 0; } .content { padding: 0; } body { background: #fff; }
  .panel { border: 0; box-shadow: none; }
}

/* Ajustes responsivos */
.min-w-0 { min-width: 0; }
.list-mini li > .badge, .list-mini li > .btn { flex-shrink: 0; }
@media (max-width: 575.98px) {
  .rooms-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .room-card { min-height: 138px; padding: .7rem .7rem .65rem; }
  .rc-num { font-size: 1.4rem; }
  .status-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; width: 100%; }
  .sf-chip { white-space: nowrap; }
  .panel-b { padding: .9rem; }
  .kpi .k-value { font-size: 1.3rem; }
  .kpi .k-ico { width: 32px; height: 32px; font-size: 1rem; }
}
.tape table { table-layout: fixed; }
.tape th.day:first-child, .tape td.room { width: 150px; }
.tape th.day { width: auto; min-width: 0; }
.tape table { min-width: calc(150px + var(--tape-days, 14) * 56px); }

/* ---------- Calendario mensual de reservas ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { margin-bottom: 6px; }
.cal-head div { text-align: center; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cal-day {
  position: relative; min-height: 96px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: .45rem .5rem;
  display: flex; flex-direction: column; align-items: stretch; text-align: left; cursor: pointer; transition: all .12s; color: var(--ink);
}
.cal-day:hover { border-color: var(--b-300); box-shadow: 0 6px 16px rgba(15,30,54,.08); transform: translateY(-1px); }
.cal-day.other { background: #f8fafd; color: #a3b0c2; }
.cal-day.past .cal-num { color: #94a3b8; }
.cal-day.today { border: 2px solid var(--b-600); background: var(--b-50); }
.cal-day.today .cal-num { background: var(--b-700); color: #fff; }
.cal-day.sel { box-shadow: 0 0 0 3px rgba(37,99,235,.25); }
.cal-num { font-weight: 800; font-size: .95rem; width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; }
.cal-badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: .25rem; }
.cb { display: inline-flex; align-items: center; gap: 2px; font-size: .72rem; font-weight: 700; border-radius: 7px; padding: 1px 6px; }
.cb i { font-size: .72rem; }
.cb.in { background: var(--st-green-bg); color: var(--st-green); }
.cb.stay { background: var(--b-100); color: var(--b-700); }
.cb.out { background: var(--st-red-bg); color: var(--st-red); }
.cal-occ { margin-top: auto; height: 5px; border-radius: 4px; background: #e8eef7; overflow: hidden; display: block; }
.cal-occ span { display: block; height: 100%; background: var(--b-500); border-radius: 4px; }
.cal-occ span.full { background: var(--st-red); }
.day-sec { margin-bottom: .6rem; }
.day-sec-h { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .86rem; padding: .5rem 0 .3rem; border-bottom: 1px solid var(--line); }
.day-res { display: flex; align-items: center; gap: .7rem; padding: .6rem .3rem; border-bottom: 1px dashed var(--line); color: var(--ink); border-radius: 8px; }
.day-res:hover { background: var(--b-50); color: var(--ink); }
.day-res:last-child { border-bottom: 0; }
.text-capitalize-first::first-letter { text-transform: uppercase; }
@media (max-width: 575.98px) {
  .cal-grid { gap: 3px; }
  .cal-day { min-height: 64px; padding: .25rem; border-radius: 9px; }
  .cal-num { width: 22px; height: 22px; font-size: .8rem; }
  .cb { padding: 0 3px; font-size: .62rem; }
  .cb i { display: none; }
}
.legend .cb i { display: inline !important; }

/* Modal de acciones de la habitación */
.rc-wrap { position: relative; }
.room-modal { border: 0; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(7,23,51,.35); }
.room-modal .rm-head { padding: 1.1rem 1.2rem .9rem; border-top: 6px solid var(--st-gray); }
.room-modal .rm-head.green { border-top-color: var(--st-green); background: linear-gradient(180deg, var(--st-green-bg), #fff); }
.room-modal .rm-head.red { border-top-color: var(--st-red); background: linear-gradient(180deg, var(--st-red-bg), #fff); }
.room-modal .rm-head.yellow { border-top-color: var(--st-yellow); background: linear-gradient(180deg, var(--st-yellow-bg), #fff); }
.room-modal .rm-head.gray { border-top-color: var(--st-gray); background: linear-gradient(180deg, var(--st-gray-bg), #fff); }
.rm-num { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.rm-status { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: .15rem .6rem; background: #fff; margin-top: .25rem; }
.green .rm-status { color: var(--st-green); } .red .rm-status { color: var(--st-red); } .yellow .rm-status { color: #a07800; } .gray .rm-status { color: var(--st-gray); }
.room-modal .rc-actions { list-style: none; padding: 0; margin: 0; }
.room-modal .rc-actions .dropdown-item { display: flex; align-items: center; padding: .7rem .8rem; border-radius: 12px; font-weight: 500; color: var(--ink); white-space: normal; }
.room-modal .rc-actions .dropdown-item:hover { background: var(--b-50); }
.room-modal .rc-actions .dropdown-item i { font-size: 1.1rem; width: 24px; }
.room-modal .rc-actions .dropdown-divider { margin: .4rem 0; border-color: var(--line); }
.legend .cb i { display: inline !important; }

/* Menú de opciones de las cards: ventana centrada en la pantalla */
.rc-wrap { position: relative; }
.rc-wrap .dropdown-menu.show {
  position: fixed !important; top: 50% !important; left: 50% !important; right: auto !important; bottom: auto !important;
  transform: translate(-50%, -50%) !important; margin: 0 !important; z-index: 1060;
  width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
  border-radius: 18px; padding: .6rem .4rem; box-shadow: 0 24px 60px rgba(7,23,51,.35) !important; animation: rcPop .16s ease;
}
.rc-wrap .dropdown-menu .dropdown-header { font-size: 1.05rem; padding: .5rem 1rem .6rem; color: var(--ink); white-space: normal; }
.rc-wrap .dropdown-menu .dropdown-item { padding: .62rem 1rem; border-radius: 10px; }
.rc-wrap .dropdown-menu .dropdown-item:hover { background: var(--b-50); }
.rc-backdrop { position: fixed; inset: 0; background: rgba(7,23,51,.45); z-index: 1059; display: none; }
.rc-backdrop.show { display: block; animation: rcFade .16s ease; }
@keyframes rcPop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes rcFade { from { opacity: 0; } to { opacity: 1; } }
.legend .cb i { display: inline !important; }

/* Menú de opciones de las cards: siempre hacia abajo y en primer plano */
.rc-wrap { position: relative; }
.rc-wrap .dropdown-menu { top: calc(100% + 4px); left: 0; z-index: 1045; min-width: 250px; box-shadow: 0 16px 40px rgba(15,30,54,.22) !important; }
.rc-wrap .dropdown-menu.align-right { left: auto; right: 0; }
.rc-wrap.open-menu { z-index: 1045; }

/* ---------- WhatsApp: subpestañas y plantillas de notificación ---------- */
.wa-subtabs .nav-link { border-radius: 999px; padding: .4rem 1rem; color: var(--b-800); background: var(--b-50); margin-right: .4rem; font-size: .9rem; }
.wa-subtabs .nav-link.active { background: var(--b-700); color: #fff; }
.nt-lista { padding: .5rem; position: sticky; top: 80px; }
.nt-grupo { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: .7rem .6rem .35rem; }
.nt-item { display: flex; align-items: center; gap: .55rem; width: 100%; border: 0; background: none; text-align: left; padding: .55rem .6rem; border-radius: 10px; color: var(--ink); font-size: .9rem; }
.nt-item i { color: var(--b-600); width: 1.1rem; }
.nt-item:hover { background: var(--b-50); }
.nt-item.active { background: var(--b-100); font-weight: 600; }
.nt-punto { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; flex: none; }
.nt-punto.on { background: var(--st-green); box-shadow: 0 0 0 3px #16a34a22; }
.nt-texto { font-size: .88rem; line-height: 1.45; resize: vertical; }
.nt-var { border: 1px solid var(--b-200); background: var(--b-50); color: var(--b-800); border-radius: 6px; font: 500 .75rem ui-monospace, SFMono-Regular, Menlo, monospace; padding: .15rem .45rem; }
.nt-var:hover { background: var(--b-100); }
.nt-emojis { display: flex; flex-wrap: wrap; gap: 2px; }
.nt-emoji { border: 0; background: none; font-size: 1.1rem; line-height: 1; padding: .25rem; border-radius: 6px; }
.nt-emoji:hover { background: var(--b-50); }
.nt-chat { background: #e5ddd5 radial-gradient(#d9d0c7 1px, transparent 1px) 0 0/14px 14px; border-radius: 12px; padding: 1rem .8rem; min-height: 260px; }
.nt-burbuja { background: #dcf8c6; border-radius: 10px 0 10px 10px; padding: .5rem .65rem .3rem; margin-left: auto; max-width: 95%; box-shadow: 0 1px 1px #0000001f; font-size: .87rem; color: #111b21; word-wrap: break-word; }
.nt-burbuja a { color: #027eb5; }
.nt-meta { text-align: right; font-size: .68rem; color: #667781; margin-top: .15rem; }
.nt-meta i { color: #53bdeb; }
@media (max-width: 991.98px) { .nt-lista { position: static; } }

/* ---------- Selector de país con bandera ---------- */
.pais-sel { position: relative; }
.pais-btn { display: flex; align-items: center; gap: .55rem; min-height: calc(1.5em + .75rem + 2px); }
.pais-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pais-flag { width: 1.4rem; height: 1.05rem; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px #0000001a; flex: none; }
.pais-flag-ico { width: 1.4rem; text-align: center; color: var(--muted); flex: none; }
.pais-menu { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1060; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px #0f1e3626; overflow: hidden; min-width: 240px; }
.pais-sel.abierto .pais-menu { display: block; }
.pais-lista { max-height: 280px; overflow-y: auto; padding: .3rem; }
.pais-op { display: flex; align-items: center; gap: .6rem; width: 100%; border: 0; background: none; text-align: left; padding: .45rem .55rem; border-radius: 8px; font-size: .92rem; color: var(--ink); }
.pais-op:hover, .pais-op.activo { background: var(--b-50); }
.pais-op.sel { font-weight: 600; color: var(--b-700); }
.pais-sep { border-top: 1px solid var(--line); margin: .3rem .4rem; }
.id-estado:empty { display: none; }

/* ---------- Estado de pago de las reservas (calendario) ---------- */
:root {
  --pay-pagado: #16a34a;   --pay-pagado-bg: #e3f6ea;
  --pay-parcial: #c98a00;  --pay-parcial-bg: #fff3cf;
  --pay-revisar: #7c3aed;  --pay-revisar-bg: #efe7fd;
  --pay-sin_pago: #dc2626; --pay-sin_pago-bg: #fde8e8;
}
.cal-pills { display: flex; flex-direction: column; gap: 3px; margin-top: .3rem; min-width: 0; }
.cp { display: flex; align-items: center; gap: 4px; font-size: .72rem; line-height: 1.25; border-radius: 6px; padding: 2px 6px; min-width: 0;
  border-left: 3px solid var(--pc); background: var(--pbg); color: var(--pc); }
.cp i { font-size: .7rem; flex: none; }
.cp b { flex: none; }
.cp .cp-n { color: var(--ink); opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp.k-out { opacity: .75; }
.cp-mas { font-size: .68rem; color: var(--muted); font-weight: 600; padding-left: 2px; }
.pay-pagado { --pc: var(--pay-pagado); --pbg: var(--pay-pagado-bg); }
.pay-parcial { --pc: var(--pay-parcial); --pbg: var(--pay-parcial-bg); }
.pay-revisar { --pc: var(--pay-revisar); --pbg: var(--pay-revisar-bg); }
.pay-sin_pago { --pc: var(--pay-sin_pago); --pbg: var(--pay-sin_pago-bg); }
.cp-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--pbg); border: 2px solid var(--pc); vertical-align: -1px; }
.day-res[class*="pay-"] { border-left: 4px solid var(--pc); padding-left: .6rem; margin-bottom: 2px; }
.day-res[class*="pay-"] .avatar { background: var(--pbg); color: var(--pc); }
.day-res .pay-txt { color: var(--pc); font-weight: 600; }
.cal-day.other .cp { opacity: .55; }
@media (max-width: 575.98px) {
  .cal-pills { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .cp { padding: 1px 3px; font-size: .6rem; border-left-width: 2px; }
  .cp i, .cp .cp-n { display: none; }
  .cp-mas { font-size: .58rem; }
}

/* ---------- Horario especial y salida vencida ---------- */
.horario-box { background: var(--b-50); border: 1px dashed var(--b-200); border-radius: 12px; padding: .75rem .9rem .6rem; }
.room-card .rc-vencida { display: inline-flex; align-items: center; gap: 4px; margin-top: .35rem; font-size: .72rem; font-weight: 700; color: #fff; background: var(--st-red);
  border-radius: 999px; padding: 2px 8px; animation: vencida 1.6s ease-in-out infinite; }
.room-card.vencida { box-shadow: 0 0 0 3px #dc262640; }
@keyframes vencida { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .room-card .rc-vencida { animation: none; } }
.hora-esp { color: var(--b-700); font-weight: 600; }

/* ---------- Botón de reservar (verde) ---------- */
.btn-reservar { --bs-btn-color: #fff; --bs-btn-bg: #16a34a; --bs-btn-border-color: #16a34a; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #15803d;
  --bs-btn-hover-border-color: #15803d; --bs-btn-active-color: #fff; --bs-btn-active-bg: #166534; --bs-btn-active-border-color: #166534;
  --bs-btn-disabled-bg: #16a34a; --bs-btn-disabled-border-color: #16a34a; --bs-btn-disabled-color: #fff; --bs-btn-focus-shadow-rgb: 22, 163, 74;
  box-shadow: 0 4px 12px rgba(22,163,74,.25); }
.btn-reservar i { margin-right: .15rem; }
.soft-box { background: var(--b-50); }
.note-box { background: var(--st-yellow-bg); }

/* ---------- Controles de apariencia en la barra superior ---------- */
.vista-ctrls { display: inline-flex; align-items: center; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px;
  box-shadow: 0 1px 2px rgba(15,30,54,.05); flex-shrink: 0; }
.vc-btn, .vc-nivel { border: 0; background: none; color: var(--ink); height: 2.1rem; min-width: 2.1rem; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  font-weight: 700; font-size: .95rem; line-height: 1; padding: 0 .45rem; transition: background .15s; }
.vc-btn:hover:not(:disabled), .vc-nivel:hover { background: var(--b-50); color: var(--b-700); }
.vc-btn:disabled { opacity: .35; cursor: not-allowed; }
.vc-btn[data-tema] i { font-size: 1rem; color: var(--b-600); }
.vc-a small { font-size: .7em; font-weight: 800; margin-left: 1px; }
.vc-a[data-texto="1"] { font-size: 1.08rem; }
.vc-nivel { font-size: .72rem; font-weight: 600; color: var(--muted); min-width: 2.7rem; }
.topbar-salto { display: none; }
@media (max-width: 767.98px) { .topbar-salto { display: block; } }
.vc-sep { width: 1px; height: 1.2rem; background: var(--line); margin: 0 3px; }
@media (max-width: 767.98px) {
  /* en celular los controles bajan a su propia fila, centrados */
  .topbar { flex-wrap: wrap; row-gap: .45rem; }
  .topbar h1 { flex: 1 1 0; min-width: 0; }
  .topbar .vista-ctrls { order: 5; margin: 0 auto; }
  .topbar-salto { order: 4; flex-basis: 100%; height: 0; }
  .topbar-acciones { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 575.98px) {
  .topbar-acciones .dropdown > .btn .bi-chevron-down { display: none; }
}

/* ==========================================================
   Modo oscuro (html[data-bs-theme=dark], solo en el panel)
   ========================================================== */
[data-bs-theme="dark"] {
  --bg: #0b1322; --card: #111c30; --line: #23324d; --ink: #e6edf8; --muted: #93a4bf;
  --b-50: #142443; --b-100: #1b3160; --b-200: #2a4a8a; --b-300: #5d8fe0;
  --st-green-bg: #10301f; --st-red-bg: #3a1619; --st-yellow-bg: #3a2f0d; --st-gray-bg: #1f2937;
  --pay-pagado: #34d399; --pay-pagado-bg: #0f2e22; --pay-parcial: #fbbf24; --pay-parcial-bg: #36290a;
  --pay-revisar: #a78bfa; --pay-revisar-bg: #251a45; --pay-sin_pago: #f87171; --pay-sin_pago-bg: #3a1619;
  --bs-body-bg: #0b1322; --bs-body-color: #e6edf8; --bs-border-color: #23324d; --bs-secondary-bg: #142443; --bs-tertiary-bg: #111c30;
  --bs-link-color: #7fb0ff; --bs-link-color-rgb: 127, 176, 255; --bs-link-hover-color: #a9c9ff; --bs-emphasis-color: #fff;
  --bs-secondary-color: #93a4bf; color-scheme: dark;
}
[data-bs-theme="dark"] body { background: var(--bg); color: var(--ink); }
[data-bs-theme="dark"] .topbar { background: rgba(11,19,34,.9); }
[data-bs-theme="dark"] .topbar .burger { background: var(--card); color: var(--ink); }
[data-bs-theme="dark"] .sidebar { background: linear-gradient(180deg, #060d1c 0%, #0b1a36 100%); }
[data-bs-theme="dark"] .sidebar .nav-link.active { background: var(--b-100); color: #fff; box-shadow: none; }
[data-bs-theme="dark"] .sidebar .nav-link.active i { color: var(--b-300); }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: #0d1729; border-color: #2a3a58; color: var(--ink); }
[data-bs-theme="dark"] .form-control::placeholder { color: #6f809c; }
[data-bs-theme="dark"] .form-control:disabled, [data-bs-theme="dark"] .form-control[readonly] { background-color: #142036; }
[data-bs-theme="dark"] .form-label { color: #c3cfe2; }
[data-bs-theme="dark"] .input-group-text { background: #142036; border-color: #2a3a58; color: var(--muted); }
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: #1a2742; --bs-btn-color: var(--ink); --bs-btn-border-color: #2a3a58; --bs-btn-hover-bg: #22335a;
  --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #34507f; --bs-btn-active-bg: #22335a; --bs-btn-active-color: #fff; }
[data-bs-theme="dark"] .btn-light.border { border-color: #2a3a58 !important; }
[data-bs-theme="dark"] .btn-soft { background: var(--b-50); color: #9cc0ff; border-color: var(--b-100); }
[data-bs-theme="dark"] .btn-soft:hover { background: var(--b-100); color: #fff; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #9cc0ff; --bs-btn-border-color: var(--b-200); }
[data-bs-theme="dark"] .text-bg-light { background: #1a2742 !important; color: var(--ink) !important; }
[data-bs-theme="dark"] .bg-light { background: var(--b-50) !important; }
[data-bs-theme="dark"] .table thead th { background: #0f1a2d; }
[data-bs-theme="dark"] .table { --bs-table-color: var(--ink); --bs-table-border-color: var(--line); }
[data-bs-theme="dark"] .sf-chip .n { background: #1a2742; }
[data-bs-theme="dark"] .room-card.green { background: linear-gradient(180deg, var(--st-green-bg), var(--card) 70%); }
[data-bs-theme="dark"] .room-card.red { background: linear-gradient(180deg, var(--st-red-bg), var(--card) 70%); }
[data-bs-theme="dark"] .room-card.yellow { background: linear-gradient(180deg, var(--st-yellow-bg), var(--card) 70%); }
[data-bs-theme="dark"] .room-card.gray { background: repeating-linear-gradient(135deg, #141e31, #141e31 10px, #18233a 10px, #18233a 20px); color: #a9b6cb; }
[data-bs-theme="dark"] .yellow .rc-status, [data-bs-theme="dark"] .yellow .rm-status { color: #f5c542; }
[data-bs-theme="dark"] .rc-guest { color: #b4c1d6; }
[data-bs-theme="dark"] .room-card.add { color: #9cc0ff; }
[data-bs-theme="dark"] .room-modal .rm-head.green { background: linear-gradient(180deg, var(--st-green-bg), var(--card)); }
[data-bs-theme="dark"] .room-modal .rm-head.red { background: linear-gradient(180deg, var(--st-red-bg), var(--card)); }
[data-bs-theme="dark"] .room-modal .rm-head.yellow { background: linear-gradient(180deg, var(--st-yellow-bg), var(--card)); }
[data-bs-theme="dark"] .room-modal .rm-head.gray { background: linear-gradient(180deg, var(--st-gray-bg), var(--card)); }
[data-bs-theme="dark"] .rm-status { background: var(--card); }
[data-bs-theme="dark"] .modal-content, [data-bs-theme="dark"] .dropdown-menu { background: var(--card); color: var(--ink); }
[data-bs-theme="dark"] .room-modal .rc-actions .dropdown-item { color: var(--ink); }
[data-bs-theme="dark"] .cal-day.other { background: #0e1829; color: #5c6d89; }
[data-bs-theme="dark"] .cal-day.past .cal-num { color: #6f809c; }
[data-bs-theme="dark"] .cal-occ { background: #1d2a44; }
[data-bs-theme="dark"] .tape th.day { background: #0f1a2d; }
[data-bs-theme="dark"] .tape th.day.we { background: #0d1626; }
[data-bs-theme="dark"] .tape th, [data-bs-theme="dark"] .tape td { border-right-color: #1a2742; }
[data-bs-theme="dark"] .avatar { color: #9cc0ff; }
[data-bs-theme="dark"] .hora-esp { color: #8fb6ff; }
[data-bs-theme="dark"] .impersonate { background: #3a2f0d; border-color: #5a4710; color: #f5d77a; }
[data-bs-theme="dark"] code.k { background: #1a2742; color: #b9d1ff; }
[data-bs-theme="dark"] .copy-field input { background: #0d1729; }
[data-bs-theme="dark"] .nt-var { color: #b9d1ff; }
[data-bs-theme="dark"] .pais-flag { box-shadow: 0 0 0 1px #ffffff26; }
[data-bs-theme="dark"] .text-dark { color: var(--ink) !important; }
[data-bs-theme="dark"] .border { border-color: var(--line) !important; }
[data-bs-theme="dark"] .list-group-item { background: var(--card); color: var(--ink); border-color: var(--line); }
[data-bs-theme="dark"] .list-group-item-action:hover { background: var(--b-50); }
[data-bs-theme="dark"] .progress { background: #1d2a44; }
[data-bs-theme="dark"] .accordion-button:not(.collapsed) { background: var(--b-50); color: var(--ink); }
[data-bs-theme="dark"] .vista-ctrls { box-shadow: none; }
[data-bs-theme="dark"] .vc-btn[data-tema] i { color: #fbbf24; }
[data-bs-theme="dark"] .wa-subtabs .nav-link:not(.active) { color: #9cc0ff; }
[data-bs-theme="dark"] .nav-tabs-soft .nav-link:not(.active):hover { color: var(--ink); }

/* ---------- Selector con buscador (habitaciones) ---------- */
.sb { position: relative; }
.sb-nativo { position: absolute !important; opacity: 0; pointer-events: none; height: 1px !important; width: 1px !important; bottom: 0; left: 50%; }
.sb-btn { display: flex; align-items: center; gap: .55rem; min-height: calc(1.5em + 1.1rem + 2px); overflow: hidden; }
.sb-btn .sb-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.sb-btn .sb-txt small { color: var(--muted); font-weight: 400; }
.sb-menu { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 1060; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(15,30,54,.18); overflow: hidden; min-width: 280px; }
.sb.abierto .sb-menu { display: block; }
.sb-top { padding: .55rem; border-bottom: 1px solid var(--line); }
.sb-buscar { position: relative; }
.sb-buscar i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.sb-buscar input { padding-left: 2rem; }
.sb-filtros { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .4rem; font-size: .78rem; color: var(--muted); }
.sb-solo { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; color: var(--ink); font-weight: 500; }
.sb-solo .form-check-input { margin: 0; }
.sb-cuenta { margin-left: auto; }
.sb-lista { max-height: 320px; overflow-y: auto; padding: .3rem; }
.sb-op { display: flex; align-items: center; gap: .65rem; width: 100%; border: 0; background: none; text-align: left; padding: .45rem .55rem; border-radius: 10px; color: var(--ink); }
.sb-op:hover, .sb-op.activo { background: var(--b-50); }
.sb-op.sel { box-shadow: inset 3px 0 0 var(--b-600); }
.sb-op.ocupada { opacity: .6; }
.sb-num { flex: none; min-width: 2.6rem; height: 2.1rem; padding: 0 .4rem; border-radius: 9px; background: var(--b-100); color: var(--b-700); font-weight: 800;
  display: inline-grid; place-items: center; font-size: .9rem; }
.sb-num.sm { min-width: 2.2rem; height: 1.7rem; font-size: .82rem; border-radius: 7px; }
.sb-op .sb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sb-op .sb-txt b { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-op .sb-txt small { color: var(--muted); font-size: .76rem; }
.sb-chip { flex: none; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: .12rem .5rem; }
.sb-chip.si { background: var(--st-green-bg); color: var(--st-green); }
.sb-chip.no { background: var(--st-red-bg); color: var(--st-red); }
.sb-vacio { padding: 1rem; text-align: center; color: var(--muted); font-size: .88rem; }
[data-bs-theme="dark"] .sb-num { color: #9cc0ff; }
[data-bs-theme="dark"] .sb-chip.si { color: #4ade80; }
[data-bs-theme="dark"] .sb-chip.no { color: #f87171; }
@media (max-width: 575.98px) { .sb-lista { max-height: 50vh; } }

/* ---------- Paginación en cuadritos (modal del día) ---------- */
.pg-zona { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.pg-zona.d-none { display: none !important; }
.panel-pag { padding: .6rem 1.15rem .9rem; border-top: 1px solid var(--line); }
.pg-info { font-size: .8rem; color: var(--muted); }
.pg-sqs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg-sq { min-width: 2.1rem; height: 2.1rem; padding: 0 .35rem; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px;
  font-weight: 600; font-size: .85rem; display: inline-grid; place-items: center; transition: all .12s; }
.pg-sq:hover:not(:disabled):not(.active) { border-color: var(--b-300); background: var(--b-50); color: var(--b-700); }
.pg-sq.active { background: var(--b-700); border-color: var(--b-700); color: #fff; }
.pg-sq:disabled { opacity: .4; cursor: not-allowed; }
.pg-gap { color: var(--muted); padding: 0 2px; }
.day-modal-h { align-items: flex-start; gap: .75rem; }
@media (max-width: 575.98px) { .day-modal-h { flex-wrap: wrap; } .day-modal-btns { width: 100%; justify-content: flex-end; } }
