/* Plataforma Cortese: tema em variáveis (cores e logo no estilo do Hotel Cortese desde 01/12/2026; troca tudo aqui) */
:root {
  /* marca: Hotel Cortese (Instagram @cortesehotel, 01/12/2026): verde da bandeira, creme, preto e o vermelho da faixa */
  --verde: #17552f; --vermelho: #b9252c; --creme: #f6f1e8;
  --marca: var(--verde); --marca-texto: #fff;
  --fundo: var(--creme); --surface-1: #fffdf9; --surface-2: #fffdf9; --bg-neutral: #eee6d8;
  --border: rgba(40,30,10,.10); --border-strong: rgba(40,30,10,.20);
  --text-primary: #1d1b17; --text-secondary: rgba(29,27,23,.64); --text-muted: rgba(29,27,23,.48);
  --fill-primary: var(--verde); --on-primary: #fff;
  --bg-accent: #e3eee6; --text-accent: #17552f;
  --bg-success: #e6f0dc; --text-success: #3b6d11;
  --bg-warning: #f8ebd4; --text-warning: #84500c;
  --bg-danger: #f8e3e2; --text-danger: #a3262b;
  --fill-ghost-selected: rgba(23,85,47,.08);
  --nav-on: #e3eee6; --nav-on-texto: #17552f;
  --logo-tinta: #1d1b17;
  --radius: 8px; --radius-card: 12px;
  --fonte: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-tema="escuro"] {
  --verde: #7fbf93; --vermelho: #e0686d;
  --marca: #1f5c37; --marca-texto: #fff;
  --fundo: #121512; --surface-1: #1a1e1a; --surface-2: #1f241f; --bg-neutral: #2a302a;
  --border: rgba(255,255,255,.09); --border-strong: rgba(255,255,255,.18);
  --text-primary: rgba(255,255,255,.92); --text-secondary: rgba(255,255,255,.64); --text-muted: rgba(255,255,255,.46);
  --fill-primary: #2f7a4b; --on-primary: #fff;
  --bg-accent: #1d3526; --text-accent: #9fd3ae;
  --bg-success: #22331a; --text-success: #a9d48a;
  --bg-warning: #3a2c12; --text-warning: #f0c47a;
  --bg-danger: #3d1d1d; --text-danger: #f0a0a0;
  --fill-ghost-selected: rgba(255,255,255,.08);
  --nav-on: #1d3526; --nav-on-texto: #b9e2c4;
  --logo-tinta: #f3efe6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--fonte); font-size: 13.5px; color: var(--text-primary); background: var(--fundo); -webkit-font-smoothing: antialiased; }
button, select, input, textarea { font: inherit; color: inherit; }
button { border: .5px solid var(--border-strong); background: transparent; border-radius: var(--radius); padding: 6px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button:hover { background: var(--fill-ghost-selected); }
a.botao { border: .5px solid var(--border-strong); border-radius: var(--radius); padding: 6px 11px; display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
a.botao:hover { background: var(--fill-ghost-selected); }
button.primario { background: var(--fill-primary); color: var(--on-primary); border-color: var(--fill-primary); }
button.primario:hover { opacity: .9; }
button.limpo { border: none; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: .5px solid var(--border-strong); background: var(--surface-1); border-radius: var(--radius); padding: 7px 10px; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--text-accent); outline-offset: 1px; }
label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.ti { font-size: 18px; line-height: 1; }
.muted { color: var(--text-muted); }
.sec { color: var(--text-secondary); }
.peq { font-size: 12px; }
.loading { padding: 40px; text-align: center; color: var(--text-muted); }

/* chips de status */
.chip { font-size: 12px; padding: 3px 8px; border-radius: var(--radius); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.chip.ok { background: var(--bg-success); color: var(--text-success); }
.chip.atencao { background: var(--bg-warning); color: var(--text-warning); }
.chip.problema { background: var(--bg-danger); color: var(--text-danger); }
.chip.neutro { background: var(--bg-neutral); color: var(--text-secondary); }
.chip.info { background: var(--bg-accent); color: var(--text-accent); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login form { width: 100%; max-width: 340px; background: var(--surface-1); border: .5px solid var(--border); border-radius: var(--radius-card); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { font-size: 18px; font-weight: 500; margin: 0; }
.login .logo { align-self: center; margin: 6px 0 10px; height: 96px; }
.login .faixa-it { height: 4px; margin: -24px -24px 6px; border-radius: var(--radius-card) var(--radius-card) 0 0; background: linear-gradient(90deg, #17552f 0 33.3%, #fff 33.3% 66.6%, #b9252c 66.6%); }
.login .erro { color: var(--text-danger); font-size: 13px; }

/* ---------- casca ---------- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.casca { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto 1fr; flex: 1; min-height: 0; }
.topo { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-bottom: .5px solid var(--border); background: var(--surface-1); position: sticky; top: 0; z-index: 5; }
.marca { width: 26px; height: 26px; border-radius: 7px; background: var(--marca); color: var(--marca-texto); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; flex: none; }
.marca-nome { font-weight: 500; font-size: 14px; }
/* logo: imagem do Hotel Cortese (claro/escuro) */
.logo { display: inline-flex; align-items: center; flex: none; height: 40px; }
.logo img { height: 100%; width: auto; display: block; }
.logo .logo-escuro, :root[data-tema="escuro"] .logo .logo-claro { display: none; }
:root[data-tema="escuro"] .logo .logo-escuro { display: block; }
.topo select { width: auto; font-size: 13px; padding: 5px 8px; margin-left: 8px; }
.busca-btn { flex: 1; max-width: 280px; margin-left: auto; justify-content: flex-start; color: var(--text-muted); border-color: var(--border); font-size: 13px; }
.busca-btn kbd { margin-left: auto; font-family: inherit; font-size: 11px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--fill-primary); color: var(--on-primary); font-size: 12px; font-weight: 500; display: flex; align-items: center; justify-content: center; padding: 0; border: none; flex: none; }
.lado { border-right: .5px solid var(--border); padding: 8px 6px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-1); }
.nav { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--text-secondary); padding: 8px 0; border-radius: var(--radius); text-decoration: none; border: none; width: 100%; }
.nav .ti { font-size: 20px; }
.nav.on { background: var(--nav-on); color: var(--nav-on-texto); }
.nav.breve { opacity: .45; cursor: default; }
.nav-fim { margin-top: auto; }
.nav.breve:hover { background: transparent; }
.principal { padding: 18px 22px 14px; min-width: 0; overflow: auto; display: flex; flex-direction: column; }
.principal > main { flex: 1; }
.assinatura { margin-top: 36px; text-align: center; font-size: 11px; letter-spacing: .04em; color: var(--text-muted); opacity: .8; }
.login .assinatura { margin-top: 16px; }
.assinatura a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.assinatura a:hover { color: var(--text-secondary); text-decoration: underline; }
.assinatura .ti { font-size: 12px; }
.cabeca { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.cabeca h1 { font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.cabeca .sub { font-size: 13px; color: var(--text-secondary); }
.cabeca .acoes { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* menu do avatar */
.menu { position: absolute; right: 14px; top: 48px; background: var(--surface-1); border: .5px solid var(--border-strong); border-radius: var(--radius); padding: 6px; min-width: 200px; z-index: 20; display: flex; flex-direction: column; }
.menu button { border: none; justify-content: flex-start; width: 100%; }
.menu .quem { padding: 6px 10px 8px; font-size: 12px; color: var(--text-secondary); border-bottom: .5px solid var(--border); margin-bottom: 4px; }

/* ---------- início: cartões ---------- */
.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cartao { background: var(--surface-2); border: .5px solid var(--border); border-radius: var(--radius-card); padding: 12px 14px; min-height: 104px; display: flex; flex-direction: column; text-align: left; align-items: stretch; gap: 0; }
.cartao.clica { cursor: pointer; }
.cartao.clica:hover { border-color: var(--border-strong); background: var(--surface-2); }
.cartao .rotulo { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.cartao .valor { font-size: 22px; font-weight: 500; margin-top: 4px; }
.cartao .valor.vazio { color: var(--text-muted); font-size: 16px; padding: 4px 0 2px; }
.cartao .linha { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.cartao .chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; min-width: 0; }
.cartao .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cartao .tirar { display: none; margin-left: auto; padding: 0 4px; height: 20px; border: none; }
.editando .cartao { border-style: dashed; }
.editando .cartao .tirar { display: inline-flex; }
.biblioteca { margin-top: 12px; border: .5px dashed var(--border-strong); border-radius: var(--radius-card); padding: 12px; }
.biblioteca .itens { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.biblioteca button { font-size: 12px; }

/* ---------- listas e fichas ---------- */
.filtros { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; border: .5px solid var(--border-strong); border-radius: var(--radius); overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: none; border-radius: 0; font-size: 13px; padding: 5px 10px; white-space: nowrap; flex: none; }
.seg button.on { background: var(--fill-ghost-selected); }
.filtros input[type=search] { width: 220px; }
.tabela { width: 100%; border-collapse: collapse; background: var(--surface-1); border: .5px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.tabela th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-secondary); padding: 9px 12px; border-bottom: .5px solid var(--border); background: var(--surface-1); }
.tabela td { padding: 10px 12px; border-bottom: .5px solid var(--border); vertical-align: top; }
.tabela tr:last-child td { border-bottom: none; }
.tabela tbody tr { cursor: pointer; }
.tabela tbody tr:hover td { background: var(--fill-ghost-selected); }
.vazio-msg { padding: 28px; text-align: center; color: var(--text-muted); background: var(--surface-1); border: .5px solid var(--border); border-radius: var(--radius-card); }
.voltar { margin-bottom: 10px; font-size: 13px; color: var(--text-secondary); border: none; padding: 4px 0; }
.blocos { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.bloco { background: var(--surface-1); border: .5px solid var(--border); border-radius: var(--radius-card); padding: 14px 16px; }
.bloco h2 { font-size: 14px; font-weight: 500; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.bloco h2 button { margin-left: auto; font-size: 12px; padding: 4px 8px; }
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.campo .k { font-size: 12px; color: var(--text-muted); }
.campo .v { margin-top: 1px; overflow-wrap: anywhere; }
.campo.largo { grid-column: 1 / -1; }
.item { padding: 9px 0; border-top: .5px solid var(--border); display: flex; gap: 10px; align-items: flex-start; }
.item:first-of-type { border-top: none; }
.item .corpo { flex: 1; min-width: 0; }
.item .acoes { display: flex; gap: 4px; }
.item .acoes button { border: none; padding: 3px 6px; }

/* ---------- janela (formulários e busca) ---------- */
.janela-fundo { position: fixed; inset: 0; background: rgba(0,0,0,.32); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; z-index: 30; }
.janela { width: 100%; max-width: 560px; max-height: 84vh; overflow: auto; background: var(--surface-1); border: .5px solid var(--border-strong); border-radius: var(--radius-card); padding: 18px; }
.janela h2 { font-size: 16px; font-weight: 500; margin: 0 0 14px; }
.janela .grade-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.janela .grade-form .largo { grid-column: 1 / -1; }
.janela .rodape { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.janela .erro { color: var(--text-danger); font-size: 13px; margin-top: 10px; }
.busca-janela { padding: 0; }
.busca-janela input { border: none; border-bottom: .5px solid var(--border); border-radius: 0; padding: 14px 16px; font-size: 15px; }
.busca-janela input:focus { outline: none; }
.busca-res { max-height: 50vh; overflow: auto; padding: 6px; }
.busca-res button { width: 100%; border: none; justify-content: flex-start; text-align: left; padding: 8px 10px; }
.busca-res button.on { background: var(--fill-ghost-selected); }
.busca-res .grupo { font-size: 11px; color: var(--text-muted); padding: 8px 10px 4px; }

.aviso-demo { background: var(--bg-warning); color: var(--text-warning); font-size: 12px; padding: 6px 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aviso-demo button { font-size: 12px; padding: 2px 8px; border-color: currentColor; }
.aviso-demo button.on { background: rgba(0,0,0,.08); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--fill-primary); color: var(--on-primary); padding: 9px 14px; border-radius: var(--radius); font-size: 13px; z-index: 40; }

/* ---------- hotel e escala ---------- */
.barra-oc { height: 8px; background: var(--fill-ghost-selected, #eee); border-radius: 4px; overflow: hidden; margin-top: 5px; min-width: 60px; }
.barra-oc span { display: block; height: 100%; background: var(--verde); border-radius: 4px; }
.oc-tab td.num, .oc-tab th.num { text-align: right; white-space: nowrap; }
.oc-tab tr.fds td { background: var(--surface-2); }
.oc-tab tr.apagado td { color: var(--text-muted); }
.oc-tab tr.sel td { background: var(--fill-ghost-selected); font-weight: 500; }
.colunas-oc { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 6px; }
.colunas-oc .col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.colunas-oc .b { background: var(--verde); border-radius: 3px 3px 0 0; }
.colunas-oc .col.fds .b { opacity: .6; }
.colunas-oc .d { font-size: 10px; color: var(--text-muted); text-align: center; height: 14px; line-height: 14px; }
.contadores { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.contador { display: flex; align-items: center; gap: 10px; border: .5px solid var(--border); border-radius: var(--radius); padding: 8px 10px; background: var(--surface-2); }
.contador .corpo { flex: 1; font-size: 15px; } .contador b { min-width: 28px; text-align: center; font-size: 20px; }
.contador button { width: 40px; height: 40px; justify-content: center; font-size: 18px; }
.so-leitura #corpo input, .so-leitura #corpo select, .so-leitura #corpo textarea { pointer-events: none; opacity: .7; }
.so-leitura [data-acao], .so-leitura [data-sobe], .so-leitura #h-foto, .so-leitura #l-foto, .so-leitura #r-foto, .so-leitura #c-nova, .so-leitura #b-nova,
.so-leitura #p-novo, .so-leitura #o-novo, .so-leitura [data-novo] { display: none !important; }
.abas button { display: inline-flex; align-items: center; gap: 5px; }
.abas button.on { background: var(--nav-on); color: var(--nav-on-texto); }
.tabela.compacta td, .tabela.compacta th { padding: 5px 6px; }
.tabela.lanc tbody tr { cursor: default; }
.tabela.lanc input, .tabela.lanc select { padding: 4px 6px; font-size: 13px; min-width: 64px; }
.tabela.lanc input[type=number] { width: 72px; }
.tabela.lanc input[type=time] { width: 98px; }
.tabela.cafe input, .tabela.cafe select { width: 78px; min-width: 0; }
.tabela td.n, .escala td.n, .escala th.n { text-align: right; white-space: nowrap; }
.salvo { outline: 2px solid var(--text-success) !important; transition: outline .3s; }
td.falta { background: var(--bg-danger); color: var(--text-danger); font-weight: 600; }
td.sobra { background: var(--bg-warning); color: var(--text-warning); }
.atencao-txt { color: var(--text-warning); font-weight: 600; }
th.hoje, td.hoje { box-shadow: inset 0 -2px 0 var(--fill-primary); }
label.check { display: flex; gap: 10px; align-items: center; font-size: 15px; color: inherit; padding: 8px 0; border-top: .5px solid var(--border); }
label.check input { width: 22px; height: 22px; flex: none; }
button.grande { padding: 12px 10px; font-size: 16px; justify-content: center; }
.escala-wrap { overflow-x: auto; background: var(--surface-1); border: .5px solid var(--border); border-radius: var(--radius-card); }
table.escala { border-collapse: collapse; font-size: 12px; width: 100%; }
table.escala th, table.escala td { border-bottom: .5px solid var(--border); padding: 4px 3px; text-align: center; }
table.escala th { font-weight: 500; color: var(--text-secondary); position: sticky; top: 0; background: var(--surface-1); }
table.escala th span { font-size: 10px; color: var(--text-muted); }
table.escala .nome { text-align: left; white-space: nowrap; padding-left: 10px; position: sticky; left: 0; background: var(--surface-1); min-width: 120px; z-index: 1; }
table.escala .dom { background: rgba(185,37,44,.05); }
table.escala td.c { min-width: 24px; cursor: pointer; font-weight: 600; }
table.escala td.dia { color: var(--fill-primary); background: var(--nav-on); }
table.escala td.noite { color: #9cc7f0; background: #1d2f45; }
table.escala td.folga { color: var(--text-muted); font-weight: 400; }
table.escala td.fora { background: transparent; cursor: default; }
table.escala td.aj { background-image: radial-gradient(circle at 85% 18%, var(--vermelho) 2px, transparent 2.5px); }
table.escala tr.sep td { text-align: left; font-size: 11px; color: var(--text-muted); padding: 8px 10px 3px; background: var(--fundo); position: static; }
table.escala tr.cob td.c { cursor: default; font-weight: 500; font-size: 11px; }

@media print {
  .topo, .lado, .assinatura, .abas, #acoes, .aviso-demo, .blocos { display: none !important; }
  .casca { display: block; } .principal { padding: 0; overflow: visible; }
  body { background: #fff; color: #000; } .escala-wrap { border: none; overflow: visible; }
  table.escala { font-size: 9px; } table.escala td.noite { background: #dde8f5; color: #000; } table.escala td.dia { background: #e4efe7; color: #000; }
  @page { size: A4 landscape; margin: 8mm; }
}

/* ---------- celular ---------- */
@media (max-width: 720px) {
  .casca { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .lado { grid-row: 3; flex-direction: row; justify-content: space-around; border-right: none; border-top: .5px solid var(--border); position: sticky; bottom: 0; padding: 4px; }
  .nav { padding: 6px 0; }
  .nav-fim { margin-top: 0; }
  .principal { padding: 14px 14px 12px; }
  .busca-btn { max-width: none; }
  .busca-btn span.txt, .busca-btn kbd, .marca-nome { display: none; }
  .topo .logo { height: 32px; }
  .busca-btn { flex: 0; margin-left: auto; }
  .topo { gap: 6px; padding: 6px 10px; }
  .topo select { max-width: 118px; margin-left: 2px; }
  .campos, .janela .grade-form { grid-template-columns: 1fr; }
  .tabela .col-opc { display: none; }
  .filtros input[type=search] { width: 100%; }
}

/* ---------- início (02/12) ---------- */
.sec-titulo { font-size: 12px; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; margin: 4px 0 8px; }
.inicio-blocos { margin-top: 14px; }
.emp-linha { cursor: pointer; align-items: center; }
.emp-linha:hover .corpo > div:first-child { text-decoration: underline; }
.emp-linha .chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.emp-dir { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.emp-v { font-size: 18px; font-weight: 500; }
.emp-mods { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.aten-grupo + .aten-grupo { margin-top: 10px; }
.aten-mod { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
