/* =====================================================================
   Hotel Vale do Rio — app.css  ·  v3
   O rio São Francisco ao amanhecer: água profunda, névoa do vale,
   sol de Minas. Interface de operação diária, feita para o balcão.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ---------- 1. Tokens ---------- */
:root {
  --mist: #f2f2f7;
  --mist-2: #e9e9f1;
  --surface: #ffffff;
  --surface-2: #f8f8fc;
  --linha: #e6e6ef;
  --linha-forte: #d2d2e0;

  --ink: #14141f;
  --ink-2: #4a4a63;
  --ink-3: #85859c;

  /* Azul-marinho da logo (#2a1e5a) como cor primária do sistema. */
  --rio-50: #edeaf6;
  --rio-100: #d6d0eb;
  --rio-300: #8b80c2;
  --rio-500: #46387f;
  --rio-600: #2a1e5a;
  --rio-700: #211748;
  --rio-900: #120c29;

  /* Laranja da logo (#f09018). */
  --sol: #f09018;
  --sol-claro: #f8b559;
  --sol-fundo: #fdf1e0;
  --sol-tinta: #8a5008;

  --barro: #c4433a;
  --barro-fundo: #fbe8e6;
  --mato: #1f8f57;
  --mato-fundo: #e3f4ea;

  --r-sm: 12px;
  --r: 18px;
  --r-md: 22px;
  --r-lg: 28px;
  --r-xl: 34px;

  --e1: 0 1px 2px rgba(18, 12, 41, .05), 0 1px 3px rgba(18, 12, 41, .04);
  --e2: 0 2px 4px rgba(18, 12, 41, .04), 0 6px 16px rgba(18, 12, 41, .07);
  --e3: 0 8px 20px rgba(18, 12, 41, .09), 0 24px 48px rgba(18, 12, 41, .10);
  --e-sol: 0 4px 10px rgba(240, 144, 24, .32), 0 10px 24px rgba(240, 144, 24, .26);

  --fonte: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fonte-num: 'Space Grotesk', 'SF Mono', ui-monospace, monospace;

  --mola: cubic-bezier(.32, .72, 0, 1);
  --saida: cubic-bezier(.4, 0, .2, 1);

  --tab-h: 68px;
  --topo-h: 62px;
  --sup: env(safe-area-inset-top, 0px);
  --inf: env(safe-area-inset-bottom, 0px);
}

[data-tema="escuro"] {
  --mist: #0c0a18;
  --mist-2: #131024;
  --surface: #191531;
  --surface-2: #201b3d;
  --linha: #2a2450;
  --linha-forte: #3a3268;

  --ink: #eceafa;
  --ink-2: #b0aacf;
  --ink-3: #8681a8;

  --rio-50: #241d47;
  --rio-100: #2e2557;
  --rio-300: #7c6fc4;
  --rio-500: #8779da;
  --rio-600: #9a8cea;
  --rio-700: #7768c9;

  --sol: #f7a83c;
  --sol-claro: #fbc477;
  --sol-fundo: #3d2a0d;
  --sol-tinta: #f8c377;
  --barro-fundo: #3a1815;
  --mato-fundo: #0f2d1d;

  --e1: 0 1px 2px rgba(0, 0, 0, .4);
  --e2: 0 4px 14px rgba(0, 0, 0, .45);
  --e3: 0 12px 36px rgba(0, 0, 0, .55);
}

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

html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--fonte);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.006em;
  background: var(--mist);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--rio-500); text-underline-offset: 3px; }

:focus-visible {
  outline: 2.5px solid var(--sol);
  outline-offset: 3px;
  border-radius: 8px;
}

.oculto { display: none !important; }
.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.num, .val, .preco {
  font-family: var(--fonte-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -.02em;
}

/* ---------- 3. Escala tipográfica ---------- */
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.rotulo {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-3);
}

/* ---------- 4. A linha do rio (assinatura) ---------- */
.rio-linha { display: block; width: 100%; height: 12px; overflow: hidden; }
.rio-linha path { animation: correnteza 14s linear infinite; }
@keyframes correnteza { to { transform: translateX(-180px); } }

/* ---------- 5. Login ---------- */
.login {
  position: relative; overflow: hidden;
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(130% 80% at 50% -10%, var(--rio-500) 0%, var(--rio-700) 45%, var(--rio-900) 100%);
}
.login::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 44%;
  background: radial-gradient(80% 100% at 50% 100%, rgba(233,163,61,.16), transparent 70%);
  pointer-events: none;
}
.login-cartao {
  position: relative; z-index: 1;
  width: 100%; max-width: 384px;
  padding: 34px 26px 28px;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--e3);
  text-align: center;
  animation: sobe-entra .5s var(--mola) both;
}
/* A marca é horizontal (sol, árvore e casa lado a lado): altura fixa,
   largura livre. Forçá-la em quadrado espremia o desenho. */
.login-marca {
  display: block; margin: 0 auto 18px;
  height: 72px; width: auto; max-width: 220px;
  object-fit: contain;
}
.login h1 { font-size: 22px; margin-bottom: 3px; }
.login .sub { margin: 0 0 24px; font-size: 13.5px; font-weight: 500; color: var(--ink-3); }

@keyframes sobe-entra { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* ---------- 6. Campos ---------- */
.campo { margin-bottom: 15px; text-align: left; }
.campo label {
  display: block; margin-bottom: 7px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
}
.campo input, .campo select, .campo textarea {
  width: 100%;
  padding: 14px 15px;
  border: 1.5px solid var(--linha);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-weight: 500;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.campo input:hover, .campo select:hover, .campo textarea:hover { border-color: var(--linha-forte); }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none;
  border-color: var(--rio-500);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(70, 56, 127, .14);
}
.campo input[type="date"], .campo input[type="time"] { font-family: var(--fonte-num); }
.campo textarea { min-height: 88px; resize: vertical; }
.campo .dica { margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.campos-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- 7. Botões ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 20px;
  border-radius: 15px;
  font-size: 14.5px; font-weight: 700; letter-spacing: -.01em;
  transition: transform .16s var(--mola), box-shadow .2s, filter .18s, background .18s;
}
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: currentColor; opacity: 0; transition: opacity .18s;
}
.btn:hover::after { opacity: .06; }
.btn:active { transform: scale(.965); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.btn-principal { background: var(--rio-600); color: #fff; box-shadow: var(--e1); }
.btn-principal:hover { box-shadow: var(--e2); }
.btn-sol { background: var(--sol); color: #3a2807; box-shadow: var(--e1); }
.btn-suave { background: var(--rio-50); color: var(--rio-600); }
.btn-contorno { border: 1.5px solid var(--linha-forte); color: var(--ink-2); }
.btn-perigo { background: var(--barro-fundo); color: var(--barro); }
.btn-zap { background: #1faa54; color: #fff; }
.btn-bloco { width: 100%; }
.btn-lin { padding: 9px 14px; font-size: 13px; border-radius: 11px; }

/* ---------- 8. Casca ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }

.topo {
  position: sticky; top: 0; z-index: 40;
  padding-top: var(--sup);
  background: linear-gradient(165deg, var(--rio-600) 0%, var(--rio-700) 70%, var(--rio-900) 100%);
  color: #fff;
}
.topo-linha {
  height: var(--topo-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
}
.topo-marca { height: 34px; width: auto; max-width: 84px; object-fit: contain; flex: none; }
.topo-txt { flex: 1; min-width: 0; }
.topo-txt h1 { font-size: 17px; }
.topo-txt p { margin: 1px 0 0; font-size: 12px; font-weight: 500; opacity: .72; }
.topo-acao {
  width: 40px; height: 40px; border-radius: 13px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .13);
  transition: background .18s, transform .16s var(--mola);
}
.topo-acao:hover { background: rgba(255, 255, 255, .22); }
.topo-acao:active { transform: scale(.92); }

.conteudo {
  flex: 1; width: 100%; max-width: 760px; margin: 0 auto;
  padding: 18px 16px calc(var(--tab-h) + var(--inf) + 30px);
}

.tela { animation: tela-entra .34s var(--mola) both; }
@keyframes tela-entra { from { opacity: 0; transform: translateY(10px); } }

/* A tela entra pelo lado de onde veio: dá noção de posição entre as abas. */
.conteudo.entra-direita > .tela { animation: desliza-dir .38s var(--mola) both; }
.conteudo.entra-esquerda > .tela { animation: desliza-esq .38s var(--mola) both; }
@keyframes desliza-dir { from { opacity: 0; transform: translateX(26px); } }
@keyframes desliza-esq { from { opacity: 0; transform: translateX(-26px); } }

.escalona > * { animation: item-entra .42s var(--mola) both; }
.escalona > *:nth-child(1) { animation-delay: .02s; }
.escalona > *:nth-child(2) { animation-delay: .06s; }
.escalona > *:nth-child(3) { animation-delay: .10s; }
.escalona > *:nth-child(4) { animation-delay: .14s; }
.escalona > *:nth-child(5) { animation-delay: .18s; }
.escalona > *:nth-child(6) { animation-delay: .22s; }
.escalona > *:nth-child(n+7) { animation-delay: .26s; }
@keyframes item-entra { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.secao {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 26px 3px 12px;
}
.secao h2 { font-size: 15.5px; font-weight: 800; letter-spacing: -.025em; }
.secao a { font-size: 13px; font-weight: 700; text-decoration: none; }

/* ---------- 9. Faixa do dia (assinatura) ---------- */
.faixa-dia { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-bottom: 6px; }
.faixa-q {
  position: relative; overflow: hidden;
  aspect-ratio: 1 / 1.18;
  max-height: 92px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--e1);
  transition: transform .18s var(--mola), box-shadow .2s;
  animation: item-entra .4s var(--mola) both;
}
.faixa-q:active { transform: scale(.94); }
.faixa-q::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3.5px;
  background: var(--linha-forte);
}
.faixa-q .n {
  font-family: var(--fonte-num); font-size: 15px; font-weight: 700;
  letter-spacing: -.02em; color: var(--ink);
}
.faixa-q .ini {
  font-size: 9.5px; font-weight: 700; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .04em;
}
.faixa-q.ocupado { background: var(--barro-fundo); }
.faixa-q.ocupado::before { background: var(--barro); }
.faixa-q.ocupado .n { color: var(--barro); }
.faixa-q.chega_hoje { background: var(--sol-fundo); }
.faixa-q.chega_hoje::before { background: var(--sol); }
.faixa-q.chega_hoje .n { color: var(--sol-tinta); }
.faixa-q.reservado::before { background: var(--rio-300); }
.faixa-q.reservado .n { color: var(--rio-600); }

.faixa-legenda {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: 10px 3px 0;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
}
.faixa-legenda i {
  display: inline-block; width: 8px; height: 8px; border-radius: 3px;
  margin-right: 5px; vertical-align: middle;
}

/* ---------- 10. Cartões e indicadores ---------- */
.cartao {
  padding: 18px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--e1);
  transition: box-shadow .22s, transform .18s var(--mola);
}
.cartao-toque:hover { box-shadow: var(--e2); }
.cartao-toque:active { transform: scale(.99); }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.kpi {
  position: relative; overflow: hidden;
  min-height: 128px;
  padding: 15px 16px 16px;
  border-radius: var(--r-lg);
  background:
    linear-gradient(150deg, var(--kpi-a, var(--rio-50)) 0%, var(--surface) 62%);
  box-shadow: var(--e1);
  transition: box-shadow .24s, transform .2s var(--mola);
}
.kpi:hover { box-shadow: var(--e2); transform: translateY(-3px); }
.kpi::after {
  content: ""; position: absolute; right: -34px; bottom: -46px;
  width: 118px; height: 118px; border-radius: 50%;
  background: var(--kpi-b, var(--rio-500));
  opacity: .07;
}
.kpi .chip {
  width: 32px; height: 32px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--kpi-b, var(--rio-500));
  color: #fff;
  box-shadow: 0 3px 8px rgba(6,37,31,.16);
}
.kpi .rot {
  margin-top: 11px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .085em; color: var(--ink-3);
}
.kpi .val {
  display: block; margin-top: 3px;
  font-size: 30px; font-weight: 700; line-height: 1;
  color: var(--kpi-c, var(--ink));
}
.kpi .obs { margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }

/* medidor de ocupação: anel, não barra */
.kpi .anel { position: absolute; top: 13px; right: 13px; }
.kpi .anel circle { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.kpi .anel .trilho { stroke: var(--linha); }
.kpi .anel .arco {
  --vazio: 100;  /* o JavaScript ajusta conforme a circunferência real */
  stroke: var(--kpi-b, var(--rio-500));
  transform: rotate(-90deg); transform-origin: 50% 50%;
  animation: anel-cresce 1s var(--mola) both;
}
@keyframes anel-cresce { from { stroke-dashoffset: var(--vazio, 100); } }

/* faísca de receita */
.kpi .faisca { position: absolute; right: 12px; top: 16px; opacity: .9; }
.kpi .faisca polyline {
  fill: none; stroke: var(--kpi-b, var(--sol)); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 140; animation: risca 1.1s var(--mola) both;
}
@keyframes risca { from { stroke-dashoffset: 140; } }

.kpi.rio   { --kpi-a: var(--rio-50);   --kpi-b: var(--rio-500); --kpi-c: var(--rio-700); }
.kpi.sol   { --kpi-a: var(--sol-fundo); --kpi-b: var(--sol);     --kpi-c: var(--sol-tinta); }
.kpi.mato  { --kpi-a: var(--mato-fundo); --kpi-b: var(--mato);   --kpi-c: var(--mato); }
.kpi.barro { --kpi-a: var(--barro-fundo); --kpi-b: var(--barro); --kpi-c: var(--barro); }

.grafico { display: flex; align-items: flex-end; gap: 9px; height: 128px; margin-top: 8px; }
.barra {
  flex: 1; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px;
}
.barra i {
  display: block; width: 100%; min-height: 5px;
  border-radius: 9px 9px 5px 5px;
  background: linear-gradient(180deg, var(--rio-500), var(--rio-700));
  transform-origin: bottom;
  animation: barra-sobe .7s var(--mola) both;
}
.barra:nth-child(2) i { animation-delay: .05s; }
.barra:nth-child(3) i { animation-delay: .10s; }
.barra:nth-child(4) i { animation-delay: .15s; }
.barra:nth-child(5) i { animation-delay: .20s; }
.barra:nth-child(6) i { animation-delay: .25s; }
.barra.destaque i { background: linear-gradient(180deg, var(--sol-claro), var(--sol)); }
.barra span { font-family: var(--fonte-num); font-size: 10px; font-weight: 600; color: var(--ink-3); }
@keyframes barra-sobe { from { transform: scaleY(0); opacity: .4; } }

/* ---------- 11. Lista de reservas ---------- */
.segmentado { display: flex; gap: 7px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.segmentado::-webkit-scrollbar { display: none; }
.segmentado button {
  flex: none;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  box-shadow: var(--e1);
  transition: background .2s, color .2s, transform .16s var(--mola);
}
.segmentado button:active { transform: scale(.94); }
.segmentado button[aria-selected="true"] { background: var(--rio-600); color: #fff; box-shadow: var(--e2); }

.busca { position: relative; margin-bottom: 12px; }
.busca input {
  width: 100%;
  padding: 13px 15px 13px 42px;
  border: 0; border-radius: 15px;
  background: var(--surface);
  font-weight: 500;
  box-shadow: var(--e1);
  transition: box-shadow .2s;
}
.busca input:focus { outline: none; box-shadow: var(--e2), 0 0 0 4px rgba(70,56,127,.14); }
.busca svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

.reserva {
  position: relative; overflow: hidden;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center; gap: 14px;
  width: 100%; text-align: left;
  margin-bottom: 10px; padding: 15px 16px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--e1);
  transition: transform .2s var(--mola), box-shadow .24s;
}
.reserva::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--linha-forte);
}
.reserva.st-Pendente::before { background: var(--sol); }
.reserva.st-Checkin::before { background: var(--mato); }
.reserva.st-Finalizada::before { background: var(--rio-300); }
.reserva.st-Cancelada::before { background: var(--barro); }
.reserva:hover { box-shadow: var(--e2); transform: translateY(-2px); }
.reserva:active { transform: scale(.985); }

.quarto-bolha {
  width: 52px; height: 52px; border-radius: 17px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(155deg, var(--rio-500), var(--rio-700));
  color: #fff;
  box-shadow: 0 3px 9px rgba(33, 23, 72, .30);
}
.quarto-bolha .q { font-size: 8.5px; font-weight: 700; letter-spacing: .1em; opacity: .75; }
.quarto-bolha .n { font-family: var(--fonte-num); font-size: 18px; font-weight: 700; line-height: 1.05; }

.reserva .meio { min-width: 0; }
.reserva .nome {
  font-size: 15px; font-weight: 700; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reserva .datas {
  margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--ink-3);
}

/* barra da estadia: mostra quanto já passou da hospedagem */
.reserva .trilha {
  position: relative; height: 4px; margin-top: 8px;
  border-radius: 4px; background: var(--linha); overflow: hidden;
}
.reserva .trilha i {
  position: absolute; inset: 0 auto 0 0;
  border-radius: 4px; background: var(--mato);
  transform-origin: left;
  animation: trilha-cresce .8s var(--mola) both;
}
@keyframes trilha-cresce { from { transform: scaleX(0); } }

.reserva .dir { text-align: right; }
.reserva .preco { font-size: 15px; font-weight: 700; letter-spacing: -.025em; }

.selo {
  display: inline-block; margin-top: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.selo-pendente { background: var(--sol-fundo); color: var(--sol-tinta); }
.selo-checkin { background: var(--mato-fundo); color: var(--mato); }
.selo-finalizada { background: var(--rio-50); color: var(--rio-600); }
.selo-cancelada { background: var(--barro-fundo); color: var(--barro); }

/* ---------- 12. Quartos ---------- */
.grade-quartos {
  display: grid;
  /* Colunas nascem do espaço disponível: 2 no celular, 3-4 no tablet,
     sem nunca esticar um cartão além do que um cartão deve ser. */
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}
.quarto {
  position: relative; overflow: hidden; text-align: left;
  min-height: 96px;
  padding: 13px 14px;
  background: linear-gradient(150deg, var(--q-a, var(--surface-2)) 0%, var(--surface) 58%);
  border-radius: var(--r-lg);
  box-shadow: var(--e1);
  transition: transform .2s var(--mola), box-shadow .24s;
}
.quarto.livre { --q-a: var(--surface-2); }
.quarto.ocupado { --q-a: var(--barro-fundo); }
.quarto.chega_hoje { --q-a: var(--sol-fundo); }
.quarto.reservado { --q-a: var(--rio-50); }
.quarto .n { display: block; }
.quarto-hospede {
  margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quarto:hover { box-shadow: var(--e2); transform: translateY(-2px); }
.quarto:active { transform: scale(.98); }
.quarto::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--linha-forte); }
.quarto .n { font-family: var(--fonte-num); font-size: 19px; font-weight: 700; letter-spacing: -.03em; }
.quarto .t { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.quarto .s { margin-top: 10px; font-size: 12.5px; font-weight: 700; }
.quarto.livre .s { color: var(--ink-3); }
.quarto.ocupado::before { background: var(--barro); }
.quarto.ocupado .s { color: var(--barro); }
.quarto.chega_hoje::before { background: var(--sol); }
.quarto.chega_hoje .s { color: var(--sol-tinta); }
.quarto.reservado::before { background: var(--rio-300); }
.quarto.reservado .s { color: var(--rio-600); }

/* ---------- 13. Abas + botão central ---------- */
.abas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--tab-h) + var(--inf));
  padding-bottom: var(--inf);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--linha);
}
.abas button {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: -.01em;
  color: var(--ink-3);
  transition: color .22s;
}
.abas button svg { transition: transform .28s var(--mola); }
.abas button[aria-selected="true"] { color: var(--rio-600); }
.abas button[aria-selected="true"] svg { transform: translateY(-2px) scale(1.06); }
/* Pastilha que desliza entre as abas — uma só, que se move. */
.abas-indicador {
  position: absolute; top: 6px; left: 0;
  width: 28px; height: 3.5px; border-radius: 4px;
  background: var(--rio-600);
  transition: transform .42s var(--mola), height .3s var(--mola);
  pointer-events: none;
}
.abas { position: fixed; }

.fab-slot { position: relative; }
.fab {
  position: absolute; left: 50%; top: -20px; transform: translateX(-50%);
  width: 58px; height: 58px; border-radius: 21px;
  display: grid; place-items: center;
  background: linear-gradient(155deg, var(--sol-claro), var(--sol));
  color: #3a2807;
  box-shadow: var(--e-sol);
  transition: transform .2s var(--mola), box-shadow .22s;
}
.fab:hover { box-shadow: var(--e-sol), var(--e2); }
.fab:active { transform: translateX(-50%) scale(.9); }

/* ---------- 14. Folhas ---------- */
.veu {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(18, 12, 41, .55);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .28s var(--saida);
}
.veu.aberto { opacity: 1; pointer-events: auto; }

.folha {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  display: flex; flex-direction: column;
  max-height: 93dvh;
  background: var(--mist);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: 0 -12px 48px rgba(18, 12, 41, .26);
  transform: translateY(101%);
  transition: transform .38s var(--mola);
}
.folha.aberta { transform: translateY(0); }
.folha-puxador {
  flex: none; margin: 11px auto 3px;
  width: 42px; height: 4.5px; border-radius: 5px;
  background: var(--linha-forte);
}
.folha-topo { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 18px 14px; }
.folha-topo h2 { flex: 1; font-size: 18px; font-weight: 800; letter-spacing: -.03em; }
.folha-corpo { overflow-y: auto; padding: 2px 18px calc(22px + var(--inf)); -webkit-overflow-scrolling: touch; }
.folha-rodape {
  flex: none; display: flex; gap: 10px;
  padding: 13px 18px calc(15px + var(--inf));
  background: var(--surface);
  border-top: 1px solid var(--linha);
}
.folha-rodape .btn { flex: 1; }

.passos { display: flex; gap: 6px; padding: 0 18px 14px; }
.passos i {
  flex: 1; height: 4px; border-radius: 4px;
  background: var(--linha-forte);
  transition: background .3s var(--mola);
}
.passos i.ativo { background: var(--rio-600); }

/* ---------- 15. Detalhe ---------- */
.linha-info {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--linha);
  font-size: 14px;
}
.linha-info:last-child { border-bottom: 0; }
.linha-info .r { font-weight: 500; color: var(--ink-3); }
.linha-info .v { font-weight: 700; text-align: right; }

.acoes-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.acoes-grade .largo { grid-column: 1 / -1; }

.link-box {
  display: flex; align-items: center; gap: 9px;
  margin-top: 12px; padding: 12px 14px;
  background: var(--rio-50); color: var(--rio-600);
  border-radius: 15px;
}
.link-box code {
  flex: 1;
  font-family: var(--fonte-num); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 15b. Mapa do mês ---------- */
.cal-rolo { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.cal-rolo::-webkit-scrollbar { height: 5px; }
.cal-rolo::-webkit-scrollbar-thumb { background: var(--linha-forte); border-radius: 4px; }

.cal-grade { min-width: max-content; }
.cal-linha {
  --dias: 31;  /* o JavaScript ajusta conforme o mês */
  display: grid;
  grid-template-columns: 34px repeat(var(--dias), 26px);
  align-items: center;
  position: relative;
}
.cal-rot {
  position: sticky; left: 0; z-index: 2;
  padding: 5px 6px 5px 2px;
  background: var(--mist);
  font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.cal-cab .cal-dia {
  text-align: center;
  font-family: var(--fonte-num); font-size: 10.5px; font-weight: 600;
  color: var(--ink-3); padding: 4px 0;
}
.cal-cab .fds { color: var(--barro); }
.cal-cab .hoje {
  color: #fff; background: var(--rio-600);
  border-radius: 6px;
}
.cal-cel {
  height: 30px;
  border-right: 1px solid var(--linha);
  border-bottom: 1px solid var(--linha);
}
.cal-cel.hoje { background: var(--sol-fundo); }

.cal-faixa {
  grid-row: 1;
  height: 22px; margin: 0 1px;
  border-radius: 7px;
  display: flex; align-items: center;
  padding: 0 7px; overflow: hidden;
  font-size: 10.5px; font-weight: 700; color: #fff;
  white-space: nowrap; text-overflow: ellipsis;
  box-shadow: var(--e1);
  transition: transform .16s var(--mola), filter .18s;
  animation: faixa-abre .45s var(--mola) both;
}
.cal-faixa span { overflow: hidden; text-overflow: ellipsis; }
.cal-faixa:hover { filter: brightness(1.08); }
.cal-faixa:active { transform: scale(.96); }
.cal-faixa.prevista { background: var(--sol); color: #3a2807; }
.cal-faixa.hospedado { background: var(--mato); }
.cal-faixa.finalizada { background: var(--rio-300); color: var(--rio-900); }
@keyframes faixa-abre { from { transform: scaleX(.3); opacity: 0; } }

/* ---------- 15c. Fita do grupo ---------- */
.grupo-fita {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px 2px 8px; scrollbar-width: none;
}
.grupo-fita::-webkit-scrollbar { display: none; }
.grupo-q {
  flex: none; min-width: 74px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 11px 12px;
  background: var(--surface);
  border: 1.5px solid var(--linha);
  border-radius: 16px;
  box-shadow: var(--e1);
  transition: transform .18s var(--mola), border-color .2s, box-shadow .2s;
}
.grupo-q:hover { box-shadow: var(--e2); }
.grupo-q:active { transform: scale(.95); }
.grupo-q.atual { border-color: var(--rio-500); background: var(--rio-50); }
.grupo-q .n {
  font-family: var(--fonte-num); font-size: 17px; font-weight: 700;
  letter-spacing: -.02em; color: var(--rio-600);
}
.grupo-q .v { font-size: 11px; font-weight: 600; color: var(--ink-3); }

/* ---------- 15d. Disponibilidade ---------- */
.disp-ocupados { display: grid; gap: 8px; }
.disp-hospede {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 13px;
  background: var(--barro-fundo);
  border-radius: 15px;
  transition: transform .16s var(--mola);
}
.disp-hospede:active { transform: scale(.98); }
.disp-q {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--barro); color: #fff;
  font-family: var(--fonte-num); font-size: 16px; font-weight: 700;
}
.disp-nome-box { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.disp-nome {
  font-size: 14px; font-weight: 700; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.disp-ate { font-size: 12px; font-weight: 600; color: var(--ink-3); }

.disp-grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 9px;
}
.disp-cel {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 13px 8px;
  border-radius: 15px;
  border: 2px solid transparent;
  transition: transform .16s var(--mola), filter .18s;
}
.disp-cel:active { transform: scale(.95); }
.disp-cel.livre { background: var(--mato-fundo); border-color: color-mix(in srgb, var(--mato) 30%, transparent); }
.disp-cel.ocupado { background: var(--barro-fundo); border-color: color-mix(in srgb, var(--barro) 30%, transparent); }
.disp-cel-n { font-family: var(--fonte-num); font-size: 19px; font-weight: 700; }
.disp-cel.livre .disp-cel-n { color: var(--mato); }
.disp-cel.ocupado .disp-cel-n { color: var(--barro); }
.disp-cel-s {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.disp-cel.livre .disp-cel-s { color: var(--mato); }
.disp-cel.ocupado .disp-cel-s { color: var(--barro); }

/* ---------- 16. Menu ---------- */
.menu-lista {
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--e1);
}
.menu-lista button {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  padding: 16px 17px;
  border-bottom: 1px solid var(--linha);
  font-size: 14.5px; font-weight: 600;
  transition: background .18s;
}
.menu-lista button:hover { background: var(--surface-2); }
.menu-lista button:last-child { border-bottom: 0; }
.menu-lista .icone {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--rio-50); color: var(--rio-600);
}
.menu-lista .seta { margin-left: auto; color: var(--ink-3); }

/* ---------- 17. Vazio, carregando, avisos ---------- */
.vazio { padding: 48px 22px; text-align: center; color: var(--ink-3); }
.vazio svg { margin-bottom: 12px; opacity: .3; }
.vazio p { margin: 0 0 4px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.vazio .dica { font-size: 13px; font-weight: 500; }

.esqueleto {
  height: 76px; margin-bottom: 10px;
  border-radius: var(--r-md);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 45%, var(--surface) 60%);
  background-size: 300% 100%;
  animation: cintila 1.5s ease-in-out infinite;
}
@keyframes cintila { from { background-position: 130% 0; } to { background-position: -30% 0; } }

.aviso {
  display: flex; align-items: flex-start; gap: 11px;
  margin-bottom: 12px; padding: 13px 15px;
  border-radius: 15px;
  font-size: 13px; font-weight: 600; line-height: 1.45;
  animation: item-entra .3s var(--mola) both;
}
.aviso svg { flex: none; margin-top: 1px; }
.aviso.info { background: var(--rio-50); color: var(--rio-700); }
.aviso.atencao { background: var(--sol-fundo); color: var(--sol-tinta); }
.aviso.erro { background: var(--barro-fundo); color: var(--barro); }
.aviso.ok { background: var(--mato-fundo); color: var(--mato); }

/* ---------- 18. Mensagens flutuantes ---------- */
.torrada {
  position: fixed; z-index: 80;
  left: 50%; bottom: calc(var(--tab-h) + var(--inf) + 20px);
  transform: translate(-50%, 24px) scale(.94);
  display: flex; align-items: center; gap: 10px;
  max-width: min(92vw, 420px);
  padding: 13px 18px 13px 15px;
  border-radius: 17px;
  background: var(--rio-900); color: #fff;
  font-size: 13.5px; font-weight: 700; line-height: 1.35;
  box-shadow: var(--e3);
  opacity: 0; pointer-events: none;
  transition: opacity .26s var(--mola), transform .34s var(--mola);
}
.torrada.mostra { opacity: 1; transform: translate(-50%, 0) scale(1); }
.torrada .marca {
  width: 26px; height: 26px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .16);
}
.torrada.ok .marca { background: var(--mato); }
.torrada.erro { background: #7d2d18; }
.torrada.erro .marca { background: var(--barro); }

/* ---------- 19. Relatórios ---------- */
.rel-tot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabela th {
  padding: 9px 6px; text-align: left;
  border-bottom: 1.5px solid var(--linha);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3);
}
.tabela td { padding: 11px 6px; border-bottom: 1px solid var(--linha); font-weight: 600; }
.tabela td.dir, .tabela th.dir { text-align: right; }
.tabela tbody tr { transition: background .16s; }
.tabela tbody tr:hover { background: var(--surface-2); }

/* ---------- 20. Página do hóspede ---------- */
.hospede { min-height: 100dvh; background: var(--mist); }
.hospede-topo {
  padding: calc(34px + var(--sup)) 22px 0;
  text-align: center; color: #fff;
  background: linear-gradient(165deg, var(--rio-500), var(--rio-700) 60%, var(--rio-900));
}
.hospede-topo img { height: 58px; width: auto; max-width: 180px; object-fit: contain; }
.hospede-topo h1 { margin: 14px 0 5px; font-size: 22px; }
.hospede-topo p { margin: 0 0 20px; font-size: 13.5px; font-weight: 500; opacity: .78; }
.hospede-corpo { max-width: 480px; margin: 0 auto; padding: 20px 18px 44px; }
.hospede .cartao { margin-bottom: 14px; }
.pronto { padding: 34px 14px; text-align: center; }
.pronto .marca-ok {
  width: 70px; height: 70px; margin: 0 auto 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--mato-fundo); color: var(--mato);
  animation: pulo .55s var(--mola) both;
}
@keyframes pulo {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

/* Informações úteis na tela do hóspede */
.uteis { display: grid; gap: 12px; }
.util { display: flex; align-items: center; gap: 12px; }
.util-ic {
  width: 36px; height: 36px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--rio-50); color: var(--rio-600);
}
.util-txt { display: flex; flex-direction: column; min-width: 0; }
.util-t { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.util-v { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.contato { text-align: center; }

/* ---------- 21. Faixa de demonstração ---------- */
.faixa-demo {
  padding: 7px 12px; text-align: center;
  background: var(--sol); color: #3a2807;
  font-size: 12px; font-weight: 800;
}

/* ---------- 22. Telas grandes ---------- */
@media (min-width: 1024px) {
  .app { flex-direction: row; }
  .abas {
    position: sticky; top: 0; left: 0; right: auto; bottom: auto;
    width: 104px; height: 100dvh;
    grid-template-columns: 1fr; grid-auto-rows: min-content;
    align-content: start; gap: 6px; padding: 22px 10px;
    background: var(--surface);
    border-top: 0; border-right: 1px solid var(--linha);
    backdrop-filter: none;
  }
  .abas button { padding: 13px 4px; border-radius: 15px; }
  .abas button[aria-selected="true"] { background: var(--rio-50); }
  .abas-indicador {
    top: 22px; left: 2px;
    width: 3.5px; height: 54px; border-radius: 4px;
  }
  .fab-slot { order: 9; height: 62px; margin-top: 12px; }
  .fab { position: static; transform: none; width: 100%; height: 58px; border-radius: 19px; }
  .fab:active { transform: scale(.95); }
  .col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .conteudo { max-width: 900px; padding-bottom: 64px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .folha {
    left: 50%; right: auto; bottom: 26px;
    width: min(580px, 92vw);
    border-radius: var(--r-xl);
    transform: translate(-50%, calc(100% + 40px));
  }
  .folha.aberta { transform: translate(-50%, 0); }
  .torrada { bottom: 26px; }
}

/* ---------- 23. Preferências do sistema ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- 24. Impressão ---------- */
@media print {
  .abas, .topo, .fab, .veu, .torrada, .folha-rodape, .no-print { display: none !important; }
  body { background: #fff; }
}
