:root {
  --laranja: #FF5A00; --laranja-esc: #d94c00; --preto: #111111; --grafite: #1e1f22; --grafite2: #2a2c30;
  --borda: #e4e4e7; --fundo: #f6f6f7; --texto: #18181b; --suave: #6b6b73; --branco: #fff;
  --ok: #16a34a; --alerta: #d97706; --erro: #dc2626; --azul: #2563eb;
  --raio: 10px; --sombra: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fundo); color: var(--texto); font-size: 15px; }
a { color: var(--laranja-esc); }
h1, h2, h3 { margin: 0 0 .75rem; line-height: 1.2; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.carregando { padding: 3rem; text-align: center; color: var(--suave); }

/* Login */
.tela-login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(circle at 20% 0%, #2a2c30, #111 60%); }
.cartao-login { width: 100%; max-width: 380px; background: var(--branco); border-radius: 14px; padding: 2rem 1.75rem; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.marca { display: flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: .02em; }
.marca .z { width: 34px; height: 34px; border-radius: 8px; background: var(--laranja); color: #fff; display: grid; place-items: center; font-size: 1.15rem; }
.marca small { display: block; font-weight: 500; color: var(--suave); font-size: .8rem; letter-spacing: 0; }
.cartao-login .marca { margin-bottom: 1.5rem; }

/* Layout */
.topo { background: var(--preto); color: #fff; display: flex; align-items: center; gap: 1rem; padding: .7rem 1.25rem; position: sticky; top: 0; z-index: 5; }
.topo .marca small { color: #a1a1aa; }
.topo .direita { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .9rem; color: #d4d4d8; }
.abas { background: var(--grafite); display: flex; gap: .15rem; padding: 0 1rem; overflow-x: auto; position: sticky; top: 54px; z-index: 4; }
.abas button { background: none; border: 0; color: #c4c4cc; padding: .8rem .9rem; cursor: pointer; font-size: .92rem; border-bottom: 3px solid transparent; white-space: nowrap; }
.abas button:hover { color: #fff; }
.abas button.ativa { color: #fff; border-bottom-color: var(--laranja); }
main { max-width: 1180px; margin: 0 auto; padding: 1.25rem; }
.cabeca { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.cabeca h1 { margin: 0; }
.cabeca .acoes { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* Componentes */
.btn { border: 1px solid var(--borda); background: var(--branco); color: var(--texto); padding: .55rem .95rem; border-radius: 8px; cursor: pointer; font-size: .92rem; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }
.btn:hover { border-color: #c4c4cc; }
.btn.primario { background: var(--laranja); border-color: var(--laranja); color: #fff; }
.btn.primario:hover { background: var(--laranja-esc); }
.btn.perigo { color: var(--erro); }
.btn.pequeno { padding: .3rem .6rem; font-size: .82rem; }
.btn.bloco { width: 100%; justify-content: center; padding: .7rem; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; color: var(--laranja-esc); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

.campo { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; }
.campo label { font-size: .82rem; font-weight: 600; color: #3f3f46; }
input, select, textarea { font: inherit; padding: .55rem .7rem; border: 1px solid var(--borda); border-radius: 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(255,90,0,.35); border-color: var(--laranja); }
textarea { min-height: 80px; resize: vertical; }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 .9rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.card { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1rem 1.1rem; box-shadow: var(--sombra); }
.card .rotulo { font-size: .8rem; color: var(--suave); text-transform: uppercase; letter-spacing: .04em; }
.card .valor { font-size: 1.6rem; font-weight: 700; margin-top: .3rem; }
.card .valor.laranja { color: var(--laranja); }
.painel { background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 1.1rem; margin-bottom: 1.1rem; }

.tabela-wrap { overflow-x: auto; background: var(--branco); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid #f0f0f2; vertical-align: top; }
th { background: #fafafa; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.clicavel { cursor: pointer; } tr.clicavel:hover td { background: #fff7f2; }
.num { text-align: right; white-space: nowrap; }
.vazio { padding: 2rem; text-align: center; color: var(--suave); }
.sub { color: var(--suave); font-size: .85rem; }

.etiqueta { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.e-disponivel, .e-encerrada { background: #dcfce7; color: #166534; }
.e-alugado, .e-ativa { background: #ffedd5; color: #9a3412; }
.e-manutencao { background: #fef9c3; color: #854d0e; }
.e-inativo, .e-cancelada { background: #f4f4f5; color: #52525b; }
.e-atrasada { background: #fee2e2; color: #991b1b; }

.filtros { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .9rem; }
.filtros select, .filtros input { width: auto; min-width: 160px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 1rem; z-index: 20; }
.modal[hidden] { display: none; }
.modal-caixa { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; padding: 1.35rem; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-rodape { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.aviso { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--preto); color: #fff; padding: .7rem 1.1rem; border-radius: 8px; z-index: 30; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.aviso.erro { background: var(--erro); }
.erro-txt { color: var(--erro); font-size: .88rem; margin: .4rem 0; min-height: 1em; }
.faixa { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; }
.faixa.alerta { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.faixa.info { background: #f4f4f5; border: 1px solid var(--borda); }

.duas-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.lista-simples { list-style: none; margin: 0; padding: 0; }
.lista-simples li { padding: .5rem 0; border-bottom: 1px solid #f0f0f2; font-size: .9rem; }
.lista-simples li:last-child { border-bottom: 0; }
.qr { background: #fff; padding: 1rem; display: inline-block; border-radius: 10px; border: 1px solid var(--borda); }
.qr svg { width: 260px; height: 260px; display: block; }
.chat { background: #efeae2; border-radius: 10px; padding: 1rem; min-height: 180px; max-height: 420px; overflow: auto; }
.bolha { max-width: 85%; padding: .55rem .75rem; border-radius: 8px; margin-bottom: .5rem; white-space: pre-wrap; font-size: .9rem; }
.bolha.eu { background: #d9fdd3; margin-left: auto; }
.bolha.bot { background: #fff; }

@media (max-width: 760px) {
  .duas-col { grid-template-columns: 1fr; }
  main { padding: 1rem; }
  .topo .direita span { display: none; }
  .card .valor { font-size: 1.3rem; }
}
