/* BentoTask — estilos */
:root {
  /* Identidade BentoTask: azul profundo #101827 · azul tecnológico #2563EB · verde esmeralda #10B981 · branco gelo #F8FAFC */
  --bg: #F8FAFC; --surface: #FFFFFF; --surface-2: #F1F5F9; --border: #E2E8F0; --text: #101827; --muted: #64748B;
  --primary: #101827; --primary-2: #2563EB; --accent: #10B981; --accent-forte: #047857; --accent-bg: #E7F8F1; --danger: #C62828; --danger-bg: #FDECEC;
  --shadow: 0 1px 2px rgba(16,24,39,.06), 0 4px 16px rgba(16,24,39,.06); --radius: 12px;
  --s-na: #94A3B8; --s-na-bg: #F1F5F9; --s-prog: #2563EB; --s-prog-bg: #E8F0FE; --s-pend: #A16207; --s-pend-bg: #FEF6D8;
  --s-prox: #C2410C; --s-prox-bg: #FFEDDF; --s-atr: #C62828; --s-atr-bg: #FDECEC; --s-docs: #7E22CE; --s-docs-bg: #F3E8FF;
  --s-ok: #15803D; --s-ok-bg: #E6F6EC;
  --sidebar: 248px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-tema="escuro"] {
  --bg: #0A0F1A; --surface: #101827; --surface-2: #0D1422; --border: #243049; --text: #F8FAFC; --muted: #94A3B8;
  --primary: #F8FAFC; --primary-2: #60A5FA; --accent: #34D399; --accent-forte: #10B981; --accent-bg: #0C2E24; --danger: #FF7A7A; --danger-bg: #3A1618;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --s-na-bg: #1B2537; --s-prog-bg: #13254A; --s-pend-bg: #3A2E0B; --s-prox-bg: #3D2312; --s-atr-bg: #3A1618; --s-docs-bg: #2C1842; --s-ok-bg: #11301F;
  --s-prog: #7AA2FF; --s-pend: #F5C451; --s-prox: #FF9C5B; --s-atr: #FF7A7A; --s-docs: #C99BFF; --s-ok: #5DD58C;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-2); }
.oculto { display: none !important; }

/* Layout */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.lateral { background: #101827; color: #DCE6F5; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.marca { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 16px; color: #fff; }
.marca img { width: 32px; height: 32px; border-radius: 8px; }
.logo-txt { font-weight: 500; letter-spacing: -.01em; } .logo-txt b { font-weight: 800; }
.slogan { font-weight: 600; color: var(--accent-forte) !important; }
.marca small { display: block; font-weight: 500; font-size: 11.5px; color: #9FB3CF; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #C9D6EA; text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.ativo { background: rgba(16,185,129,.16); color: #fff; box-shadow: inset 3px 0 0 #10B981; }
.nav a .ic { width: 20px; text-align: center; opacity: .9; }
.nav a .cont { margin-left: auto; background: #C62828; color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; }
.lateral .rodape { margin-top: auto; font-size: 12px; color: #8EA3C2; padding: 10px; }
.principal { min-width: 0; display: flex; flex-direction: column; }
.topo { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topo h1 { font-size: 18px; margin: 0; font-weight: 650; }
.topo .busca { margin-left: auto; position: relative; width: min(360px, 40vw); }
.topo .busca input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.topo .busca::before { content: "⌕"; position: absolute; left: 11px; top: 6px; color: var(--muted); font-size: 16px; }
.conteudo { padding: 22px 24px 90px; max-width: 1500px; width: 100%; }
.faixa-demo { background: #7E22CE; color: #fff; text-align: center; font-size: 12.5px; padding: 5px 10px; font-weight: 600; }
.faixa-offline { background: #A16207; color: #fff; text-align: center; font-size: 12.5px; padding: 5px; }
.inferior { display: none; }

/* Componentes */
.cartao { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.cartao h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
.grade { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.kpi { cursor: pointer; transition: transform .12s, border-color .12s; text-align: left; }
.kpi:hover { transform: translateY(-1px); border-color: var(--primary-2); }
.kpi .rot { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.kpi .val { font-size: 28px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.kpi.alerta .val { color: var(--s-atr); } .kpi.ok .val { color: var(--s-ok); } .kpi.aviso .val { color: var(--s-prox); }
.duas { grid-template-columns: 1.4fr 1fr; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 550; white-space: nowrap; }
.btn:hover { border-color: var(--primary-2); }
.btn.prim { background: var(--primary-2); color: #fff; border-color: var(--primary-2); }
[data-tema="escuro"] .btn.prim { color: #0A0F1A; } [data-tema="escuro"] .btn.verde { color: #0A0F1A; }
.btn.verde { background: var(--accent-forte); color: #fff; border-color: var(--accent-forte); }
.btn.perigo { color: var(--danger); }
.btn.peq { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.barra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.barra .esp { flex: 1; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=time], input[type=search], select, textarea {
  border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 8px 10px; min-width: 0; }
textarea { width: 100%; min-height: 70px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 1px; }
label.campo { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 550; }
label.campo input, label.campo select, label.campo textarea { color: var(--text); font-size: 14px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; }
.form .larga { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 14px; margin: 0 0 14px; }
legend { font-weight: 650; font-size: 13px; padding: 0 6px; }
table.tab { width: 100%; border-collapse: collapse; }
.tab th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; }
.tab td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tab tr.clic { cursor: pointer; } .tab tr.clic:hover td { background: var(--surface-2); }
.rolagem { overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.muted { color: var(--muted); } .pequeno { font-size: 12.5px; } .dir { text-align: right; } .forte { font-weight: 650; }
.vazio { text-align: center; color: var(--muted); padding: 34px 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.st-na { color: var(--s-na); background: var(--s-na-bg); } .st-prog { color: var(--s-prog); background: var(--s-prog-bg); }
.st-pend { color: var(--s-pend); background: var(--s-pend-bg); } .st-prox { color: var(--s-prox); background: var(--s-prox-bg); }
.st-atr { color: var(--s-atr); background: var(--s-atr-bg); } .st-docs { color: var(--s-docs); background: var(--s-docs-bg); }
.st-ok { color: var(--s-ok); background: var(--s-ok-bg); }
.tag-val { font-size: 11px; padding: 1px 7px; border-radius: 6px; font-weight: 600; }
.tag-val.pend { background: var(--s-pend-bg); color: var(--s-pend); } .tag-val.ok { background: var(--s-ok-bg); color: var(--s-ok); }

/* Matriz */
.matriz { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.matriz th, .matriz td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 6px; background: var(--surface); }
.matriz thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 11.5px; font-weight: 650; min-width: 112px; vertical-align: bottom; }
.matriz .fixa { position: sticky; left: 0; z-index: 1; min-width: 210px; max-width: 260px; text-align: left; }
.matriz thead .fixa { z-index: 3; }
.cel { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; cursor: pointer; border-radius: 8px; padding: 5px 7px; width: 100%; border: 0; text-align: left; }
.cel small { font-weight: 500; opacity: .85; font-size: 11px; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; }
.coluna { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.coluna h3 { font-size: 13px; margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.card-t { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow); }
.card-t .tit { font-weight: 600; margin-bottom: 4px; }

/* Calendário */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dsem { font-size: 12px; color: var(--muted); text-align: center; font-weight: 600; }
.dia { min-height: 92px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.dia.fora { opacity: .45; } .dia.hoje { border-color: var(--primary-2); box-shadow: inset 0 0 0 1px var(--primary-2); }
.dia.feriado .num::after { content: " • feriado"; color: var(--s-docs); font-size: 10.5px; }
.dia .num { font-size: 12.5px; font-weight: 650; }
.dia .ev { font-size: 11px; border-radius: 6px; padding: 1px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Painéis laterais e modais */
.veu { position: fixed; inset: 0; background: rgba(7,15,30,.45); z-index: 40; display: flex; justify-content: flex-end; }
.gaveta { width: min(620px, 100%); height: 100%; background: var(--bg); overflow: auto; box-shadow: -8px 0 30px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.gaveta header { display: flex; align-items: center; gap: 10px; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; }
.gaveta header h2 { margin: 0; font-size: 16px; flex: 1; }
.gaveta .corpo { padding: 18px 20px 40px; }
.gaveta footer { position: sticky; bottom: 0; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.def { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13.5px; margin-bottom: 14px; }
.def dt { color: var(--muted); } .def dd { margin: 0; }
.aviso { border-radius: 10px; padding: 10px 12px; background: var(--s-pend-bg); color: var(--text); border: 1px solid var(--border); font-size: 13.5px; margin-bottom: 12px; }
.aviso.info { background: var(--s-prog-bg); } .aviso.ok { background: var(--s-ok-bg); } .aviso.erro { background: var(--danger-bg); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #14213D; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); font-weight: 550; max-width: 90vw; }
.toast.erro { background: #B42318; }
.barras .linha { display: grid; grid-template-columns: 150px 1fr 48px; gap: 8px; align-items: center; margin: 7px 0; font-size: 13px; }
.barras .trilho { height: 10px; border-radius: 6px; background: var(--s-na-bg); overflow: hidden; display: flex; }
.barras .trilho span { display: block; height: 100%; }
.lista-sim { list-style: none; margin: 0; padding: 0; }
.lista-sim li { display: flex; gap: 10px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--border); cursor: pointer; }
.lista-sim li:last-child { border-bottom: 0; }
.abas { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); padding: 3px; border-radius: 10px; }
.abas button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.abas button.ativo { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.abas a { text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.abas a:hover { color: var(--text); }
.abas a.ativo, .abas a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.abas { flex-wrap: wrap; }
.cartoes-integracao { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cartao-integracao { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.cartao-integracao a.btn { align-self: flex-start; text-decoration: none; }
.cartao-integracao.ativo { border-color: var(--accent, #1f6f5c); }
.ajuda-campo { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
@media (max-width: 640px) { .cartoes-integracao { grid-template-columns: 1fr; } .abas a { padding: 6px 9px; } }
.check { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.check input { width: 18px; height: 18px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #101827, #172554 62%, #064E3B); }
.login .cartao { width: min(400px, 100%); padding: 28px; }
.login h1 { margin: 8px 0 4px; font-size: 22px; }

/* Responsivo (iPhone) */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { display: none; }
  .topo { padding: 12px 14px; padding-top: max(12px, env(safe-area-inset-top)); }
  .topo .busca { width: auto; flex: 1; }
  .conteudo { padding: 14px 12px 110px; }
  .duas { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi .val { font-size: 24px; }
  .inferior { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
  .inferior a { flex: 1; text-align: center; padding: 8px 0 7px; font-size: 11px; color: var(--muted); text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 600; }
  .inferior a .ic { font-size: 19px; }
  .inferior a.ativo { color: var(--primary-2); }
  .tab .ocultar-mobile { display: none; }
  .def { grid-template-columns: 1fr; gap: 0 0; } .def dt { margin-top: 8px; }
  .gaveta { width: 100%; }
  .barras .linha { grid-template-columns: 105px 1fr 40px; }
  .dia { min-height: 58px; } .dia .ev { display: none; } .dia .qt { display: block !important; }
  .kanban { grid-template-columns: repeat(5, 82vw); }
}
.dia .qt { display: none; font-size: 11px; font-weight: 700; }
@media print { .lateral, .topo, .inferior, .barra { display: none !important; } .app { display: block; } }
:root { color-scheme: light; } [data-tema="escuro"] { color-scheme: dark; }
