/* ===========================================================
   A Rosa e o Rei - Sistema de tokens visuais
   Dois temas (claro/escuro), alternaveis pelo botao no topo
   da barra lateral. Azul como cor de destaque, numeros tratados
   como lancamentos de um livro contabil (mono, linhas de regua).
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --radius: 10px;
  --logo-lima: #e5484d;
  --logo-gest: #4c9aff;
}

:root, [data-theme="dark"] {
  --ink: #f2f2f2;
  --ink-soft: #a3a3a3;
  --wood-dark: #000000;
  --wood-line: rgba(255,255,255,0.12);
  --paper: #000000;
  --paper-raised: #141414;
  --input-bg: #1c1c1c;
  --brass: #4c9aff;
  --brass-light: #7ab4ff;
  --accent-bg-soft: rgba(76,154,255,0.16);
  --accent-bg-softer: rgba(76,154,255,0.06);
  --accent-ring: rgba(76,154,255,0.2);
  --sage: #6fbf82;
  --sage-bg: rgba(111,191,130,0.14);
  --terracotta: #e0725c;
  --terracotta-bg: rgba(224,114,92,0.14);
  --violeta: #a78bfa;
  --violeta-bg: rgba(167,139,250,0.16);
  --amber: #e8b44e;
  --amber-bg: rgba(232,180,78,0.16);
  --neutro: #a3a3a3;
  --neutro-bg: rgba(255,255,255,0.08);
  --line: rgba(255,255,255,0.14);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] {
  --ink: #1a1a1c;
  --ink-soft: #63636b;
  --wood-dark: #ffffff;
  --wood-line: #e4e4e8;
  --paper: #f7f7f9;
  --paper-raised: #ffffff;
  --input-bg: #ffffff;
  --brass: #2563eb;
  --brass-light: #1d4ed8;
  --accent-bg-soft: rgba(37,99,235,0.1);
  --accent-bg-softer: rgba(37,99,235,0.05);
  --accent-ring: rgba(37,99,235,0.18);
  --sage: #1e8a4c;
  --sage-bg: #e3f5ea;
  --terracotta: #c8462f;
  --terracotta-bg: #fbe6e1;
  --violeta: #7c3aed;
  --violeta-bg: #f0eafd;
  --amber: #a1670c;
  --amber-bg: #fbf0dc;
  --neutro: #63636b;
  --neutro-bg: #eeeef1;
  --line: #e4e4e8;
  --shadow: 0 8px 24px rgba(20, 20, 20, 0.08);
}

* { box-sizing: border-box; }
img { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; }

/* ---------- ANIMACOES BASE ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes floatSlow {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(0, -14px); }
}
@keyframes floatTiny {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes floatSlower {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(10px, 10px) scale(1.05); }
}
@keyframes shakeX {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 var(--accent-ring); }
  70% { box-shadow: 0 0 0 8px rgba(0,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}
@keyframes viewFadeOut {
  to { opacity: 0; transform: translateX(-16px) scale(0.98); }
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateX(16px) scale(1.02); }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: opacity 0.35s ease;
  user-select: none;
  -webkit-user-select: none;
}

/* Campos de formulario continuam selecionaveis normalmente pra digitar/copiar/colar. */
input, textarea, select, [contenteditable] {
  user-select: text;
  -webkit-user-select: text;
}

body { animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }

::view-transition-old(root) {
  animation: viewFadeOut 0.15s cubic-bezier(0.4, 0, 1, 1) both;
}
::view-transition-new(root) {
  animation: viewFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
::view-transition-group(root) {
  animation-duration: 0.2s;
}
body.saindo {
  opacity: 0;
  pointer-events: none;
}

/* Transicao suave ao alternar claro/escuro: classe temporaria (ver common.js aplicarTema)
   forca a animacao das cores em tudo, sem afetar as transicoes proprias de hover/clique
   o resto do tempo. */
html.tema-mudando,
html.tema-mudando *,
html.tema-mudando *::before,
html.tema-mudando *::after {
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease, fill 0.35s ease !important;
}

/* scrollbar mais fina e discreta em todo o sistema */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 20px; border: 2px solid var(--paper); }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-soft); }

h1, h2, h3, .display {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

.mono, .valor, td.num, th.num {
  font-family: 'IBM Plex Mono', monospace;
}

a { color: inherit; }

/* ---------- LAYOUT ---------- */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--wood-dark);
  color: var(--ink-soft);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
@media (min-width: 861px) {
  .sidebar { transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s, color 0.2s, border-color 0.2s; }
  .app.sidebar-colapsada .sidebar { width: 76px; }
}

.topbar-flutuante {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-flutuante > .clima-local { order: 1; }
.topbar-flutuante > .relogio-brasil { order: 2; }
.topbar-flutuante > .btn-theme { order: 3; }
.topbar-flutuante > .avatar-usuario { order: 4; }

.relogio-brasil {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 5px 12px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.clima-local {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--ink-soft);
  padding: 5px 12px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  white-space: nowrap;
}
.clima-local:hover { border-color: var(--brass-light); color: var(--brass-light); }

.clima-confirmar-local {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--accent-bg-soft);
  border: 1px solid var(--brass-light);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.clima-confirmar-local:hover { background: var(--paper-raised); }

/* Saudacao do usuario: so aparece no Painel Geral, acima do titulo (h1). */
.saudacao-usuario { margin-bottom: 6px; }
.saudacao-texto {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

.btn-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, color 0.15s, transform 0.1s;
}
.btn-theme:hover { border-color: var(--brass-light); color: var(--brass-light); transform: translateY(-1px); box-shadow: var(--shadow), 0 0 0 4px var(--accent-bg-softer); }
.btn-theme:active { transform: scale(0.9); }
#btn-theme-icone { display: inline-block; transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.btn-theme:hover #btn-theme-icone { transform: rotate(25deg) scale(1.15); }

.avatar-usuario {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--accent-bg-soft);
  box-shadow: var(--shadow);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.15s;
}
.avatar-usuario:hover { border-color: var(--brass-light); transform: translateY(-1px) scale(1.04); }
.avatar-usuario img { width: 100%; height: 100%; object-fit: cover; }
.avatar-usuario .avatar-iniciais {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--brass-light);
}
.avatar-usuario.avatar-preview {
  width: 84px;
  height: 84px;
  cursor: default;
}
.avatar-usuario.avatar-preview .avatar-iniciais { font-size: 32px; }

.mobile-topbar { display: contents; }

.btn-menu-mobile {
  display: none;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--ink-soft);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: color 0.15s;
}
.btn-menu-mobile:hover { color: var(--brass-light); }

.btn-logout {
  /* Acao de sair agora fica no menu do avatar (Editar perfil / Sair) - o botao antigo
     continua no HTML de cada pagina por compatibilidade, mas nao aparece mais. */
  display: none;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, color 0.15s;
}
.btn-logout:hover { border-color: var(--brass-light); color: var(--brass-light); }

.sidebar .brand {
  padding: 0 24px 18px;
  border-bottom: 1px solid var(--wood-line);
  margin-bottom: 8px;
  text-align: center;
  transition: padding 0.3s ease;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  margin-bottom: 10px;
  position: relative;
  transition: padding 0.3s ease;
}

.brand-logo-pousada {
  display: block;
  width: 100%;
  max-width: 160px;
  height: auto;
  margin-left: 10px;
  filter: brightness(0) invert(1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
[data-theme="light"] .brand-logo-pousada { filter: none; }

/* ---------- SIDEBAR COLAPSAVEL ---------- */
.brand-logo-completa { cursor: pointer; }

.brand-logo-icone {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: none;
  border: none;
  padding: 4px 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.6) rotate(-10deg);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand-logo-icone img {
  width: 36px;
  height: auto;
  filter: brightness(0) invert(1);
}
[data-theme="light"] .brand-logo-icone img { filter: none; }
.brand-logo-icone:hover { transform: scale(1.08); }

@media (min-width: 861px) {
  .app.sidebar-colapsada .sidebar .brand { padding: 0 8px 14px; }
  .app.sidebar-colapsada .brand-logo-wrap { padding: 10px 2px; }
  .app.sidebar-colapsada .brand-logo-pousada {
    opacity: 0;
    transform: scale(0.7);
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
  .app.sidebar-colapsada .brand-logo-icone {
    display: flex;
    opacity: 1;
    transform: scale(1) rotate(0deg);
    position: static;
  }
  .app.sidebar-colapsada .nav-tabs { padding: 0 10px; }
  .app.sidebar-colapsada .nav-tabs > li > a,
  .app.sidebar-colapsada .nav-group-titulo {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    gap: 0;
  }
  .app.sidebar-colapsada .nav-tabs > li > a .nav-label,
  .app.sidebar-colapsada .nav-group-titulo .nav-label,
  .app.sidebar-colapsada .nav-group-seta {
    display: none;
  }
  .app.sidebar-colapsada .nav-group { position: relative; }
  .app.sidebar-colapsada .nav-group .nav-subtabs {
    position: absolute;
    left: calc(100% + 10px);
    top: 0;
    width: 210px;
    max-height: none;
    opacity: 0;
    visibility: hidden;
    margin: 0;
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 8px;
    z-index: 70;
    transition: opacity 0.2s ease, visibility 0.2s;
  }
  .app.sidebar-colapsada .nav-group.aberto .nav-subtabs {
    opacity: 1;
    visibility: visible;
  }
  .app.sidebar-colapsada .main { padding-left: 28px; }
}

.sidebar .brand .logo {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 700;
}

.logo-lima { color: var(--logo-lima); }
.logo-gest { color: var(--logo-gest); }

.sidebar .brand .sub {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}

.nav-tabs {
  list-style: none;
  padding: 0 14px;
  margin: 12px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Empurra esse item pro rodape do menu lateral, mesmo sobrando espaco vazio abaixo dos
   demais itens (ex: "Configurações") - a lista ja e flex-column, entao margin-top:auto
   consome todo o espaco livre acima dele. */
.nav-tabs > li.nav-fixado-embaixo { margin-top: auto; }

.nav-tabs li a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 500;
  position: relative;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
  overflow: hidden;
}

.nav-tabs li a::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px;
  height: 0;
  background: var(--brass-light);
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  transition: height 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icone-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  font-size: 14.5px;
  flex-shrink: 0;
  background: var(--accent-bg-soft);
  color: var(--brass-light);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.icone-badge-brass { background: var(--accent-bg-soft); color: var(--brass-light); }
.icone-badge-sage { background: var(--sage-bg); color: var(--sage); }
.icone-badge-terracotta { background: var(--terracotta-bg); color: var(--terracotta); }
.icone-badge-violeta { background: var(--violeta-bg); color: var(--violeta); }
.icone-badge-amber { background: var(--amber-bg); color: var(--amber); }
.icone-badge-neutro { background: var(--neutro-bg); color: var(--ink-soft); }
.nav-tabs li a:hover .icone-badge,
.nav-group-titulo:hover .icone-badge { transform: scale(1.1) rotate(-4deg); }
.nav-tabs li a.active .icone-badge,
.nav-group.active .nav-group-titulo .icone-badge { box-shadow: 0 0 0 1.5px currentColor inset; }

.nav-tabs li a .icone {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-tabs li a:hover {
  background: var(--accent-bg-softer);
  border-color: var(--wood-line);
  color: var(--ink);
  transform: translateX(2px);
}
.nav-tabs li a:hover .icone { transform: scale(1.15); }

.nav-tabs li a.active {
  background: var(--accent-bg-soft);
  border-color: var(--brass-light);
  color: var(--ink);
}
.nav-tabs li a.active::before { height: 60%; }

.nav-group-titulo {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 14px;
  background: none;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-group-titulo .icone {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-group-titulo:hover {
  background: var(--accent-bg-softer);
  border-color: var(--wood-line);
  color: var(--ink);
  transform: translateX(2px);
}

.nav-group.active .nav-group-titulo {
  color: var(--ink);
  border-color: var(--wood-line);
}

.nav-group-seta {
  margin-left: auto;
  font-size: 10px;
  color: var(--ink-soft);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-group.aberto .nav-group-seta { transform: rotate(-180deg); }

.nav-subtabs {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.nav-group.aberto .nav-subtabs {
  max-height: 260px;
  opacity: 1;
  margin: 6px 0 2px;
}

.nav-subtabs li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 38px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.nav-subtabs li a .icone {
  font-size: 14px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-subtabs li a:hover {
  background: var(--accent-bg-softer);
  border-color: var(--wood-line);
  color: var(--ink);
  transform: translateX(2px);
}
.nav-subtabs li a:hover .icone { transform: scale(1.15); }

.nav-subtabs li a.active {
  background: var(--accent-bg-soft);
  border-color: var(--brass-light);
  color: var(--ink);
}

.main {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  padding: 32px 40px 60px;
  max-width: 1180px;
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.main::-webkit-scrollbar { display: none; }

.main-largo { max-width: none; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 12px;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-header h1 { font-size: 28px; }
.page-header p { color: var(--ink-soft); margin: 4px 0 0; font-size: 14px; }

/* ---------- CARDS ---------- */
.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  overflow-x: auto;
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--wood-line);
}

.card + .card { margin-top: 20px; }
.card + .card { animation-delay: 0.05s; }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-icon {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: var(--accent-bg-soft);
  color: var(--brass-light);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stat:hover .stat-icon { transform: scale(1.1) rotate(-4deg); }
.stat.positivo .stat-icon { background: var(--sage-bg); color: var(--sage); }
.stat.negativo .stat-icon { background: var(--terracotta-bg); color: var(--terracotta); }
.stat .label { max-width: calc(100% - 40px); }
.grid-stats .stat:nth-child(1) { animation-delay: 0.02s; }
.grid-stats .stat:nth-child(2) { animation-delay: 0.07s; }
.grid-stats .stat:nth-child(3) { animation-delay: 0.12s; }
.grid-stats .stat:nth-child(4) { animation-delay: 0.17s; }
.grid-stats .stat:nth-child(n+5) { animation-delay: 0.2s; }
.stat::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--brass);
  transition: width 0.2s ease;
}
.stat:hover::before { width: 6px; }
.stat.negativo::before { background: var(--terracotta); }
.stat.positivo::before { background: var(--sage); }

.stat .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.stat .value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 24px;
  font-weight: 600;
}
.stat .value.pos { color: var(--sage); }
.stat .value.neg { color: var(--terracotta); }

/* ---------- RESUMO POR MES (tabela + grafico) ---------- */
.resumo-mes-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 28px;
  align-items: start;
}
.grafico-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.grafico-header h3 { font-size: 16px; }
.grafico-wrap { position: relative; height: 260px; }
.select-inline { width: auto; min-width: 150px; padding: 7px 10px; font-size: 12.5px; }

@media (max-width: 900px) {
  .resumo-mes-grid { grid-template-columns: 1fr; }
  .resumo-mes-grafico { border-top: 1px solid var(--line); padding-top: 20px; }
}

/* ---------- LISTA DE RECEITAS (linha, nao card em grade) ---------- */
.receita-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.receita-linha + .receita-linha { margin-top: 0; }
.receita-linha-info { flex: 2 1 260px; min-width: 220px; }
.receita-linha-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 180px;
  color: var(--ink-soft);
  font-size: 12.5px;
}
.receita-linha-acoes {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
@media (max-width: 700px) {
  .receita-linha { flex-direction: column; align-items: flex-start; }
  .receita-linha-acoes { width: 100%; }
  .receita-linha-acoes .btn { flex: 1; justify-content: center; }
}

/* ---------- FORMS ---------- */
label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 5px;
  margin-top: 14px;
}
label:first-child { margin-top: 0; }

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
textarea { resize: vertical; min-height: 70px; }
input[type="checkbox"] { width: auto; padding: 0; border: none; background: none; accent-color: var(--brass); }
input[readonly] { background: var(--neutro-bg); color: var(--ink-soft); cursor: not-allowed; }
input[readonly]:focus { border-color: var(--line); box-shadow: none; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s, box-shadow 0.2s ease, filter 0.15s ease, border-color 0.15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }
.btn-primary {
  background: var(--brass);
  color: #fff;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-primary:hover:not(:disabled) { filter: brightness(0.92); box-shadow: 0 4px 14px var(--accent-ring); }
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.3) 35%, transparent 50%);
  transform: translateX(-100%);
  transition: transform 0.55s ease;
}
.btn-primary:hover:not(:disabled)::after { transform: translateX(100%); }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brass); box-shadow: 0 4px 14px var(--accent-bg-softer); }
.btn-danger { background: var(--terracotta-bg); color: var(--terracotta); }
.btn-danger:hover:not(:disabled) { opacity: 0.85; box-shadow: 0 4px 14px var(--terracotta-bg); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- TABLES (livro-caixa) ---------- */
table { width: 100%; border-collapse: collapse; }

/* ---------- ABAS (MAPA DE RESERVAS) ---------- */
.tabs-reservas {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.tab-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--brass-light); border-bottom-color: var(--brass); }

.hospede-picker {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.hospede-busca-wrap { position: relative; flex: 1; }
.hospede-busca-wrap input {
  padding: 14px 16px;
  font-size: 15px;
}
.hospede-sugestoes {
  position: absolute;
  top: 100%; left: 0; right: 0;
  margin-top: 4px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 5;
  box-shadow: var(--shadow);
}
.hospede-sugestao-item {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
.hospede-sugestao-item:last-child { border-bottom: none; }
.hospede-sugestao-item:hover { background: var(--accent-bg-soft); }
.hospede-sugestao-vazio { padding: 9px 12px; color: var(--ink-soft); font-size: 13px; }
.hospede-selecionado {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--accent-bg-softer);
  margin-top: 8px;
}

.reservar-resultado {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--sage-bg);
  border: 1px solid var(--sage);
}
.reservar-resultado .numero {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--sage);
}

/* ---------- MAPA DE RESERVAS ---------- */
.mapa-legenda-cor {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}
.mapa-legenda-pago { background: var(--sage); }
.mapa-legenda-pendente { background: var(--amber); }
.mapa-legenda-bloqueio { background: var(--terracotta); }

.mapa-reservas-card { padding: 0; overflow: hidden; }
.mapa-reservas-scroll {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mapa-reservas-scroll::-webkit-scrollbar { display: none; }
.mapa-reservas-tabela {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  white-space: nowrap;
  user-select: none;
}
.mapa-reservas-tabela th, .mapa-reservas-tabela td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0;
  font-size: inherit;
}
.mapa-canto {
  position: sticky; left: 0; top: 0; z-index: 3;
  background: var(--paper-raised);
  min-width: 150px;
}
.mapa-dia-cabecalho {
  position: sticky; top: 0; z-index: 2;
  background: var(--paper-raised);
  min-width: 34px;
  padding: 6px 2px !important;
  text-align: center;
  color: var(--ink-soft);
}
.mapa-dia-cabecalho .mapa-dia-numero { display: block; font-weight: 700; color: var(--ink); }
.mapa-dia-cabecalho .mapa-dia-semana { display: block; font-size: 10px; }
.mapa-dia-hoje { background: var(--accent-bg-soft) !important; }
.mapa-fim-semana { background: rgba(128,128,128,0.06); }

.mapa-linha-categoria td {
  position: sticky; left: 0;
  background: #1a1a1c;
  color: #fff;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 12px !important;
}
/* Categorias alternam em zebra preto/branco, pra nao repetir o vermelho ja usado
   no status "Pendente" das reservas e diferenciar visualmente cada bloco de quartos. */
.mapa-cat-cor-0 td { background: #1a1a1c; color: #fff; box-shadow: inset 0 0 0 1px #4a4a4e; }
.mapa-cat-cor-1 td { background: #f2f2f2; color: #1a1a1c; box-shadow: inset 0 0 0 1px #d0d0d4; }
.mapa-quarto-nome {
  position: sticky; left: 0; z-index: 1;
  background: var(--paper-raised);
  font-weight: 600;
  padding: 8px 12px !important;
  min-width: 150px;
}
.mapa-celula-vazia { cursor: pointer; height: 30px; }
.mapa-celula-vazia:hover { background: var(--accent-bg-soft); }
.mapa-celula-selecionada { background: var(--brass) !important; }
.mapa-celula-ocupada {
  position: relative;
  cursor: pointer;
  text-align: center;
  padding: 4px 2px !important;
  color: #fff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}
.mapa-ocupado-pago { background: var(--sage); }
.mapa-ocupado-pendente { background: var(--amber); color: #1a1a1c; }
.mapa-ocupado-bloqueio { background: var(--terracotta); }

/* Arredonda a ponta de inicio (check-in) e/ou fim (ultimo dia antes do check-out)
   da reserva, formando uma "pilula" - deixa claro onde cada reserva comeca e termina
   mesmo quando a proxima reserva e coladinha (mesmo dia) e tem a mesma cor de status. */
.mapa-inicio-estadia { border-top-left-radius: 50%; border-bottom-left-radius: 50%; }
.mapa-fim-estadia { border-top-right-radius: 50%; border-bottom-right-radius: 50%; }

/* No dia da troca (check-out de um hospede + check-in de outro no mesmo quarto no mesmo
   dia), esse cantinho na cor de quem esta saindo deixa claro que o check-out foi hoje -
   sem ele, o dia inteiro parece so de quem chega e da a impressao de que o outro saiu
   um dia antes. */
.mapa-troca-mesmodia::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 55% 0, 0 55%);
  background: var(--cor-saida);
  pointer-events: none;
}
.mapa-inicio-estadia.mapa-troca-mesmodia::before { border-top-left-radius: 50%; }

/* Nuvenzinha que pergunta "Reservar" ou "Bloquear" depois de selecionar os dias
   arrastando no mapa (ver abrirPopoverAcao em mapaReservas.js). */
.mapa-popover-acao {
  position: fixed;
  z-index: 30;
  gap: 8px;
  padding: 8px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.btn-icone { padding: 6px 9px; line-height: 1; }

/* Mini calendario (ver btn-abrir-minical em mapaReservas.js) - popover pra pular
   direto pro mes/dia escolhido no mapa de reservas, sem precisar clicar em
   "anterior/proximo" varias vezes. */
.minical-popover {
  position: fixed;
  z-index: 30;
  width: 230px;
  padding: 10px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.minical-cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.minical-cabecalho strong { font-size: 12.5px; text-transform: capitalize; }

.minical-semana,
.minical-dias {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.minical-semana span {
  text-align: center;
  font-size: 10px;
  color: var(--ink-soft);
  padding-bottom: 4px;
}

.minical-dia {
  border: none;
  background: transparent;
  border-radius: 6px;
  padding: 5px 0;
  font-size: 11.5px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.minical-dia:hover { background: var(--accent-bg-soft); }
.minical-dia.minical-outro-mes { color: var(--ink-soft); opacity: 0.5; }
.minical-dia.minical-hoje { border: 1px solid var(--brass); font-weight: 600; }
.minical-dia.minical-selecionado { background: var(--brass); color: #fff; font-weight: 600; }

/* Ativada via JS (ajustarAlturaMapa) quando a tela nao tem altura suficiente pra
   mostrar todas as categorias com o espacamento padrao - encolhe fonte e reticula. */
.mapa-reservas-tabela-compacta { font-size: 10.5px; }
.mapa-reservas-tabela-compacta .mapa-linha-categoria td { font-size: 9.5px; letter-spacing: 0.02em; }
.mapa-reservas-tabela-compacta .mapa-dia-cabecalho .mapa-dia-semana { font-size: 8.5px; }
.mapa-reservas-tabela-compacta .mapa-celula-ocupada { font-size: 9.5px; }

.link-perfil { color: var(--brass-light); font-weight: 600; }
.link-perfil:hover { text-decoration: underline; }

.menu-acoes-wrap { position: relative; display: inline-block; }
.menu-acoes {
  display: block;
  position: fixed;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 20;
  min-width: 150px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.95);
  transform-origin: top right;
  transition: opacity 0.16s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.16s;
}
.menu-acoes.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* Cada item entra em cascata (ver abrirMenuAcoes em common.js, que aplica o atraso
   crescente via --i) ao inves de todos aparecerem de uma vez com o painel. */
.menu-acoes button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 13.5px;
  cursor: pointer;
  opacity: 0;
  transform: translateX(-6px);
  transition: background 0.15s ease, padding-left 0.15s ease, transform 0.15s ease, color 0.15s ease,
    opacity 0.16s ease calc(var(--i, 0) * 0.03s), transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--i, 0) * 0.03s);
}
.menu-acoes.open button { opacity: 1; transform: translateX(0); }
.menu-acoes button svg { transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1); }
.menu-acoes button:hover { background: var(--accent-bg-soft); padding-left: 18px; }
.menu-acoes button:hover svg { transform: scale(1.15) rotate(-4deg); }
.menu-acoes button:active { background: var(--accent-bg-soft); transform: scale(0.97); transition-duration: 0.05s; }
thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  padding: 10px 10px;
  border-bottom: 2px solid var(--ink);
}
tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
tbody tr {
  transition: background 0.15s ease;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
tbody tr:nth-child(1) { animation-delay: 0.01s; }
tbody tr:nth-child(2) { animation-delay: 0.03s; }
tbody tr:nth-child(3) { animation-delay: 0.05s; }
tbody tr:nth-child(4) { animation-delay: 0.07s; }
tbody tr:nth-child(5) { animation-delay: 0.09s; }
tbody tr:nth-child(n+6) { animation-delay: 0.1s; }
tbody tr:hover { background: var(--accent-bg-softer); }
td.num, th.num { text-align: right; }

/* Tabelas de preco (por categoria e por quarto) do Motor de Reservas - linhas mais altas
   e coluna de acoes com respiro proprio, pra nao apertar o botao contra o texto/badge. */
.tabela-precos-categoria th, .tabela-precos-categoria td { padding: 16px 14px; }
.tabela-precos-categoria .col-acoes { width: 170px; }
.tabela-precos-categoria td:last-child { text-align: right; padding-right: 16px; }

/* ---------- CALENDARIO MENSAL DE PRECOS ---------- */
/* Grade estilo calendario (semana/dias do mes) com o preco de cada noite exibido embaixo
   do numero do dia - usado no Motor de Reservas (aba Preços e aba Quartos). */
.calendario-mes-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
}
.calendario-mes-nav strong {
  font-size: 16px;
  text-transform: capitalize;
  min-width: 170px;
  text-align: center;
}
.calendario-mes-semana {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  text-align: center;
  padding: 0 2px 6px;
}
.calendario-mes-grade {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-dia {
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--paper-raised);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.cal-dia:hover { border-color: var(--brass-light); transform: translateY(-1px); box-shadow: var(--shadow); }
.cal-dia-numero { font-size: 13px; font-weight: 600; }
.cal-dia-preco { font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; font-family: 'IBM Plex Mono', monospace; }
.cal-dia-minimo { font-size: 10px; color: var(--brass-light); margin-top: 2px; font-weight: 600; }
.cal-dia-fora { opacity: 0.35; cursor: default; }
.cal-dia-fora:hover { border-color: var(--line); transform: none; box-shadow: none; }
.cal-dia-hoje { border-color: var(--brass); box-shadow: inset 0 0 0 1px var(--brass); }
/* Aba Calendário - so consulta, sem clique pra editar. */
.cal-dia-somente-leitura { cursor: default; }
.cal-dia-somente-leitura:hover { border-color: var(--line); transform: none; box-shadow: none; }
.cal-dia-somente-leitura.cal-dia-hoje:hover { border-color: var(--brass); }
@media (max-width: 760px) {
  .cal-dia-preco { font-size: 10px; }
  .calendario-mes-nav strong { min-width: 130px; font-size: 14px; }
}

/* Linha divisoria entre grandes grupos de categoria (Mata/Horizonte/Villa Tai) em tabelas
   que mantem a sequencia numerica pura, ex: tabela de quartos do Motor de Reservas. */
.linha-grupo-categoria td {
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 7px 10px !important;
  border-bottom: 1px solid var(--line);
}
.valor-receita { color: var(--sage); font-weight: 600; }
.valor-despesa { color: var(--terracotta); font-weight: 600; }

/* ---------- BADGES ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  animation: fadeInScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.badge-sage { background: var(--sage-bg); color: var(--sage); }
.badge-terracotta { background: var(--terracotta-bg); color: var(--terracotta); }
.badge-brass { background: var(--accent-bg-soft); color: var(--brass-light); }
.badge-neutral { background: rgba(255,255,255,0.08); color: var(--ink-soft); }
.badge-amber { background: var(--amber-bg); color: var(--amber); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- PASSANTE (MESAS DO RESTAURANTE) ---------- */
.mesas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}
.mesa-card {
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  border: 2px dashed var(--line);
  background: var(--paper-raised);
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.mesa-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mesa-numero { font-family: 'Fraunces', serif; font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.mesa-livre .mesa-status { color: var(--ink-soft); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.mesa-ocupada { border-style: solid; border-color: var(--amber); background: var(--amber-bg); }
.mesa-nome { font-size: 17px; font-weight: 600; color: var(--ink); }
.mesa-dica { font-size: 11px; color: var(--ink-soft); margin-top: 8px; }

/* Quarto com check-in previsto pra hoje, mas a recepcao ainda nao confirmou que o
   hospede chegou de verdade (ver confirmarCheckin em hospedesDia.js). */
.mesa-aguardando-checkin { border-style: solid; border-color: var(--brass); background: var(--accent-bg-soft); }
.mesa-aguardando-checkin .mesa-dica { color: var(--brass-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; font-size: 11px; }
.mesa-btn-checkin { margin-top: 12px; }

/* ---------- HOSPEDES DO DIA (mesma ideia de cards do Passante, agrupada por espaco) ---------- */
.hospedes-dia-espaco { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hospedes-dia-espaco + .hospedes-dia-espaco { margin-top: 28px; }
.hospedes-dia-espaco-titulo {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

/* ---------- COMANDA (itens do cardapio de passantes e hospedes do dia) ---------- */
.comanda-itens {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 8px;
}
.comanda-item-linha {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.comanda-item-linha:last-child { border-bottom: none; }
.comanda-item-linha span:first-child { flex: 1; }
.comanda-item-linha span:nth-child(2) { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.comanda-item-linha.comanda-item-fixo { background: var(--accent-bg-softer); font-weight: 600; }
.comanda-vazia { padding: 16px 12px; text-align: center; color: var(--ink-soft); font-size: 13px; }
.comanda-total {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 4px 0;
  font-size: 16px;
}
.comanda-total strong { font-family: 'IBM Plex Mono', monospace; }
.comanda-form-item {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 16px;
}
.comanda-form-item > div:first-child { flex: 1; }
.comanda-form-item label { margin-top: 0; }
.comanda-qtd { width: 80px; }
.btn-remover-item {
  background: none;
  border: none;
  color: var(--terracotta);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}
.btn-remover-item:hover { opacity: 0.7; }

/* ---------- PERFIL DO HOSPEDE (tela Hospedes do Dia) ---------- */
.linha-clicavel { cursor: pointer; }
.linha-clicavel:hover td { background: var(--accent-bg-softer); }
.perfil-secao { margin-top: 20px; }
.perfil-secao:first-of-type { margin-top: 10px; }
.perfil-secao-titulo {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
  margin-bottom: 10px;
}
.perfil-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
}
.perfil-campo { font-size: 13.5px; }
.perfil-campo .rotulo { display: block; font-size: 11.5px; color: var(--ink-soft); }
.perfil-form-valor {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 12px;
}
.perfil-form-valor > div { flex: 1; }
.perfil-form-valor label { margin-top: 0; }
.despesa-origem-botoes { display: flex; gap: 10px; margin-top: 6px; }
.despesa-origem-botoes .btn { flex: 1; }
.comanda-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(0px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s, backdrop-filter 0.25s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; backdrop-filter: blur(3px); }
.modal {
  background: var(--paper-raised);
  border-radius: 14px;
  padding: 26px 28px;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: scale(0.94) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-backdrop.open .modal { transform: scale(1) translateY(0); }
.modal h2 { font-size: 20px; margin-bottom: 4px; }
.modal .close-x {
  float: right;
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  color: var(--ink-soft);
}
.modal .close-x + .close-x { margin-right: 10px; }
.modal .close-x:hover { color: var(--brass-light); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

@media print {
  body * { visibility: hidden; }
  #modal-ver.open, #modal-ver.open * { visibility: visible; }
  #modal-ver.open {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: block;
    background: #fff;
    padding: 0;
  }
  #modal-ver.open .modal {
    position: static;
    box-shadow: none;
    transform: none;
    max-width: 100% !important;
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  #modal-ver .close-x,
  #ver-tabs-meia {
    display: none !important;
  }
}

/* ---------- LOGIN PAGE ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wood-dark);
  background-image: radial-gradient(circle at 20% 20%, var(--accent-bg-soft), transparent 40%),
                     radial-gradient(circle at 80% 80%, var(--accent-bg-softer), transparent 40%);
  position: relative;
  overflow: hidden;
}
.login-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.login-orbs .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
}
.login-orbs .orb-1 {
  width: 340px; height: 340px;
  top: -80px; left: -80px;
  background: var(--accent-bg-soft);
  animation: floatSlow 10s ease-in-out infinite;
}
.login-orbs .orb-2 {
  width: 260px; height: 260px;
  bottom: -60px; right: -40px;
  background: var(--sage-bg);
  animation: floatSlower 13s ease-in-out infinite;
}
.login-orbs .orb-3 {
  width: 200px; height: 200px;
  bottom: 20%; left: 8%;
  background: var(--terracotta-bg);
  animation: floatSlow 15s ease-in-out infinite reverse;
}
.login-card {
  position: relative;
  z-index: 1;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  padding: 44px 40px;
  border-radius: 14px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
  transition: opacity 0.4s ease, transform 0.4s ease;
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.login-card.sucesso {
  opacity: 0;
  transform: scale(0.96) translateY(-10px);
}
.btn-primary.sucesso {
  background: var(--sage);
  pointer-events: none;
}
.btn-primary .check {
  display: inline-block;
  opacity: 0;
  transform: scale(0.4);
  margin-right: 4px;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-primary.sucesso .check {
  opacity: 1;
  transform: scale(1);
}
.login-brand {
  text-align: center;
  margin-bottom: 26px;
}
.login-brand .brand-logo-wrap {
  padding: 14px 22px;
}
.login-brand .brand-logo-pousada {
  max-width: 210px;
  animation: floatSlow 6s ease-in-out infinite;
}
.login-brand .tag {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 12px;
}
.login-error {
  background: var(--terracotta-bg);
  color: var(--terracotta);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-top: 14px;
  display: none;
}
.login-error.show { display: block; animation: shakeX 0.4s ease; }
.login-hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--ink-soft);
  background: rgba(255,255,255,0.06);
  padding: 10px 12px;
  border-radius: 8px;
}

.powered-by {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 22px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.powered-by strong { color: var(--ink); }

.aviso-somente-leitura {
  background: var(--accent-bg-soft);
  border: 1px solid var(--brass);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
}

/* ---------- MISC ---------- */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--ink-soft);
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.empty-state .icon {
  font-size: 34px;
  margin-bottom: 8px;
  display: inline-block;
  animation: floatTiny 3.5s ease-in-out infinite;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-bar {
  position: relative;
  max-width: 340px;
  width: 100%;
}
.search-bar input { padding-left: 34px; }
.search-bar .icon {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- CALENDARIO DE PAGAMENTOS ---------- */
.calendario-dias {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.dia-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  min-height: 84px;
  background: var(--paper);
  transition: border-color 0.15s, transform 0.15s;
}
.dia-cell:hover { border-color: var(--wood-line); transform: translateY(-1px); }

.dia-cell.hoje {
  border-color: var(--brass);
  background: var(--accent-bg-softer);
  animation: pulseRing 2.4s ease-out infinite;
}

.dia-numero {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.dia-cell.hoje .dia-numero { color: var(--brass-light); font-weight: 600; }

.dia-chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chip-pagamento {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  background: var(--accent-bg-soft);
  border: none;
  border-radius: 6px;
  padding: 4px 7px;
  color: var(--brass-light);
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: filter 0.1s, transform 0.1s;
}
.chip-pagamento:hover { filter: brightness(1.15); transform: translateX(1px) scale(1.02); }

.chip-valor {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-soft);
}

@media (max-width: 700px) {
  .calendario-dias { grid-template-columns: repeat(4, 1fr); }
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  transition: padding-left 0.15s ease;
}
.checklist-item:hover { padding-left: 6px; }
.checklist-item .ordem {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--brass);
  min-width: 22px;
}

.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1c1c1c;
  border: 1px solid var(--line);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  overflow: hidden;
  transform: translateX(24px) scale(0.94);
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 340px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.toast.show { opacity: 1; transform: translateX(0) scale(1); }
.toast.erro { background: var(--terracotta); }
.toast.sucesso { background: var(--sage); }
.toast-icone { display: inline-flex; flex-shrink: 0; font-size: 18px; }
.toast-texto { flex: 1; }
.toast-barra {
  position: absolute;
  left: 0; bottom: 0;
  height: 3px;
  width: 100%;
  background: rgba(255,255,255,0.55);
  transform-origin: left;
  transform: scaleX(0);
}
.toast.show .toast-barra { animation: toastBarra 3.2s linear both; }
@keyframes toastBarra {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 860px) {
  .app { flex-direction: column; }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    padding: 0 10px 0 6px;
    background: var(--wood-dark);
    border-bottom: 1px solid var(--wood-line);
    z-index: 56;
  }
  .btn-menu-mobile { display: flex; }

  .topbar-flutuante { position: static; display: flex; align-items: center; gap: 6px; }
  .relogio-brasil, .clima-local { display: none; }
  .btn-theme { width: 30px; height: 30px; }
  .btn-logout { padding: 6px 12px; }
  .avatar-usuario:not(.avatar-preview) { width: 40px; height: 40px; }

  .sidebar {
    position: fixed;
    top: 56px; left: 0; right: 0; bottom: 0;
    flex-direction: column;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    border-right: none;
    z-index: 55;
    transition: max-height 0.25s ease;
  }
  .sidebar.mobile-aberto { max-height: none; overflow-y: auto; padding: 14px 0 24px; }
  .sidebar .brand { display: none; }

  .main { padding: 76px 20px 20px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
