/* ==========================================================================
   Casa Hotel Bellavista — Sistema de gestión hotelera
   Hoja de estilos principal (design system)
   Sin dependencias externas. Tema claro, paleta cálida de hospitalidad.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables / tokens de diseño
   -------------------------------------------------------------------------- */
:root {
  /* Marca */
  --sidebar-bg: #0f2b33;
  --sidebar-bg-2: #0b2128;
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-active: rgba(201, 162, 39, 0.16);
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --sidebar-text: #b9cdd2;
  --sidebar-text-strong: #ffffff;

  --gold: #c9a227;
  --gold-dark: #a9861d;
  --gold-light: #f0dfa5;
  --gold-soft: #fbf5e2;

  /* Semánticos */
  --success: #16a34a;
  --success-dark: #15803d;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-dark: #b45309;
  --warning-soft: #fef3c7;
  --info: #0284c7;
  --info-dark: #0369a1;
  --info-soft: #e0f2fe;
  --neutral: #6b7280;
  --neutral-soft: #f3f4f6;

  /* Superficies / neutros */
  --bg: #f4f6f8;
  --bg-alt: #eef1f4;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: #e3e8ec;
  --border-strong: #cdd5dc;

  /* Texto */
  --text: #1f2933;
  --text-soft: #52606d;
  --text-muted: #7b8794;
  --text-invert: #ffffff;

  /* Estados de habitación (contracto: verde/rojo/amarillo/gris) */
  --habitacion-verde: #16a34a;
  --habitacion-verde-bg: #ecfdf3;
  --habitacion-verde-border: #9de0b5;
  --habitacion-rojo: #dc2626;
  --habitacion-rojo-bg: #fef2f2;
  --habitacion-rojo-border: #f7b6b6;
  --habitacion-amarillo: #d97706;
  --habitacion-amarillo-bg: #fffbeb;
  --habitacion-amarillo-border: #f5d38a;
  --habitacion-gris: #64748b;
  --habitacion-gris-bg: #f1f5f9;
  --habitacion-gris-border: #cbd5e1;

  /* Layout */
  --sidebar-width: 256px;
  --sidebar-width-collapsed: 76px;
  --topbar-height: 64px;

  /* Radios */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Sombras */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 4px 12px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.16);

  /* Transiciones */
  --t-fast: 120ms ease;
  --t: 180ms ease;
  --t-slow: 280ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Tipografía */
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "Consolas",
    "Liberation Mono", monospace;

  --z-sidebar: 40;
  --z-topbar: 30;
  --z-overlay: 50;
  --z-toast: 60;
}

/* --------------------------------------------------------------------------
   2. Reset / bases
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5rem;
  font-weight: 650;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 0.75rem; }

a {
  color: var(--info-dark);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--info); text-decoration: underline; }

img { max-width: 100%; height: auto; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

code, kbd, pre, samp { font-family: var(--font-mono); font-size: 0.92em; }

::selection { background: var(--gold-light); color: var(--text); }

:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Scrollbars discretas */
* { scrollbar-width: thin; scrollbar-color: #c3ccd4 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb {
  background: #c3ccd4;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #9aa7b2; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* --------------------------------------------------------------------------
   3. Utilidades
   -------------------------------------------------------------------------- */
.u-muted { color: var(--text-muted) !important; }
.u-soft { color: var(--text-soft) !important; }
.u-bold { font-weight: 650 !important; }
.u-center { text-align: center !important; }
.u-right { text-align: right !important; }
.u-nowrap { white-space: nowrap; }
.u-mono { font-family: var(--font-mono); }
.u-small { font-size: 0.82rem; }
.u-tiny { font-size: 0.74rem; }
.u-upper {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 650;
}
.u-mt-0 { margin-top: 0 !important; }
.u-mt-1 { margin-top: 0.5rem !important; }
.u-mt-2 { margin-top: 1rem !important; }
.u-mt-3 { margin-top: 1.5rem !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-1 { margin-bottom: 0.5rem !important; }
.u-mb-2 { margin-bottom: 1rem !important; }
.u-mb-3 { margin-bottom: 1.5rem !important; }
.u-flex { display: flex !important; }
.u-flex-wrap { flex-wrap: wrap; }
.u-flex-between { display: flex; align-items: center; justify-content: space-between; }
.u-gap-1 { gap: 0.5rem; }
.u-gap-2 { gap: 1rem; }
.u-grow { flex: 1 1 auto; min-width: 0; }
.u-hide { display: none !important; }
.u-text-success { color: var(--success-dark) !important; }
.u-text-danger { color: var(--danger-dark) !important; }
.u-text-warning { color: var(--warning-dark) !important; }
.u-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Rejillas utilitarias */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
.grid-1-2 { grid-template-columns: 1fr 2fr; }

/* --------------------------------------------------------------------------
   4. Layout general (sidebar + topbar + contenido)
   -------------------------------------------------------------------------- */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  color: var(--sidebar-text);
  z-index: var(--z-sidebar);
  transition: width var(--t-slow), transform var(--t-slow);
  box-shadow: 2px 0 16px rgba(9, 24, 29, 0.18);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: var(--topbar-height);
  padding: 0 1.1rem;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--sidebar-border);
  color: var(--sidebar-text-strong);
  text-decoration: none;
  overflow: hidden;
}
.sidebar__brand:hover { text-decoration: none; color: #fff; }

.sidebar__logo {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--gold) 0%, #b08c1c 100%);
  color: #14232a;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 10px rgba(201, 162, 39, 0.35);
}
.sidebar__logo svg { width: 21px; height: 21px; }

.sidebar__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.sidebar__brand-name {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.sidebar__brand-sub {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--gold-light);
  opacity: 0.9;
  white-space: nowrap;
}

.sidebar__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.6rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.sidebar__section {
  margin: 0.9rem 0.55rem 0.4rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #6f8a92;
  white-space: nowrap;
  transition: opacity var(--t);
}
.sidebar__section:first-child { margin-top: 0.25rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.56rem 0.7rem;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-link svg {
  width: 18px; height: 18px;
  flex: 0 0 18px;
  stroke-width: 1.8;
  opacity: 0.85;
}
.nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-strong);
  text-decoration: none;
}
.nav-link.is-active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -0.6rem;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}
.nav-link.is-active svg { opacity: 1; color: var(--gold-light); }

.nav-link__label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }

.nav-badge {
  flex: 0 0 auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22);
  animation: badgePulse 2.4s ease-in-out infinite;
}
.nav-badge--gold {
  background: var(--gold);
  color: #1b2a30;
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25);
  animation: none;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22); }
  50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12); }
}

.sidebar__footer {
  flex: 0 0 auto;
  padding: 0.8rem;
  border-top: 1px solid var(--sidebar-border);
  font-size: 0.75rem;
  color: #6f8a92;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar__footer strong { color: var(--sidebar-text); }

/* Sidebar colapsado (escritorio, botón de la topbar) */
body.sidebar-collapsed .sidebar { width: var(--sidebar-width-collapsed); }
body.sidebar-collapsed .sidebar__brand-text,
body.sidebar-collapsed .nav-link__label,
body.sidebar-collapsed .sidebar__section,
body.sidebar-collapsed .sidebar__footer { opacity: 0; pointer-events: none; }
body.sidebar-collapsed .nav-link { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .nav-badge {
  position: absolute;
  top: 3px;
  right: 11px;
  min-width: 16px;
  height: 16px;
  font-size: 0.62rem;
  padding: 0 4px;
}
body.sidebar-collapsed .main { margin-left: var(--sidebar-width-collapsed); }

.main {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  transition: margin-left var(--t-slow);
}

/* --------------------------------------------------------------------------
   5. Topbar
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  height: var(--topbar-height);
  flex: 0 0 var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.topbar__toggle:hover { background: var(--bg-alt); color: var(--text); }
.topbar__toggle svg { width: 19px; height: 19px; }

.topbar__title {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.topbar__title h1 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__title .u-small { color: var(--text-muted); }

.topbar__spacer { flex: 1 1 auto; }

.topbar__live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--success-soft);
  color: var(--success-dark);
  font-size: 0.76rem;
  font-weight: 650;
  white-space: nowrap;
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
  animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
.topbar__live.is-offline { background: var(--danger-soft); color: var(--danger-dark); }
.topbar__live.is-offline .live-dot { background: var(--danger); animation: none; }

.topbar__user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.3rem 0.35rem 0.3rem 0.3rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  transition: background var(--t-fast);
}
.topbar__user:hover { background: var(--bg-alt); text-decoration: none; }

.avatar {
  width: 32px; height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #14414d, #0f2b33);
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.topbar__user-name { font-size: 0.83rem; font-weight: 600; line-height: 1.15; }
.topbar__user-role { font-size: 0.7rem; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   6. Contenido / página
   -------------------------------------------------------------------------- */
.content {
  flex: 1 1 auto;
  padding: 1.5rem;
  max-width: 1680px;
  width: 100%;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.35rem;
}
.page-head__title { margin: 0; font-size: 1.5rem; }
.page-head__sub { margin: 0.15rem 0 0; color: var(--text-muted); font-size: 0.88rem; }
.page-head__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  list-style: none;
  padding: 0;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 0.35rem; }
.breadcrumb li + li::before { content: "/"; color: var(--border-strong); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }

/* --------------------------------------------------------------------------
   7. Tarjetas
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.card--flat { box-shadow: none; }
.card--padded { padding: 1.25rem; }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
}
.card__header h2,
.card__header h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card__header h2 svg,
.card__header h3 svg { width: 17px; height: 17px; color: var(--text-muted); }
.card__actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.card__body { padding: 1.25rem; }
.card__body--flush { padding: 0; }
.card__footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.card--accent {
  border-top: 3px solid var(--gold);
}

/* --------------------------------------------------------------------------
   8. KPI tiles (dashboard)
   -------------------------------------------------------------------------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi {
  position: relative;
  display: flex;
  gap: 0.9rem;
  padding: 1.05rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
}
.kpi::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--kpi-accent, var(--border));
  opacity: 0.9;
}
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.kpi__icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--kpi-soft, var(--neutral-soft));
  color: var(--kpi-accent, var(--text-soft));
}
.kpi__icon svg { width: 22px; height: 22px; }

.kpi__body { min-width: 0; flex: 1 1 auto; }
.kpi__label {
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi__value {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.kpi__value small { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.kpi__meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.1rem;
}

.kpi--gold { --kpi-accent: var(--gold); --kpi-soft: var(--gold-soft); }
.kpi--teal { --kpi-accent: #0f766e; --kpi-soft: #ccfbf1; }
.kpi--green { --kpi-accent: var(--success); --kpi-soft: var(--success-soft); }
.kpi--red { --kpi-accent: var(--danger); --kpi-soft: var(--danger-soft); }
.kpi--orange { --kpi-accent: var(--warning); --kpi-soft: var(--warning-soft); }
.kpi--blue { --kpi-accent: var(--info); --kpi-soft: var(--info-soft); }
.kpi--slate { --kpi-accent: var(--habitacion-gris); --kpi-soft: var(--neutral-soft); }

.kpi__trend { font-size: 0.75rem; font-weight: 650; }
.kpi__trend.is-up { color: var(--success-dark); }
.kpi__trend.is-down { color: var(--danger-dark); }

/* Ocupación con barra */
.occupancy {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.35rem;
}
.occupancy__bar {
  flex: 1 1 auto;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  overflow: hidden;
}
.occupancy__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--success) 0%, #22c55e 55%, var(--gold) 100%);
  transition: width var(--t-slow);
}

/* --------------------------------------------------------------------------
   9. Botones
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.52rem 0.95rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast),
    color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  -webkit-user-select: none;
  user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}
.btn svg { width: 16px; height: 16px; flex: 0 0 16px; }

.btn--primary {
  background: linear-gradient(180deg, #113a44 0%, #0f2b33 100%);
  border-color: #0c242b;
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn--primary:hover { background: linear-gradient(180deg, #15505e 0%, #123640 100%); color: #fff; }

.btn--gold {
  background: linear-gradient(180deg, #d4ae35 0%, var(--gold) 100%);
  border-color: var(--gold-dark);
  color: #1b2a30;
  box-shadow: var(--shadow-xs);
}
.btn--gold:hover { background: linear-gradient(180deg, #dcb943 0%, #bd971f 100%); color: #14232a; }

.btn--secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--secondary:hover { background: var(--bg-alt); color: var(--text); }

.btn--success { background: var(--success); border-color: var(--success-dark); color: #fff; }
.btn--success:hover { background: #1aae50; color: #fff; }

.btn--danger { background: var(--danger); border-color: var(--danger-dark); color: #fff; }
.btn--danger:hover { background: #e52d2d; color: #fff; }

.btn--warning { background: var(--warning); border-color: var(--warning-dark); color: #fff; }
.btn--warning:hover { background: #e88a12; color: #fff; }

.btn--ghost { color: var(--text-soft); }
.btn--ghost:hover { background: var(--bg-alt); color: var(--text); }

.btn--outline-danger {
  background: var(--surface);
  border-color: #f2b9b9;
  color: var(--danger-dark);
}
.btn--outline-danger:hover { background: var(--danger-soft); color: var(--danger-dark); }

.btn--outline-success {
  background: var(--surface);
  border-color: #a7e0ba;
  color: var(--success-dark);
}
.btn--outline-success:hover { background: var(--success-soft); }

.btn--sm { padding: 0.32rem 0.62rem; font-size: 0.78rem; border-radius: var(--radius-xs); }
.btn--sm svg { width: 14px; height: 14px; flex-basis: 14px; }
.btn--lg { padding: 0.72rem 1.3rem; font-size: 0.95rem; border-radius: var(--radius); }
.btn--icon {
  padding: 0.42rem;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
}
.btn--icon.btn--sm { width: 28px; height: 28px; padding: 0.25rem; }
.btn--block { width: 100%; }

.btn-group { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------------------------
   10. Badges / chips / píldoras de estado
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.16rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--text-soft);
}
.badge svg { width: 12px; height: 12px; }

.badge--success { background: var(--success-soft); color: var(--success-dark); border-color: #b5e8c5; }
.badge--danger { background: var(--danger-soft); color: var(--danger-dark); border-color: #f7c4c4; }
.badge--warning { background: var(--warning-soft); color: var(--warning-dark); border-color: #f3d79a; }
.badge--info { background: var(--info-soft); color: var(--info-dark); border-color: #b6e2f8; }
.badge--neutral { background: var(--neutral-soft); color: var(--neutral); border-color: #dfe3e8; }
.badge--gold { background: var(--gold-soft); color: #7d6414; border-color: #ecdb9f; }
.badge--dark { background: var(--sidebar-bg); color: #fff; }
.badge--lg { font-size: 0.82rem; padding: 0.24rem 0.7rem; }
.badge--dot::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 7px;
}

/* Clases de estado canónicas (usadas por el filtro estado_clase) */
.estado-disponible, .estado-verde { background: var(--success-soft); color: var(--success-dark); border-color: #b5e8c5; }
.estado-ocupada, .estado-rojo { background: var(--danger-soft); color: var(--danger-dark); border-color: #f7c4c4; }
.estado-limpieza, .estado-amarillo { background: var(--warning-soft); color: var(--warning-dark); border-color: #f3d79a; }
.estado-mantenimiento, .estado-gris { background: var(--habitacion-gris-bg); color: #475569; border-color: #cbd5e1; }
.estado-pendiente { background: var(--info-soft); color: var(--info-dark); border-color: #b6e2f8; }
.estado-confirmada { background: var(--success-soft); color: var(--success-dark); border-color: #b5e8c5; }
.estado-check_in, .estado-activa { background: var(--gold-soft); color: #7d6414; border-color: #ecdb9f; }
.estado-finalizada { background: var(--habitacion-gris-bg); color: #475569; border-color: #cbd5e1; }
.estado-cancelada, .estado-anulada, .estado-anulado, .estado-no_show { background: var(--danger-soft); color: var(--danger-dark); border-color: #f7c4c4; }
.estado-abierta { background: var(--success-soft); color: var(--success-dark); border-color: #b5e8c5; }
.estado-cerrada { background: var(--habitacion-gris-bg); color: #475569; border-color: #cbd5e1; }
.estado-cobrado { background: var(--success-soft); color: var(--success-dark); border-color: #b5e8c5; }
.estado-pagada { background: var(--success-soft); color: var(--success-dark); border-color: #b5e8c5; }
.estado-ingreso { background: var(--success-soft); color: var(--success-dark); border-color: #b5e8c5; }
.estado-egreso { background: var(--danger-soft); color: var(--danger-dark); border-color: #f7c4c4; }
.estado-entrada { background: var(--success-soft); color: var(--success-dark); border-color: #b5e8c5; }
.estado-salida { background: var(--danger-soft); color: var(--danger-dark); border-color: #f7c4c4; }
.estado-ajuste, .estado-devolucion { background: var(--info-soft); color: var(--info-dark); border-color: #b6e2f8; }
.estado-venta { background: var(--gold-soft); color: #7d6414; border-color: #ecdb9f; }

.badge-estado { display: inline-flex; align-items: center; gap: 0.32rem; padding: 0.16rem 0.55rem; border-radius: var(--radius-pill); border: 1px solid transparent; font-size: 0.74rem; font-weight: 650; white-space: nowrap; }
.badge-estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-xs);
  background: var(--bg-alt);
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 600;
}

.pill-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.34rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--t-fast);
}
.pill-filter:hover { background: var(--bg-alt); color: var(--text); text-decoration: none; }
.pill-filter.is-active {
  background: var(--sidebar-bg);
  border-color: var(--sidebar-bg);
  color: #fff;
}
.pill-filter .pill-count {
  background: rgba(0, 0, 0, 0.07);
  border-radius: var(--radius-pill);
  padding: 0 0.35rem;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.pill-filter.is-active .pill-count { background: rgba(255, 255, 255, 0.18); }

/* --------------------------------------------------------------------------
   11. Mapa de habitaciones (centro visual)
   -------------------------------------------------------------------------- */
.rooms-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.9rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-xs);
}
.rooms-toolbar__group { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.rooms-toolbar__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 0.2rem;
}

.legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-soft);
}
.legend__item { display: inline-flex; align-items: center; gap: 0.42rem; white-space: nowrap; }
.legend__swatch {
  width: 14px; height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.legend__swatch--verde { background: var(--habitacion-verde); }
.legend__swatch--rojo { background: var(--habitacion-rojo); }
.legend__swatch--amarillo { background: var(--habitacion-amarillo); }
.legend__swatch--gris { background: var(--habitacion-gris); }
.legend__count { color: var(--text-muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }

.floor-group { margin-bottom: 1.75rem; }
.floor-group__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}
.floor-group__head h2 { margin: 0; font-size: 0.95rem; font-weight: 700; }
.floor-group__head::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--border);
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 1rem;
}

.room-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  border-left-width: 5px;
}
.room-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.room-card--verde { border-left-color: var(--habitacion-verde); background: linear-gradient(180deg, var(--habitacion-verde-bg) 0%, var(--surface) 62%); }
.room-card--rojo { border-left-color: var(--habitacion-rojo); background: linear-gradient(180deg, var(--habitacion-rojo-bg) 0%, var(--surface) 62%); }
.room-card--amarillo { border-left-color: var(--habitacion-amarillo); background: linear-gradient(180deg, var(--habitacion-amarillo-bg) 0%, var(--surface) 62%); }
.room-card--gris { border-left-color: var(--habitacion-gris); background: linear-gradient(180deg, var(--habitacion-gris-bg) 0%, var(--surface) 62%); }

.room-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem 0.4rem;
}
.room-card__numero {
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.room-card__tipo {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.room-card__estado-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
  margin-top: 0.45rem;
}
.room-card--verde .room-card__estado-dot { background: var(--habitacion-verde); box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18); }
.room-card--rojo .room-card__estado-dot { background: var(--habitacion-rojo); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16); }
.room-card--amarillo .room-card__estado-dot { background: var(--habitacion-amarillo); box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.16); }
.room-card--gris .room-card__estado-dot { background: var(--habitacion-gris); box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.16); }

.room-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  padding: 0 0.9rem 0.7rem;
  font-size: 0.78rem;
  color: var(--text-soft);
}
.room-card__meta span { display: inline-flex; align-items: center; gap: 0.28rem; }
.room-card__meta svg { width: 13px; height: 13px; opacity: 0.7; }

.room-card__guest {
  margin: 0 0.9rem 0.7rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed var(--border-strong);
  font-size: 0.8rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 34px;
}
.room-card__guest svg { width: 14px; height: 14px; color: var(--text-muted); flex: 0 0 14px; }
.room-card__guest strong { font-weight: 650; }
.room-card__guest--empty { color: var(--text-muted); font-style: italic; }

.room-card__actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.7rem 0.9rem 0.85rem;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
}
.room-card__actions .btn { flex: 1 1 auto; }

/* --------------------------------------------------------------------------
   12. Tablas
   -------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.table th,
.table td {
  padding: 0.68rem 0.9rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  z-index: 1;
  border-bottom: 1px solid var(--border);
}
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: #f8fafb; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.num,
.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.actions { text-align: right; white-space: nowrap; }
.table--compact th, .table--compact td { padding: 0.45rem 0.7rem; }
.table--zebra tbody tr:nth-child(even) { background: var(--surface-2); }
.table--zebra tbody tr:nth-child(even):hover { background: #f1f5f7; }
.table--bordered th, .table--bordered td { border: 1px solid var(--border); }
.table .u-sub { display: block; font-size: 0.76rem; color: var(--text-muted); }
.table tfoot td {
  font-weight: 700;
  background: var(--surface-2);
  border-top: 2px solid var(--border-strong);
}
.table .row-danger { background: var(--danger-soft) !important; }
.table .row-warning { background: var(--warning-soft) !important; }
.table .row-success { background: var(--success-soft) !important; }

/* Tabla de folio (checkout / caja) */
.folio-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.folio-table th, .folio-table td { padding: 0.5rem 0.6rem; border-bottom: 1px dashed var(--border); }
.folio-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.folio-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.folio-table tr.total td { font-weight: 700; font-size: 1rem; border-top: 2px solid var(--border-strong); border-bottom: 0; padding-top: 0.7rem; }

/* Filas de definición (detalle) */
.dl {
  display: grid;
  grid-template-columns: minmax(120px, 38%) 1fr;
  gap: 0.45rem 1rem;
  margin: 0;
  font-size: 0.88rem;
}
.dl dt { color: var(--text-muted); font-weight: 600; }
.dl dd { margin: 0; color: var(--text); }

/* --------------------------------------------------------------------------
   13. Formularios
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}
.form-grid--1 { grid-template-columns: 1fr; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-col-2 { grid-column: span 2; }
.form-col-full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field--invalid .form-control,
.field--invalid .form-select { border-color: var(--danger); background: #fffafa; }

.form-label,
.field label,
.field > label {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: 0.01em;
}
.form-label .req,
.field label .req { color: var(--danger); margin-left: 0.15rem; }
.form-help,
.field .helptext,
.field small {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.form-help ul,
.field .helptext ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }

.form-control,
.form-select,
select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea {
  width: 100%;
  padding: 0.52rem 0.7rem;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  appearance: none;
}
textarea { min-height: 84px; resize: vertical; }

.form-control:hover,
.form-select:hover,
select:hover,
input:hover,
textarea:hover { border-color: #a9b5bf; }

.form-control:focus,
.form-select:focus,
select:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--info);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.16);
}

select,
.form-select {
  padding-right: 2rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2352606d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 12px;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sidebar-bg);
  margin: 0;
  cursor: pointer;
  flex: 0 0 16px;
}
.check-row { display: flex; align-items: center; gap: 0.5rem; font-size: 0.86rem; }
.check-row label { font-weight: 500; }

input[type="file"] {
  font-size: 0.85rem;
  padding: 0.4rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  width: 100%;
}
input::placeholder, textarea::placeholder { color: #a3adb6; }

.field-error,
.errorlist {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--danger-dark);
}
.field-error::before,
.errorlist li::before { content: "⚠ "; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  margin-top: 1.15rem;
  border-top: 1px solid var(--border);
}
.form-actions--end { justify-content: flex-end; }

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1.1rem;
}
legend {
  padding: 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.form-section {
  margin-bottom: 1.6rem;
}
.form-section__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-soft);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.form-section__title .step-num {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--sidebar-bg);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 700;
}
.form-section__title svg { width: 16px; height: 16px; }

/* Filtros de listado */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.1rem;
}
.filters .field { flex: 0 1 190px; }
.filters .field--grow { flex: 1 1 240px; }
.filters .field--auto { flex: 0 0 auto; }
.filters__spacer { flex: 1 1 auto; }

.input-search {
  position: relative;
  display: flex;
  align-items: center;
}
.input-search svg {
  position: absolute;
  left: 0.6rem;
  width: 15px; height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}
.input-search input { padding-left: 2rem; }

/* --------------------------------------------------------------------------
   14. Mensajes / toasts
   -------------------------------------------------------------------------- */
.messages {
  position: fixed;
  top: calc(var(--topbar-height) + 12px);
  right: 1.4rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
}
.message {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--neutral);
  box-shadow: var(--shadow-md);
  font-size: 0.86rem;
  color: var(--text);
  animation: toastIn 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
.message.is-leaving { animation: toastOut 220ms ease forwards; }
.message__icon {
  flex: 0 0 20px;
  width: 20px; height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--neutral);
}
.message__body { flex: 1 1 auto; min-width: 0; padding-top: 0.05rem; }
.message__close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 0.1rem;
}
.message__close:hover { color: var(--text); }

.message--success { border-left-color: var(--success); }
.message--success .message__icon { background: var(--success); }
.message--error { border-left-color: var(--danger); }
.message--error .message__icon { background: var(--danger); }
.message--warning { border-left-color: var(--warning); }
.message--warning .message__icon { background: var(--warning); }
.message--info { border-left-color: var(--info); }
.message--info .message__icon { background: var(--info); }
.message--debug { border-left-color: var(--text-muted); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(28px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(28px) scale(0.97); }
}

/* Alertas en línea */
.alert {
  display: flex;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--surface);
  font-size: 0.87rem;
  margin-bottom: 1rem;
}
.alert svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 0.1rem; }
.alert__body { flex: 1 1 auto; min-width: 0; }
.alert__title { font-weight: 700; margin: 0 0 0.15rem; }
.alert ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }
.alert--info { border-left-color: var(--info); background: #f5fbff; }
.alert--info svg { color: var(--info); }
.alert--success { border-left-color: var(--success); background: #f4fdf7; }
.alert--success svg { color: var(--success); }
.alert--warning { border-left-color: var(--warning); background: #fffdf5; }
.alert--warning svg { color: var(--warning); }
.alert--danger { border-left-color: var(--danger); background: #fff8f8; }
.alert--danger svg { color: var(--danger); }

/* Estado vacío */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2.6rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
}
.empty svg { width: 42px; height: 42px; opacity: 0.35; }
.empty__title { font-weight: 650; color: var(--text-soft); font-size: 0.95rem; }
.empty__text { font-size: 0.85rem; max-width: 380px; }
.empty--sm { padding: 1.4rem 1rem; }

/* --------------------------------------------------------------------------
   15. Modales (native <dialog>)
   -------------------------------------------------------------------------- */
dialog.modal {
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: auto;
}
dialog.modal[open] { animation: modalIn 200ms cubic-bezier(0.16, 1, 0.3, 1); }
dialog.modal::backdrop {
  background: rgba(15, 43, 51, 0.45);
  backdrop-filter: blur(2px);
  animation: fadeIn 160ms ease;
}
dialog.modal--wide { width: min(880px, calc(100vw - 2rem)); }
dialog.modal--xl { width: min(1120px, calc(100vw - 2rem)); }

.modal__form { display: flex; flex-direction: column; max-height: calc(100vh - 3rem); }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal__header h2 { margin: 0; font-size: 1.05rem; }
.modal__close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-xs);
}
.modal__close:hover { background: var(--bg-alt); color: var(--text); }
.modal__body { padding: 1.25rem; overflow-y: auto; flex: 1 1 auto; }
.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  flex-wrap: wrap;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Menú desplegable simple (details) */
.dropdown { position: relative; }
.dropdown > summary {
  list-style: none;
  cursor: pointer;
}
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 210px;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 5;
}
.dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.48rem 0.6rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}
.dropdown__item:hover { background: var(--bg-alt); text-decoration: none; color: var(--text); }
.dropdown__item svg { width: 15px; height: 15px; color: var(--text-muted); }
.dropdown__divider { height: 1px; background: var(--border); margin: 0.3rem 0; }

/* --------------------------------------------------------------------------
   16. Pestañas
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 0.15rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.2rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 0.6rem 1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { color: var(--sidebar-bg); border-bottom-color: var(--gold); }
.tab .tab-count {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   17. Gráficos (SVG/CSS, sin librerías)
   -------------------------------------------------------------------------- */
.chart {
  width: 100%;
  height: 240px;
  display: block;
  overflow: visible;
}
.chart text { font-size: 10px; fill: var(--text-muted); font-family: var(--font-sans); }
.chart .grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .axis-line { stroke: var(--border-strong); stroke-width: 1; }
.chart .bar-ingreso { fill: url(#gradIngreso); }
.chart .bar-egreso { fill: url(#gradEgreso); }
.chart .bar { transition: opacity var(--t-fast); }
.chart .bar:hover { opacity: 0.82; }

.bars {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 34%) 1fr auto;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.83rem;
}
.bar-row__label {
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-row__track {
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  overflow: hidden;
}
.bar-row__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #123640, #1f6b7a);
  min-width: 2px;
  transition: width var(--t-slow);
}
.bar-row__fill--gold { background: linear-gradient(90deg, #b08c1c, var(--gold)); }
.bar-row__fill--green { background: linear-gradient(90deg, var(--success-dark), #22c55e); }
.bar-row__fill--red { background: linear-gradient(90deg, var(--danger-dark), #ef4444); }
.bar-row__fill--blue { background: linear-gradient(90deg, var(--info-dark), #38bdf8); }
.bar-row__value {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}

.sparkline { display: block; width: 100%; height: 34px; }

/* --------------------------------------------------------------------------
   18. Caja
   -------------------------------------------------------------------------- */
.caja-status {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1.25rem;
}
.caja-status--abierta { border-left: 5px solid var(--success); }
.caja-status--cerrada { border-left: 5px solid var(--neutral); }
.caja-status__icon {
  width: 46px; height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--success-soft);
  color: var(--success-dark);
}
.caja-status--cerrada .caja-status__icon { background: var(--neutral-soft); color: var(--neutral); }
.caja-status__icon svg { width: 24px; height: 24px; }

.money-positive { color: var(--success-dark); font-weight: 650; font-variant-numeric: tabular-nums; }
.money-negative { color: var(--danger-dark); font-weight: 650; font-variant-numeric: tabular-nums; }
.money-neutral { color: var(--text); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   19. POS (tienda)
   -------------------------------------------------------------------------- */
.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 1.25rem;
  align-items: start;
}
.pos-layout__side { position: sticky; top: calc(var(--topbar-height) + 1rem); }

.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 0.8rem;
}
.pos-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  position: relative;
}
.pos-item:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.pos-item:active { transform: translateY(0); }
.pos-item.is-out { opacity: 0.55; cursor: not-allowed; }
.pos-item__name { font-weight: 650; font-size: 0.87rem; line-height: 1.25; }
.pos-item__meta { font-size: 0.73rem; color: var(--text-muted); display: flex; justify-content: space-between; gap: 0.4rem; }
.pos-item__price { font-weight: 700; color: var(--sidebar-bg); font-variant-numeric: tabular-nums; }
.pos-item__stock { position: absolute; top: 0.45rem; right: 0.45rem; }
.pos-item__cat {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-dark);
  font-weight: 700;
}

.cart {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-height) - 2.5rem);
}
.cart__list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
}
.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.3rem 0.6rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.84rem;
}
.cart-line__name { font-weight: 600; }
.cart-line__price { font-size: 0.76rem; color: var(--text-muted); }
.cart-line__controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  justify-content: flex-end;
}
.qty-input {
  width: 58px !important;
  padding: 0.22rem 0.3rem !important;
  text-align: center;
  font-size: 0.82rem !important;
  font-variant-numeric: tabular-nums;
}
.cart-line__total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.cart__totals {
  border-top: 1px solid var(--border);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.86rem;
  background: var(--surface-2);
}
.cart__row { display: flex; justify-content: space-between; gap: 1rem; }
.cart__row--big {
  font-size: 1.1rem;
  font-weight: 750;
  padding-top: 0.45rem;
  margin-top: 0.25rem;
  border-top: 1px dashed var(--border-strong);
}
.cart__foot { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.55rem; border-top: 1px solid var(--border); }

/* --------------------------------------------------------------------------
   20. Alertas de inventario
   -------------------------------------------------------------------------- */
.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.14rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--success-soft);
  color: var(--success-dark);
}
.stock-pill--low { background: var(--danger-soft); color: var(--danger-dark); animation: lowStockPulse 2.6s ease-in-out infinite; }
.stock-pill--mid { background: var(--warning-soft); color: var(--warning-dark); }
@keyframes lowStockPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.28); }
  50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1); }
}

/* --------------------------------------------------------------------------
   21. Página de login
   -------------------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}
.login-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem;
  background: radial-gradient(120% 90% at 15% 10%, #174a56 0%, var(--sidebar-bg) 45%, #081a20 100%);
  color: #fff;
  overflow: hidden;
}
.login-aside::before {
  content: "";
  position: absolute;
  inset: -20% -30% auto auto;
  width: 520px; height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.22) 0%, transparent 65%);
}
.login-aside::after {
  content: "";
  position: absolute;
  inset: auto auto -160px -120px;
  width: 440px; height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 163, 74, 0.16) 0%, transparent 65%);
}
.login-aside__brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.login-aside__brand .sidebar__logo { width: 46px; height: 46px; flex-basis: 46px; border-radius: 12px; }
.login-aside__brand .sidebar__logo svg { width: 26px; height: 26px; }
.login-aside__brand h1 { margin: 0; font-size: 1.2rem; color: #fff; letter-spacing: 0.01em; }
.login-aside__brand p { margin: 0; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-light); }
.login-aside__content { position: relative; max-width: 460px; }
.login-aside__content h2 { color: #fff; font-size: 2rem; line-height: 1.2; margin-bottom: 1rem; font-weight: 700; }
.login-aside__content p { color: #b9cdd2; font-size: 0.95rem; line-height: 1.65; }
.login-features { list-style: none; padding: 0; margin: 1.75rem 0 0; display: flex; flex-direction: column; gap: 0.75rem; }
.login-features li { display: flex; align-items: center; gap: 0.7rem; font-size: 0.9rem; color: #d7e3e6; }
.login-features svg { width: 18px; height: 18px; color: var(--gold); flex: 0 0 18px; }
.login-aside__foot { position: relative; font-size: 0.76rem; color: #7f979e; }

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}
.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 2.25rem 2rem;
}
.login-card__logo {
  width: 56px; height: 56px;
  margin: 0 auto 1.15rem;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--gold) 0%, #b08c1c 100%);
  color: #14232a;
  box-shadow: 0 6px 18px rgba(201, 162, 39, 0.32);
}
.login-card__logo svg { width: 30px; height: 30px; }
.login-card h1 { text-align: center; font-size: 1.35rem; margin-bottom: 0.25rem; }
.login-card__sub { text-align: center; color: var(--text-muted); font-size: 0.86rem; margin-bottom: 1.6rem; }
.login-card .btn--primary { width: 100%; padding: 0.68rem; font-size: 0.94rem; margin-top: 0.35rem; }
.login-card .field { margin-bottom: 0.95rem; }
.login-card .form-control { padding: 0.6rem 0.75rem; }
.login-card__foot { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--border); text-align: center; font-size: 0.78rem; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   22. Check-in / folio
   -------------------------------------------------------------------------- */
.room-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.5rem;
  max-height: 260px;
  overflow-y: auto;
  padding: 0.25rem;
}
.room-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.55rem 0.35rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text);
  transition: all var(--t-fast);
}
.room-choice:hover { border-color: var(--success); background: var(--success-soft); }
.room-choice.is-selected {
  border-color: var(--sidebar-bg);
  background: var(--sidebar-bg);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.room-choice strong { font-size: 0.98rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.room-choice small { font-size: 0.68rem; opacity: 0.8; }

.folio {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.folio__head {
  padding: 1rem 1.1rem;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.folio__head h3 { margin: 0; color: #fff; font-size: 1rem; }
.folio__head p { margin: 0; font-size: 0.78rem; color: var(--gold-light); }
.folio__body { padding: 1rem 1.1rem; }
.folio__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.9rem 1.1rem;
  background: var(--gold-soft);
  border-top: 2px solid var(--gold);
  font-size: 1.15rem;
  font-weight: 750;
}

/* Bloque de resumen de dinero */
.money-summary {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.88rem;
}
.money-summary__row { display: flex; justify-content: space-between; gap: 1rem; }
.money-summary__row--total {
  border-top: 2px solid var(--border-strong);
  padding-top: 0.55rem;
  margin-top: 0.2rem;
  font-size: 1.14rem;
  font-weight: 750;
}
.money-summary__row--diff { border-top: 1px dashed var(--border-strong); padding-top: 0.5rem; }

/* Selector de método de pago (radio pills) */
.pay-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
}
.pay-method {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  transition: all var(--t-fast);
  text-align: center;
}
.pay-method input { position: absolute; opacity: 0; pointer-events: none; }
.pay-method svg { width: 16px; height: 16px; }
.pay-method:hover { border-color: var(--sidebar-bg); }
.pay-method:has(input:checked),
.pay-method.is-checked {
  border-color: var(--sidebar-bg);
  background: var(--sidebar-bg);
  color: #fff;
  box-shadow: var(--shadow-xs);
}

/* --------------------------------------------------------------------------
   23. Varios
   -------------------------------------------------------------------------- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.6rem 0 0.85rem;
}
.section-title h2 { margin: 0; font-size: 1.05rem; }

.inline-list { list-style: none; padding: 0; margin: 0; }
.inline-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.87rem;
}
.inline-list li:last-child { border-bottom: 0; }
.inline-list__main { min-width: 0; flex: 1 1 auto; }
.inline-list__title { font-weight: 600; color: var(--text); }
.inline-list__sub { font-size: 0.78rem; color: var(--text-muted); }

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.87rem;
}
.stat-row:last-child { border-bottom: 0; }
.stat-row__label { color: var(--text-soft); display: inline-flex; align-items: center; gap: 0.45rem; }
.stat-row__value { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

.metric-inline {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.metric-inline__value { font-size: 1.4rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.metric-inline__unit { font-size: 0.8rem; color: var(--text-muted); }

.avatar-lg {
  width: 56px; height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(145deg, #14414d, var(--sidebar-bg));
  color: var(--gold-light);
}
.identity { display: flex; align-items: center; gap: 0.85rem; }
.identity__name { font-weight: 650; font-size: 1rem; }

.calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.calendar-day {
  padding: 0.6rem 0.5rem;
  border-right: 1px solid var(--border);
  min-height: 108px;
}
.calendar-day:last-child { border-right: 0; }
.calendar-day--today { background: var(--gold-soft); }
.calendar-day__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.calendar-day__num { font-weight: 700; color: var(--text); font-size: 0.85rem; }
.calendar-event {
  display: block;
  padding: 0.14rem 0.32rem;
  margin-bottom: 0.18rem;
  border-radius: var(--radius-xs);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  color: var(--text);
}
.calendar-event:hover { text-decoration: none; filter: brightness(0.96); }
.calendar-event--in { background: var(--info-soft); color: var(--info-dark); }
.calendar-event--out { background: var(--warning-soft); color: var(--warning-dark); }
.calendar-event--stay { background: var(--success-soft); color: var(--success-dark); }

.progress-thin {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  overflow: hidden;
}
.progress-thin > span { display: block; height: 100%; background: var(--success); border-radius: inherit; }
.progress-thin > span.is-warn { background: var(--warning); }
.progress-thin > span.is-danger { background: var(--danger); }

.print-only { display: none; }

/* Barra de acciones flotante (móvil) */
.mobile-fab { display: none; }

/* --------------------------------------------------------------------------
   24. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1400px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
  .pos-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .login-page { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}

@media (max-width: 980px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-collapsed .sidebar { width: var(--sidebar-width); }
  body.sidebar-collapsed .sidebar__brand-text,
  body.sidebar-collapsed .nav-link__label,
  body.sidebar-collapsed .sidebar__section,
  body.sidebar-collapsed .sidebar__footer { opacity: 1; pointer-events: auto; }
  body.sidebar-collapsed .nav-link { justify-content: flex-start; padding-inline: 0.7rem; }
  body.sidebar-collapsed .nav-badge { position: static; min-width: 20px; height: 20px; font-size: 0.7rem; padding: 0 6px; }
  .main, body.sidebar-collapsed .main { margin-left: 0; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 43, 51, 0.45);
    z-index: calc(var(--z-sidebar) - 1);
    display: none;
  }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .pos-layout { grid-template-columns: 1fr; }
  .pos-layout__side { position: static; }
  .cart { max-height: none; }
  .topbar__title .u-small { display: none; }
}

@media (max-width: 760px) {
  .content { padding: 1rem; }
  .topbar { padding: 0 0.85rem; gap: 0.6rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
  .kpi { flex-direction: column; gap: 0.5rem; padding: 0.85rem 0.9rem; }
  .kpi__value { font-size: 1.35rem; }
  .form-grid, .form-grid--3 { grid-template-columns: 1fr; }
  .form-col-2, .form-col-full { grid-column: auto; }
  .rooms-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 0.7rem; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head__actions .btn { flex: 1 1 auto; }
  .filters { padding: 0.75rem; }
  .filters .field { flex: 1 1 100%; }
  .messages { right: 0.75rem; left: 0.75rem; width: auto; top: calc(var(--topbar-height) + 8px); }
  .topbar__live { display: none; }
  .topbar__user-name, .topbar__user-role { display: none; }
  .topbar__user { padding: 0.25rem; }
  dialog.modal { width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); }
  .calendar-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dl { grid-template-columns: 1fr; }
  .dl dt { margin-top: 0.4rem; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; }
}

@media (max-width: 420px) {
  .kpis { grid-template-columns: 1fr; }
  .sidebar__brand-sub { display: none; }
}

/* --------------------------------------------------------------------------
   25. Impresión (recibos, ticket POS, cierre de caja)
   -------------------------------------------------------------------------- */
@media print {
  @page { margin: 12mm; }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11.5pt;
  }

  .sidebar,
  .topbar,
  .messages,
  .sidebar-backdrop,
  .no-print,
  .btn,
  .mobile-fab,
  .page-head__actions,
  .form-actions,
  dialog.modal:not(.print-target),
  dialog.modal::backdrop { display: none !important; }

  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }

  .card {
    border: 1px solid #999 !important;
    box-shadow: none !important;
    break-inside: avoid;
    margin-bottom: 10pt;
  }
  .card__header { background: #fff !important; border-bottom: 1px solid #999 !important; }
  .card__body { padding: 8pt !important; }
  .folio__head {
    background: #fff !important;
    color: #000 !important;
    border-bottom: 2px solid #000;
  }
  .folio__head h3, .folio__head p { color: #000 !important; }
  .folio__total { background: #f2f2f2 !important; color: #000 !important; border-top: 2px solid #000; }

  .table th { background: #eee !important; color: #000 !important; }
  .table th, .table td { border-bottom: 1px solid #bbb !important; }

  .badge, .badge-estado, .stock-pill {
    border: 1px solid #999 !important;
    background: #fff !important;
    color: #000 !important;
  }

  .print-only { display: block !important; }
  .print-hide { display: none !important; }

  .print-header {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 2px solid #000;
    padding-bottom: 8pt;
    margin-bottom: 12pt;
  }
  .print-header h1 { margin: 0; font-size: 16pt; }
  .print-header p { margin: 0; font-size: 9.5pt; }
  .print-signatures {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-top: 36pt;
  }
  .print-signatures div {
    border-top: 1px solid #000;
    padding-top: 4pt;
    font-size: 9.5pt;
    text-align: center;
  }

  a { color: #000 !important; text-decoration: none !important; }
  a[href]::after { content: ""; }

  .chart { height: 190px; }
  .print-break { page-break-before: always; }
}

/* Impresión de un recibo/ticket aislado */
.print-receipt { max-width: 320px; margin: 0 auto; font-family: var(--font-mono); font-size: 0.82rem; }
.print-receipt__line { display: flex; justify-content: space-between; gap: 0.5rem; }

/* --------------------------------------------------------------------------
   26. Movimiento / animaciones de entrada del contenido
   -------------------------------------------------------------------------- */
.fade-in { animation: fadeIn 200ms ease both; }
.fade-up { animation: fadeUp 320ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Reservas en línea (portal público) — estados de pago
   ========================================================================== */
.badge--sin_soporte { background: var(--neutral-soft); color: var(--neutral); border-color: #dfe3e8; }
.badge--en_revision { background: var(--warning-soft); color: var(--warning-dark); border-color: #f3d79a; }
.badge--verificado { background: var(--success-soft); color: var(--success-dark); border-color: #b5e8c5; }
.badge--rechazado { background: var(--danger-soft); color: var(--danger-dark); border-color: #f7c4c4; }

/* Enlace público de consulta de la reserva */
.reserva-enlace {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.reserva-enlace input {
  flex: 1 1 260px;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface-2);
}

/* =========================================================================
   Aviso de reservas pendientes de comprobante de pago (panel general)
   ========================================================================= */
.aviso-pago {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  padding: .9rem 1rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  border: 1px solid #fcd9a8;
  background: #fef8ec;
  color: #7c4a03;
}
.aviso-pago.u-hide { display: none; }

.aviso-pago__icono {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fdeacb;
  color: #b8722a;
}
.aviso-pago__icono svg { width: 19px; height: 19px; }

.aviso-pago__cuerpo { flex: 1 1 auto; min-width: 0; }

.aviso-pago__titulo {
  margin: 0 0 .4rem;
  font-size: .9rem;
  font-weight: 700;
  color: #7c4a03;
}

.aviso-pago__lista { display: flex; flex-direction: column; gap: .3rem; }

.aviso-pago__fila {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  padding: .32rem .5rem;
  border-radius: 7px;
  background: #fff;
  border: 1px solid #f3e3c6;
  text-decoration: none;
  color: #7c4a03;
  font-size: .815rem;
  transition: background .15s ease, border-color .15s ease;
}
.aviso-pago__fila:hover { background: #fdf3e2; border-color: #e8cfa4; }
.aviso-pago__fila strong { font-weight: 700; }
.aviso-pago__fila span { color: #96703b; font-size: .78rem; }

.aviso-pago .btn { flex: 0 0 auto; white-space: nowrap; }

/* Contador en la barra superior */
#topbar-pendientes-badge.is-nuevo {
  animation: pendientes-latido 1.1s ease-in-out 3;
}
@keyframes pendientes-latido {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.28); }
}

@media (max-width: 640px) {
  .aviso-pago { flex-wrap: wrap; }
  .aviso-pago .btn { margin-left: 2.6rem; }
}

/* =========================================================================
   Reportes de rentabilidad
   ========================================================================= */
.filtros-barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid #e6e1d7;
  border-radius: 12px;
}
.filtros-barra__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.filtros-barra__etiqueta { font-size: .82rem; color: #5b6f78; }
.filtros-barra__sep { font-size: .82rem; color: #b3bfc4; }
.filtros-barra__select,
.filtros-barra__fecha {
  padding: .38rem .55rem;
  border: 1px solid #ddd6c8;
  border-radius: 8px;
  font: inherit;
  font-size: .85rem;
  background: #fbfaf7;
  color: #14232a;
}

.kpi--ok .kpi__value { color: #14532d; }
.kpi--alerta .kpi__value { color: #8a1c1c; }

.kpi__pie { color: #7b8b93; margin-top: .2rem; }

/* Mini barras dentro de tablas */
.mini-barra {
  display: inline-block;
  vertical-align: middle;
  width: 54px;
  height: 6px;
  margin-right: .35rem;
  border-radius: 999px;
  background: #eceae4;
  overflow: hidden;
}
.mini-barra__relleno {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #b8912f;
}
.mini-barra__relleno--malo { background: #c0392b; }
.mini-barra--balance { width: 90px; }

.tabla--compacta th,
.tabla--compacta td { padding: .42rem .55rem; font-size: .84rem; }

.tabla-scroll { overflow-x: auto; }

.tabla__num--perdida { color: #a0522d; }

.tabla tfoot th {
  border-top: 2px solid #e6e1d7;
  font-weight: 700;
  background: #faf8f4;
}

.tabla__vacia {
  text-align: center;
  color: #7b8b93;
  padding: 1.4rem .6rem;
}

/* Variación con flecha */
.variacion {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  padding: .1rem .4rem;
  border-radius: 6px;
  white-space: nowrap;
}
.variacion--sube { color: #14532d; background: #eefaf1; }
.variacion--baja { color: #8a1c1c; background: #fdf0f0; }
.variacion--igual { color: #6b7f88; background: #f1f0ec; }

/* Nota explicativa */
.panel--nota { background: #fbfaf7; }
.definiciones { margin: 0; }
.definiciones dt {
  font-weight: 700;
  color: #0f2b33;
  font-size: .88rem;
  margin-top: .7rem;
}
.definiciones dt:first-child { margin-top: 0; }
.definiciones dd {
  margin: .18rem 0 0;
  font-size: .855rem;
  color: #41565f;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .filtros-barra { flex-direction: column; align-items: stretch; }
  .filtros-barra__form { flex-direction: column; align-items: stretch; }
  .mini-barra { display: none; }
}

/* Aviso informativo dentro de un reporte */
.aviso-info {
  padding: .7rem .9rem;
  margin: 0 0 1rem;
  border-radius: 10px;
  background: #eef4fb;
  border: 1px solid #cfe0f2;
  color: #1e3a5f;
  font-size: .855rem;
  line-height: 1.55;
}
.aviso-info strong { font-weight: 700; }
.aviso-info--vacio {
  background: #fbfaf7;
  border-color: #e6e1d7;
  color: #5b6f78;
}

/* ==========================================================================
   Reservas pendientes — Casa Hotel Bellavista
   ========================================================================== */

/* --- Chips de filtro ------------------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 550;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.chip:hover {
  border-color: var(--primary-soft, #bcd3d8);
  background: var(--bg-alt);
  color: var(--text);
}

.chip--activo {
  background: var(--primary, #123a42);
  border-color: var(--primary, #123a42);
  color: #fff;
}

.chip--activo:hover {
  background: var(--primary-dark, #15404a);
  color: #fff;
}

.chip__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chip--activo .chip__num {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* --- Tabla --------------------------------------------------------------- */
.tabla-envoltura {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.celda-fuerte {
  font-weight: 600;
  color: var(--text);
}

.celda-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  color: var(--primary, #123a42);
  text-decoration: none;
  font-weight: 600;
}

.mono:hover { text-decoration: underline; }

/* Fila que lleva demasiado tiempo esperando. */
.fila--vencida {
  background: #fffafa;
}

.fila--vencida td:first-child {
  box-shadow: inset 3px 0 0 var(--danger, #e5484d);
}

/* --- Acciones de cada fila ----------------------------------------------- */
.acciones-fila {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.acciones-fila form { margin: 0; }

/* Los botones nunca deben partir su texto. */
.acciones-fila .btn {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .acciones-fila { flex-direction: column; align-items: stretch; }
  .acciones-fila .btn { width: 100%; justify-content: center; }
}

@media (max-width: 640px) {
  .chip { font-size: 0.78rem; padding: 0.32rem 0.6rem; }
  .filtros__grupo { flex-wrap: wrap; }
}
