/* Festa Fácil · visual do sistema interno
   Cores da marca: amarelo/mostarda da casinha, balões verde, roxo e magenta, texto grafite. */
:root {
  --bg: #f7f5f0; --card: #ffffff; --ink: #2e2b28; --muted: #6f6a63; --line: #e9e4d8; --line-2: #f1ede4;
  --amarelo: #f7ef5e; --mostarda: #ecc01e; --mostarda-esc: #c99d07; --grafite: #33302c; --grafite-2: #24211e;
  --roxo: #664088; --roxo-claro: #f1ebf7; --magenta: #a02b6d; --verde: #00924a;
  --brand: #664088; --brand-ink: #fff;  /* ação principal: roxo dos balões */
  --ok: #00824a; --warn: #a96a00; --bad: #b4233c;
  --soft-ok: #e6f5ec; --soft-warn: #fdf4dc; --soft-bad: #fbe9ec; --soft-brand: #f1ebf7;
  --sombra: 0 1px 2px rgba(46,43,40,.06), 0 4px 14px rgba(46,43,40,.05);
  --sombra-alta: 0 12px 34px rgba(46,43,40,.18);
  --raio: 14px; --lateral: 248px; --topo: 64px;
  --fonte: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --titulo: "Baloo 2", "Nunito Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--fonte); background: var(--bg); color: var(--ink); }
a { color: var(--roxo); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }

/* ---------- topo ---------- */
header.top { position: fixed; inset: 0 0 auto 0; height: var(--topo); z-index: 40; display: flex; align-items: center; gap: 14px;
  padding: 0 18px; background: var(--grafite); color: #fff; box-shadow: 0 2px 0 var(--mostarda); }
.marca { display: flex; align-items: center; gap: 10px; color: #fff; background: none; border: 0; font: inherit; cursor: pointer;
  padding: 6px 10px 6px 4px; border-radius: 12px; text-decoration: none !important; }
button.marca:hover, a.marca:hover { background: rgba(255,255,255,.08); }
.marca-ico { height: 44px; width: auto; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.marca-txt { display: flex; flex-direction: column; line-height: 1.05; text-align: left; }
.marca-txt b { font-family: var(--titulo); font-size: 20px; letter-spacing: .2px; color: var(--amarelo); }
.marca-txt > span { font-size: 13px; color: #e8e2d6; font-weight: 600; }
.marca .seta { font-style: normal; color: var(--mostarda); margin-left: 2px; }
.top-dir { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.usuario { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.usuario .avatar { width: 34px; height: 34px; border-radius: 99px; background: var(--mostarda); color: var(--grafite); display: grid;
  place-items: center; font-weight: 800; font-family: var(--titulo); font-size: 17px; }
.usuario .quem { display: flex; flex-direction: column; line-height: 1.15; }
.usuario .quem small { color: #c9c2b5; }
.usuario button { background: transparent; border: 1px solid #57524b; color: #eee6d8; border-radius: 8px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: 13px; }
.usuario button:hover { border-color: var(--mostarda); color: #fff; }
.btn-menu { display: none; width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; padding: 9px; border-radius: 10px; }
.btn-menu span { display: block; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; }
.btn-menu:hover { background: rgba(255,255,255,.08); }

/* seletor de área (canto esquerdo) */
.seletor-modulo { position: relative; }
.menu-modulo { position: absolute; left: 0; top: calc(100% + 10px); min-width: 280px; max-height: 75vh; overflow: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sombra-alta); z-index: 55; padding: 6px; color: var(--ink); }
.menu-modulo a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--ink); font-weight: 600; }
.menu-modulo a small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.menu-modulo a:hover { background: var(--bg); text-decoration: none; }
.menu-modulo a.atual { background: var(--soft-brand); color: var(--roxo); }
.menu-modulo .grupo-modulo { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 10px 12px 3px; font-weight: 700; }
.menu-modulo a.sep { border-top: 1px solid var(--line); border-radius: 0 0 9px 9px; margin-top: 6px; font-weight: 600; }

/* sininho */
.sino { position: relative; background: transparent; border: 0; color: #fff; font-size: 19px; cursor: pointer; width: 40px; height: 40px; border-radius: 10px; }
.sino:hover { background: rgba(255,255,255,.08); }
.sino .n { position: absolute; top: 2px; right: 0; background: var(--magenta); color: #fff; font-size: 11px; font-weight: 800; border-radius: 99px;
  min-width: 18px; height: 18px; line-height: 18px; padding: 0 4px; border: 2px solid var(--grafite); }
.sino.toca { animation: balanca .6s 2; }
@keyframes balanca { 25% { transform: rotate(15deg); } 75% { transform: rotate(-15deg); } }
.caixa-notif { position: absolute; right: 12px; top: calc(var(--topo) - 4px); width: min(390px, calc(100vw - 24px)); background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sombra-alta); z-index: 60; max-height: 70vh; overflow: auto; }
.caixa-notif a.n { display: block; padding: 11px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.caixa-notif a.n:hover { background: var(--bg); text-decoration: none; }
.caixa-notif a.n.nova { background: #fffbe6; }
.caixa-notif a.n.alerta b { color: var(--bad); }
.caixa-notif .rod { display: flex; justify-content: space-between; padding: 9px 14px; font-size: 13px; }
.toast { position: fixed; right: 16px; bottom: 16px; background: var(--grafite); color: #fff; padding: 14px 18px; border-radius: 14px; z-index: 70;
  box-shadow: var(--sombra-alta); max-width: 360px; cursor: pointer; border-left: 4px solid var(--mostarda); }
.toast b { display: block; color: var(--amarelo); }

/* ---------- menu lateral ---------- */
.lateral { position: fixed; top: var(--topo); bottom: 0; left: 0; width: var(--lateral); background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 30; overflow-y: auto; }
.lateral .menu { display: flex; flex-direction: column; padding: 10px 10px 16px; gap: 1px; flex: 1; }
.lateral .grupo { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #9a9387; font-weight: 800; padding: 14px 12px 5px; }
.lateral .menu a { display: flex; align-items: center; gap: 10px; color: #3b3732; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14.5px; }
.lateral .menu a i { font-style: normal; width: 22px; text-align: center; font-size: 16px; }
.lateral .menu a:hover { background: var(--bg); text-decoration: none; }
.lateral .menu a.ativo { background: #fff6cc; color: var(--grafite); box-shadow: inset 3px 0 0 var(--mostarda); }
.lateral-rodape { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 13px; line-height: 1.2; }
.lateral-rodape img { height: 34px; opacity: .9; }
.veu { display: none; }

/* ---------- conteúdo ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 26px 28px 70px; }
body.com-lateral main { margin-left: var(--lateral); margin-right: auto; padding-top: calc(var(--topo) + 26px); max-width: calc(1240px + var(--lateral)); }
body.com-lateral { }
h1 { font-family: var(--titulo); font-size: 28px; line-height: 1.15; margin: 2px 0 18px; color: var(--grafite); font-weight: 700; }
h1 .sub, h1 .tag { font-family: var(--fonte); }
h2 { font-family: var(--titulo); font-size: 19px; margin: 0 0 12px; color: var(--grafite); font-weight: 700; }
.sub { color: var(--muted); font-size: 13px; font-weight: 400; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--raio); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--sombra); }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 18px; }
.kpi { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--raio); padding: 16px 18px 14px; box-shadow: var(--sombra); overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--mostarda); }
.kpi:nth-child(4n+2)::before { background: var(--roxo); }
.kpi:nth-child(4n+3)::before { background: var(--verde); }
.kpi:nth-child(4n+4)::before { background: var(--magenta); }
.kpi .v { font-family: var(--titulo); font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--grafite); }
.kpi .l { color: var(--muted); font-size: 13px; margin-top: 2px; }
.kpi.alerta::before { background: var(--bad); }
.kpi.alerta .v { color: var(--bad); }

/* tabelas */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: #8c857a; font-weight: 800; background: #fbfaf6; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: #fcfbf7; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.baixo td { background: var(--soft-warn) !important; }
tr.neg td { background: var(--soft-bad) !important; }
.tabela-rola { overflow-x: auto; }

/* etiquetas */
.tag { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: #f0ece3; color: #4a453f; white-space: nowrap; font-weight: 600; }
.tag.ok { background: var(--soft-ok); color: var(--ok); }
.tag.warn { background: var(--soft-warn); color: var(--warn); }
.tag.bad { background: var(--soft-bad); color: var(--bad); }
.tag.brand { background: var(--soft-brand); color: var(--roxo); }

/* formulários */
form .campos { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
input, select, textarea { width: 100%; font: inherit; padding: 9px 12px; border: 1px solid #d9d2c3; border-radius: 10px; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--roxo); box-shadow: 0 0 0 3px rgba(102,64,136,.15); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--roxo); }

/* botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; padding: 9px 18px; border-radius: 10px;
  border: 1px solid var(--roxo); background: var(--roxo); color: #fff; cursor: pointer; transition: filter .15s, transform .05s; text-decoration: none !important; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.sec { background: #fff; color: var(--roxo); border-color: #cbb9dc; }
.btn.sec:hover { background: var(--soft-brand); filter: none; }
.btn.peq { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.perigo { background: #fff; color: var(--bad); border-color: #e6b3bd; }
.btn.perigo:hover { background: var(--soft-bad); filter: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.acoes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

/* mensagens */
.msg { padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; border: 1px solid; border-left-width: 4px; }
.msg.success { background: var(--soft-ok); border-color: #b7dcc6; border-left-color: var(--ok); color: #0f5132; }
.msg.error { background: var(--soft-bad); border-color: #efc2ca; border-left-color: var(--bad); color: #7a1527; }
.msg.info, .msg.warning { background: var(--soft-warn); border-color: #f0dca4; border-left-color: var(--mostarda-esc); color: #6b4a00; }

.linha-item { display: grid; grid-template-columns: 1fr 120px 130px 36px; gap: 8px; margin-bottom: 8px; }
.linha-item button { border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; }
.barra { height: 8px; background: #efeadf; border-radius: 99px; overflow: hidden; }
.barra i { display: block; height: 100%; background: linear-gradient(90deg, var(--mostarda), var(--roxo)); border-radius: 99px; }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filtros > * { flex: 1 1 160px; }
.filtros .btn { flex: 0 0 auto; }
.vazio { color: var(--muted); font-style: italic; padding: 8px 0; }

/* ---------- tela de login ---------- */
body.tela-login { min-height: 100vh; background: var(--grafite); }
body.tela-login main { max-width: none; padding: 0; margin: 0; }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-marca { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 20% 10%, #fffbd0 0%, var(--amarelo) 38%, var(--mostarda) 100%);
  display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; color: var(--grafite); text-align: center; }
.login-marca img { width: min(260px, 50%); height: auto; filter: drop-shadow(0 10px 20px rgba(0,0,0,.15)); }
.login-marca h2 { font-size: 30px; margin: 22px 0 6px; }
.login-marca p { max-width: 380px; margin: 0; color: #4a3f17; }
.baloes { position: absolute; inset: 0; pointer-events: none; }
.baloes i { position: absolute; width: 90px; height: 110px; border-radius: 50% 50% 48% 52%; opacity: .16; }
.baloes i:nth-child(1) { background: var(--verde); left: 6%; top: 12%; transform: rotate(-12deg); }
.baloes i:nth-child(2) { background: var(--roxo); right: 8%; top: 22%; transform: rotate(10deg); width: 120px; height: 145px; }
.baloes i:nth-child(3) { background: var(--magenta); left: 14%; bottom: 10%; transform: rotate(8deg); }
.login-form { background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-caixa { width: 100%; max-width: 380px; }
.login-caixa h1 { font-size: 30px; margin-bottom: 4px; }
.login-caixa .sub { display: block; margin-bottom: 22px; }
.login-caixa input { padding: 12px 14px; font-size: 16px; }
.login-caixa .btn { width: 100%; padding: 12px; font-size: 16px; margin-top: 6px; }

/* ---------- celular / tablet ---------- */
@media (max-width: 1000px) {
  .btn-menu { display: block; }
  .lateral { transform: translateX(-102%); transition: transform .2s; box-shadow: var(--sombra-alta); }
  body.menu-aberto .lateral { transform: none; }
  body.menu-aberto .veu { display: block; position: fixed; inset: var(--topo) 0 0 0; background: rgba(0,0,0,.35); z-index: 25; }
  body.com-lateral main { margin-left: 0; padding: calc(var(--topo) + 18px) 16px 60px; }
  .usuario .quem { display: none; }
}
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; }
  .login-marca { min-height: 240px; padding: 28px; }
  .login-marca img { width: 120px; }
  .login-marca h2 { font-size: 22px; margin-top: 12px; }
  .login-marca p { display: none; }
}
@media (max-width: 640px) {
  .linha-item { grid-template-columns: 1fr 90px; }
  .marca-txt b { font-size: 17px; }
  .marca-ico { height: 36px; }
  h1 { font-size: 23px; }
  .usuario form button { padding: 5px 8px; }
}
@media print {
  header.top, .lateral, .veu { display: none !important; }
  body.com-lateral main { margin: 0; padding: 0; }
}
.lateral .menu a i .mini-ze { width:22px; height:22px; border-radius:50%; object-fit:cover; vertical-align:middle; box-shadow:0 0 0 2px var(--mostarda); }
.usuario .link-senha { color:#eee6d8; text-decoration:none; font-size:15px; padding:4px 6px; border-radius:8px; }
.usuario .link-senha:hover { background:rgba(255,255,255,.08); }

/* aviso de manutenção */
.faixa-manut { position: fixed; left: 0; right: 0; top: var(--topo); z-index: 45; background: #fff3c2; color: #5c4300; border-bottom: 2px solid var(--mostarda);
  padding: 9px 18px; text-align: center; font-size: 14px; box-shadow: var(--sombra); }
.faixa-manut.ativa { background: var(--soft-bad); color: var(--bad); border-color: var(--bad); }
.faixa-manut .relogio-manut, .relogio-manut { font-variant-numeric: tabular-nums; font-size: 1.1em; }
.modal-manut { position: fixed; inset: 0; z-index: 95; background: rgba(36,33,30,.55); display: grid; place-items: center; padding: 16px; }
.modal-manut .caixa { background: #fff; border-radius: 20px; padding: 28px 26px; max-width: 440px; text-align: center; box-shadow: var(--sombra-alta); }
.modal-manut .relogio-manut { font-family: var(--titulo); font-size: 26px; color: var(--magenta); }
.interruptor { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
body.com-lateral.com-faixa main { padding-top: calc(var(--topo) + 66px); }
body.com-faixa .lateral { top: calc(var(--topo) + 40px); }
.barra.saude-ok i { background: var(--verde); } .barra.saude-warn i { background: var(--mostarda); } .barra.saude-bad i { background: var(--bad); }
/* telas de aviso (sem acesso, não encontrada) */
.tela-aviso { max-width: 520px; margin: 40px auto; text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 34px 28px; box-shadow: var(--sombra); }
.tela-aviso-ico { width: 84px; height: 84px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; font-size: 40px;
  background: #fff6cc; box-shadow: 0 0 0 6px #fffbe6; }
.tela-aviso h1 { margin: 12px 0 8px; }
.tela-aviso p { color: var(--muted); margin: 0 auto; max-width: 420px; }
/* câmaras */
.cam-grade { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.cam-col { border-top: 4px solid #7cc6e8; }
.cam-topo { margin-bottom: 8px; }
.cam-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #8c857a; margin: 14px 0 6px; }
.cam-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; margin-bottom: 8px; background: #fff; }
.cam-item .n { text-align: right; white-space: nowrap; }
.cam-item .mover { grid-column: 1 / -1; }
.cam-item .mover select { padding: 4px 8px; font-size: 13px; width: auto; color: var(--muted); }
.cam-item.congelando { background: #eef8fd; border-color: #cbe8f5; }
.cam-item.perto { background: var(--soft-warn); border-color: #f0dca4; }
.cam-item.vencido { background: var(--soft-bad); border-color: #efc2ca; }

/* pendências (painel e início do setor) */
.pendencias h2 { margin-bottom: 8px; }
.pend { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; border: 1px solid transparent; }
.pend + .pend { border-top-color: var(--line); border-radius: 0; }
a.pend:hover { background: var(--soft-warn, #fff7e6); }
.pend.atrasada { background: var(--soft-bad); border-radius: 10px; border-color: #f1c0c0; margin: 4px 0; }
.pend-ico { width: 22px; text-align: center; flex: none; }
.pend-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pend-tempo { flex: none; font-size: 13px; color: var(--muted, #6b7280); white-space: nowrap; }
.pend-tempo.bad { color: var(--bad); font-weight: 700; }
@media (max-width: 600px) { .pend { flex-wrap: wrap; } .pend-tempo { margin-left: 34px; } }

/* tela inicial: sistema interno */
.modulos { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 14px 0 18px; }
.modulo { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--raio);
  padding: 16px 18px; box-shadow: var(--sombra); color: var(--ink); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.modulo:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.modulo .m-ico { font-size: 30px; line-height: 1; }
.modulo > b { font-family: "Baloo 2", sans-serif; font-size: 20px; margin-top: 4px; }
.modulo .m-linhas { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; font-size: 14px; }
.modulo .m-alerta { color: var(--bad); font-weight: 700; }
.modulo .m-valor { color: var(--muted); font-size: 13px; margin-top: 2px; }
