/* Layout: menu lateral fixo + área de trabalho com barra superior; em telas pequenas o menu vira gaveta. */
:root {
  --bg: #f2f4f6;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --line: #d8dee5;
  --line-strong: #bcc6d1;
  --fg: #16202a;
  --muted: #5a6877;
  --accent: #1d6b73;
  --accent-hover: #175860;
  --accent-fg: #ffffff;
  --accent-soft: #dcecec;
  --ok: #2b7d49;   --ok-soft: #e3f3e8;
  --warn: #a06a12; --warn-soft: #fcf1d9;
  --bad: #b8352a;  --bad-soft: #fbe8e5;
  --block: #b9460f;
  --shadow: 0 1px 2px rgba(22, 32, 42, .06), 0 8px 24px rgba(22, 32, 42, .08);
  --radius: 10px;
  --f-display: 'Sora', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --side: 248px;
  --s1: #00879e; --s2: #8a5cc4; --s3: #c47a12; /* série de gráficos (validada p/ daltonismo) */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141a; --surface: #151d25; --surface-2: #1b252f; --line: #26333f; --line-strong: #364555;
    --fg: #e3e9ee; --muted: #93a2b0; --accent: #4fb1b9; --accent-hover: #6cc3ca; --accent-fg: #06282b; --accent-soft: #16343a;
    --ok: #5cc083; --ok-soft: #15301f; --warn: #e2ad4a; --warn-soft: #33290f; --bad: #f07a6d; --bad-soft: #3a1b18; --block: #f2925c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35); --s1: #16a0ab; --s2: #9a74dd; --s3: #b87d1c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e141a; --surface: #151d25; --surface-2: #1b252f; --line: #26333f; --line-strong: #364555;
  --fg: #e3e9ee; --muted: #93a2b0; --accent: #4fb1b9; --accent-hover: #6cc3ca; --accent-fg: #06282b; --accent-soft: #16343a;
  --ok: #5cc083; --ok-soft: #15301f; --warn: #e2ad4a; --warn-soft: #33290f; --bad: #f07a6d; --bad-soft: #3a1b18; --block: #f2925c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35); --s1: #16a0ab; --s2: #9a74dd; --s3: #b87d1c;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; line-height: 1.25; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; font-weight: 600; }
h2 { font-size: 1.1rem; font-weight: 600; }
h3 { font-size: .98rem; font-weight: 600; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.carregando { display: grid; place-items: center; height: 100vh; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- botões e campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 36px; padding: .4rem .9rem; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 30px; padding: .2rem .6rem; font-size: .82rem; }
.btn-icon { width: 36px; padding: 0; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.campo { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.campo > span { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.campo em { font-style: normal; color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: 38px; padding: .45rem .65rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=range] { width: 100%; accent-color: var(--accent); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
.check { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; font-size: .92rem; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.grid-form .full { grid-column: 1 / -1; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-arte { background: var(--accent); color: var(--accent-fg); padding: 3rem clamp(1.5rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; position: relative; overflow: hidden; }
.login-arte h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 700; max-width: 14ch; }
.login-arte p { max-width: 42ch; opacity: .9; }
.login-marca { font-family: var(--f-display); font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; gap: .6rem; }
.login-marca i { width: 28px; height: 28px; border-radius: 7px; background: var(--accent-fg); display: inline-block; position: relative; }
.login-marca i::after { content: ''; position: absolute; inset: 7px 6px 9px 7px; border: 2.5px solid var(--accent); border-top: 0; border-right: 0; transform: rotate(-45deg); }
.login-fitas { display: grid; gap: .45rem; font-family: var(--f-mono); font-size: .8rem; }
.login-fitas div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .75rem; border-radius: 6px; background: color-mix(in srgb, var(--accent-fg) 12%, transparent); }
.login-form { display: grid; place-items: center; padding: 2rem 1rem; }
.login-caixa { width: min(400px, 100%); display: grid; gap: 1rem; }
.login-caixa h2 { font-size: 1.35rem; }
.demo-lista { display: grid; gap: .35rem; max-height: 250px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: .35rem; background: var(--surface); }
.demo-lista button { display: flex; justify-content: space-between; gap: .5rem; text-align: left; border: 0; background: transparent; padding: .45rem .55rem; border-radius: 6px; cursor: pointer; }
.demo-lista button:hover { background: var(--surface-2); }
.aviso-demo { background: var(--warn-soft); color: var(--fg); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); padding: .6rem .8rem; border-radius: 8px; font-size: .88rem; }

/* ---------- estrutura ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 1rem .75rem; gap: .8rem; overflow-y: auto; }
.side .login-marca { color: var(--fg); padding: .2rem .5rem .6rem; font-size: 1rem; }
.side .login-marca i { background: var(--accent); }
.side .login-marca i::after { border-color: var(--accent-fg); }
.menu { display: grid; gap: 2px; }
.menu-titulo { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: .8rem .6rem .3rem; }
.menu a { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: 8px; color: var(--fg); text-decoration: none; font-weight: 500; cursor: pointer; }
.menu a:hover { background: var(--surface-2); }
.menu a.ativo { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.menu svg { width: 18px; height: 18px; flex: none; }
.menu .cont { margin-left: auto; font-family: var(--f-mono); font-size: .75rem; padding: 0 .4rem; border-radius: 99px; background: var(--bad-soft); color: var(--bad); }
.side-rodape { margin-top: auto; border-top: 1px solid var(--line); padding-top: .8rem; display: grid; gap: .5rem; font-size: .85rem; }
.eu { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.eu > div { min-width: 0; }
.eu b, .eu small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .8rem; flex: none; font-family: var(--f-display); }
.avatar.sm { width: 26px; height: 26px; font-size: .68rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topo { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .6rem; padding: .6rem 1.25rem; }
.topo .menu-btn { display: none; }
.busca { position: relative; flex: 1; max-width: 460px; }
.busca input { padding-left: 2.1rem; background: var(--surface); }
.busca svg { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.busca-res { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 360px; overflow: auto; z-index: 30; padding: .3rem; }
.busca-res button { display: flex; gap: .5rem; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: .5rem; border-radius: 6px; cursor: pointer; }
.busca-res button:hover { background: var(--surface-2); }
.topo-acoes { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.sino { position: relative; }
.sino .bolinha { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .68rem; display: grid; place-items: center; font-family: var(--f-mono); }
.painel-alertas { position: absolute; right: 0; top: calc(100% + 6px); width: min(380px, 92vw); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 40; padding: .6rem; max-height: 70vh; overflow: auto; }
.faixa-demo { background: var(--warn-soft); border-bottom: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); padding: .4rem 1.25rem; font-size: .83rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.conteudo { padding: 1.25rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; align-content: start; min-width: 0; }
.cabecalho { display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.cabecalho p { margin: .15rem 0 0; color: var(--muted); }
.acoes { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; min-width: 0; }
.cabecalho > div:first-child { min-width: 0; }

/* ---------- blocos ---------- */
.bloco { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; min-width: 0; }
.bloco-titulo { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .8rem; flex-wrap: wrap; }
.caixa-filtros > summary { cursor: pointer; font-weight: 700; font-family: var(--f-display); list-style-position: inside; }
.caixa-filtros[open] > summary { margin-bottom: .8rem; }
.filtros { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: .7rem; align-items: end; }
.filtros .check { min-height: 38px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem .9rem; display: grid; gap: .15rem; min-width: 0; position: relative; }
.kpi span { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.kpi b { font-family: var(--f-display); font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi small { color: var(--muted); font-size: .8rem; }
.kpi.alerta { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.kpi.alerta b { color: var(--bad); }
.kpi.atencao b { color: var(--warn); }
.kpi.bom b { color: var(--ok); }
.kpi-destaque { grid-column: span 2; background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.kpi-destaque span, .kpi-destaque small { color: color-mix(in srgb, var(--accent-fg) 80%, transparent); }
.graficos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grafico { position: relative; height: 260px; }
.grafico.alto { height: 320px; }

/* ---------- chips ---------- */
.chip { --c: var(--muted); display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 72%, var(--fg)); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); }
.chip-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.chip-urgente { background: var(--bad); color: #fff; border-color: var(--bad); }
.chip-urgente::before { background: #fff; animation: pulsar 1.4s ease-in-out infinite; }
@keyframes pulsar { 50% { opacity: .25; } }
.prazo { font-family: var(--f-mono); font-size: .82rem; white-space: nowrap; }
.prazo.vencida { color: var(--bad); font-weight: 600; }
.prazo.proxima { color: var(--warn); font-weight: 600; }
.prazo.concluida { color: var(--ok); }
.alerta-campos { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 600; color: var(--warn); }
.icone-bloq { color: var(--block); font-weight: 700; }
.barra { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 60px; }
.barra i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- tabela / lista ---------- */
.tabela-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.tabela { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabela th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: .6rem .7rem; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tabela td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr { cursor: default; }
.tabela tbody tr.clicavel { cursor: pointer; }
.tabela tbody tr.clicavel:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.tabela .titulo-tarefa { font-weight: 600; }
.tabela td.num, .tabela th.num { text-align: right; }
tr.sit-vencida td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
tr.sit-vencida td { background: var(--bad-soft); }
tr.sit-proxima td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
tr.sit-proxima td { background: var(--warn-soft); }
tr.sit-concluida td:first-child, tr.sit-concluida_atraso td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
tr.sit-concluida td { background: var(--ok-soft); }
tr.sit-cancelada td { color: var(--muted); }
tr.sit-cancelada .titulo-tarefa { text-decoration: line-through; }
.vazio { text-align: center; padding: 2.2rem 1rem; color: var(--muted); }
.legenda { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legenda span { display: inline-flex; align-items: center; gap: .35rem; }
.legenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.coluna { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; display: grid; gap: .55rem; align-content: start; min-height: 200px; }
.coluna.soltar { outline: 2px dashed var(--accent); outline-offset: -4px; }
.coluna-topo { display: flex; justify-content: space-between; align-items: center; padding: .15rem .25rem; font-weight: 700; font-size: .85rem; }
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: .65rem .7rem; display: grid; gap: .45rem; cursor: grab; border-left: 4px solid var(--c, var(--line)); }
.cartao:hover { box-shadow: var(--shadow); }
.cartao.sit-vencida { background: var(--bad-soft); }
.cartao.sit-proxima { background: var(--warn-soft); }
.cartao h4 { font-family: var(--f-body); font-size: .92rem; font-weight: 600; }
.cartao-linha { display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; font-size: .8rem; }
.cartao select { min-height: 30px; padding: .15rem .4rem; font-size: .8rem; }

/* ---------- calendário ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: var(--surface-2); padding: .4rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; letter-spacing: .05em; }
.cal-dia { background: var(--surface); min-height: 108px; padding: .35rem; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal-dia.fora { background: var(--surface-2); color: var(--muted); }
.cal-dia.hoje .cal-n { background: var(--accent); color: var(--accent-fg); }
.cal-dia.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-n { font-family: var(--f-mono); font-size: .78rem; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-item { --c: var(--muted); font-size: .72rem; padding: 1px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--c) 16%, transparent); border-left: 3px solid var(--c); color: var(--fg); }
.cal-mais { font-size: .7rem; color: var(--muted); padding-left: 4px; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 16, 22, .5); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; z-index: 100; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: min(640px, 100%); box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: none; }
.modal.largo { width: min(920px, 100%); }
.modal.estreito { width: min(440px, 100%); }
.modal-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.2rem .8rem; border-bottom: 1px solid var(--line); }
.modal-corpo { padding: 1.1rem 1.2rem; display: grid; gap: 1rem; min-width: 0; }
.modal-rodape { padding: .8rem 1.2rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem 1rem; }
.info-grid div span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.info-grid div b { font-weight: 600; }
.caixa-aviso { border-radius: 9px; padding: .65rem .8rem; font-size: .9rem; display: flex; gap: .55rem; align-items: flex-start; }
.caixa-aviso.warn { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
.caixa-aviso.bad { background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.caixa-aviso.ok { background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.caixa-aviso.info { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.abas { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.abas button { border: 0; background: transparent; padding: .55rem .8rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.abas button.ativo { color: var(--accent); border-bottom-color: var(--accent); }
.lista-simples { display: grid; gap: .45rem; }
.item { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.item > div { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.linha-tempo { display: grid; gap: 0; }
.linha-tempo .ev { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: .6rem; padding-bottom: .8rem; position: relative; }
.linha-tempo .ev::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: .4rem; }
.linha-tempo .ev::after { content: ''; position: absolute; left: 4px; top: 1.1rem; bottom: 0; width: 1px; background: var(--line); }
.linha-tempo .ev:last-child::after { display: none; }
.de-para { font-size: .85rem; overflow-wrap: anywhere; }
.de-para s { color: var(--muted); }

/* ---------- avisos ---------- */
#toast-root { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); display: grid; gap: .5rem; z-index: 200; max-width: min(420px, calc(100vw - 2rem)); }
.toast { background: var(--fg); color: var(--bg); padding: .7rem .95rem; border-radius: 10px; box-shadow: var(--shadow); font-size: .9rem; animation: entrar .2s ease-out; }
.toast.erro { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes entrar { from { transform: translateY(8px); opacity: 0; } }
.config-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1rem; align-items: start; }
.config-menu { display: grid; gap: 2px; position: sticky; top: 70px; }
.config-menu button { text-align: left; border: 0; background: transparent; padding: .5rem .7rem; border-radius: 8px; font-weight: 500; cursor: pointer; }
.config-menu button.ativo { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.matriz td, .matriz th { text-align: center; }
.matriz td:first-child, .matriz th:first-child { text-align: left; }
.sim { color: var(--ok); font-weight: 700; }
.nao { color: var(--muted); }
.setores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; }
.setor-card { border-top: 4px solid var(--c); display: grid; gap: .7rem; }
.mini-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; text-align: center; }
.mini-kpis b { display: block; font-family: var(--f-display); font-size: 1.2rem; }
.mini-kpis span { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.var-lista { display: flex; flex-wrap: wrap; gap: .35rem; }
.var-lista code { font-family: var(--f-mono); font-size: .78rem; background: var(--surface-2); border: 1px solid var(--line); padding: .05rem .4rem; border-radius: 5px; cursor: pointer; }
.previa { background: var(--surface-2); border-radius: 10px; padding: .75rem .9rem; font-size: .9rem; white-space: pre-wrap; border: 1px solid var(--line); }
.whats-bolha { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-radius: 10px 10px 10px 2px; padding: .6rem .8rem; max-width: 520px; font-size: .9rem; }
.escondido-desktop { display: none; }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) { .graficos { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); z-index: 90; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow); padding-top: calc(1rem + env(safe-area-inset-top, 0px)); }
  .app.menu-aberto .side { transform: none; }
  .app.menu-aberto::after { content: ''; position: fixed; inset: 0; background: rgba(10, 16, 22, .45); z-index: 80; }
  .topo .menu-btn { display: inline-flex; }
  .config-grid { grid-template-columns: minmax(0, 1fr); }
  .config-menu { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-arte { padding: 1.5rem 1rem; }
  .login-arte .login-fitas { display: none; }
}
@media (max-width: 760px) {
  .conteudo { padding: 1rem; }
  .topo { padding: .55rem 1rem; }
  .grid-form { grid-template-columns: minmax(0, 1fr); }
  .kpi-destaque { grid-column: auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .escondido-mobile { display: none; }
  .escondido-desktop { display: inline-flex; }
  /* tabela de tarefas vira lista de cartões */
  table.tabela.cartoes thead { display: none; }
  table.tabela.cartoes, table.tabela.cartoes tbody, table.tabela.cartoes tr, table.tabela.cartoes td { display: block; width: 100%; }
  table.tabela.cartoes tr { border-bottom: 1px solid var(--line); padding: .55rem .2rem; }
  table.tabela.cartoes td { border: 0; padding: .15rem .6rem; background: transparent !important; box-shadow: none !important; }
  table.tabela.cartoes tr.sit-vencida { background: var(--bad-soft); box-shadow: inset 4px 0 0 var(--bad); }
  table.tabela.cartoes tr.sit-proxima { background: var(--warn-soft); box-shadow: inset 4px 0 0 var(--warn); }
  table.tabela.cartoes tr.sit-concluida { background: var(--ok-soft); box-shadow: inset 4px 0 0 var(--ok); }
  table.tabela.cartoes td[data-rot]::before { content: attr(data-rot) ': '; color: var(--muted); font-size: .78rem; }
  .cal-dia { min-height: 58px; }
  .cal-item { font-size: 0; padding: 0; height: 6px; border-left-width: 0; background: var(--c); }
  .cal-mais { font-size: .62rem; }
  .overlay { padding: 0; }
  .modal, .modal.largo, .modal.estreito { border-radius: 0; min-height: 100%; }
  .busca { max-width: none; }
  .topo-acoes .btn-texto { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
