/* assets/base.css
   Controle Mestre · identidade B2N Engenharia (b2nengenharia.com.br):
   verde #73C62C, grafite #414141, texto #1D1D1D, Roboto e Roboto Slab.
   Linguagem visual herdada do hub do LeanRun: fundo com mesh animado, superfícies de
   vidro, cards com figura animada no hover. Tema escuro é o padrão; claro por
   data-tema="light" (botão Tema) ou pela preferência do sistema. */

:root {
  --brand: #73C62C;
  --brand-2: #9BDB5E;
  --brand-ink: #8BD84A;          /* verde para texto sobre fundo escuro */
  --grafite: #414141;
  --bg: #0F1210;
  --bg-2: #151A16;
  --surface: rgba(255,255,255,0.05);
  --surface-2: rgba(255,255,255,0.085);
  --surface-solid: #181D19;
  --border: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);
  --text: #F3F5F1;
  --muted: #A7B0A6;
  --desc: #C4CBC2;
  --shadow: 0 18px 40px -22px rgba(0,0,0,0.85);
  --radius: 16px;
  --ok: #4ADE80; --ok-bg: rgba(74,222,128,.14);
  --info: #60A5FA; --info-bg: rgba(96,165,250,.14);
  --warn: #FBBF24; --warn-bg: rgba(251,191,36,.15);
  --danger: #F87171; --danger-bg: rgba(248,113,113,.15);
  --neutral-bg: rgba(255,255,255,.08);
  --mono: ui-monospace, 'SF Mono', Menlo, monospace;
  --blob1: #2F7D12; --blob2: #73C62C; --blob3: #1F6F6A;
  color-scheme: dark;
  /* tokens que o painel do copiloto (copiloto-chat.js) usa */
  --mpd-fg: var(--text); --mpd-fg-dim: var(--desc); --mpd-fg-faint: var(--muted);
  --mpd-border: var(--border); --mpd-border-strong: var(--border-strong);
  --mpd-bg-elev: var(--surface-solid); --mpd-bg-elev-2: var(--bg-2);
  --mpd-accent: var(--brand); --mpd-accent-fg: #0F1210; --mpd-accent-soft: rgba(115,198,44,.14);
  --mpd-danger: var(--danger); --mpd-topo: #1E241F; --mpd-mono: var(--mono);
  --d1: #73C62C; --d2: #22A5C9; --d3: #8B5CF6; --d4: #F59E0B; --d5: #14B8A6; --d6: #6366F1; --d7: #EC4899; --d8: #84CC16; --d9: #0EA5E9; --d10: #A855F7;
}
@media (prefers-color-scheme: light) {
  :root:not([data-tema="dark"]) { --tema-auto: light; }
}
:root[data-tema="light"] {
  --brand: #5FAE1E;
  --brand-2: #73C62C;
  --brand-ink: #3F7F12;
  --bg: #E9EEE6;
  --bg-2: #F4F7F2;
  --surface: rgba(255,255,255,0.66);
  --surface-2: rgba(255,255,255,0.96);
  --surface-solid: #FFFFFF;
  --border: #D7DFD3;
  --border-strong: #BCC8B6;
  --text: #1D1D1D;
  --muted: #5E665B;
  --desc: #474E45;
  --shadow: 0 18px 40px -24px rgba(30,50,20,0.28);
  --ok: #15803D; --ok-bg: #DCFCE7;
  --info: #1D4ED8; --info-bg: #DBEAFE;
  --warn: #A16207; --warn-bg: #FEF3C7;
  --danger: #B91C1C; --danger-bg: #FEE2E2;
  --neutral-bg: #EEF1EC;
  --blob1: #A7E07A; --blob2: #73C62C; --blob3: #7CC7B9;
  color-scheme: light;
  --mpd-accent-fg: #fff; --mpd-accent-soft: rgba(115,198,44,.16); --mpd-topo: #414141;
}

/* Lima: claro, branco com cinza #6E6E6E e destaque amarelo-esverdeado #BAFF39. O texto de
   destaque (links, ativo) usa um verde-oliva escuro, porque lima sobre branco não tem contraste. */
:root[data-tema="lima"] {
  --brand: #BAFF39;
  --brand-2: #D4FF7A;
  --brand-ink: #4F6F00;
  --bg: #FFFFFF;
  --bg-2: #F5F6F2;
  --surface: #F4F5F1;
  --surface-2: #E9EBE4;
  --surface-solid: #FFFFFF;
  --border: #E1E3DC;
  --border-strong: #C6C9BF;
  --text: #1D1D1D;
  --muted: #6E6E6E;
  --desc: #414141;
  --shadow: 0 18px 40px -26px rgba(40,50,20,0.30);
  --ok: #15803D; --ok-bg: #DCFCE7;
  --info: #1D4ED8; --info-bg: #DBEAFE;
  --warn: #A16207; --warn-bg: #FEF3C7;
  --danger: #B91C1C; --danger-bg: #FEE2E2;
  --neutral-bg: #EEF0EA;
  --blob1: #BAFF39; --blob2: #E3FFA6; --blob3: #D4D4D4;
  color-scheme: light;
  --mpd-accent-fg: #1D1D1D; --mpd-accent-soft: rgba(186,255,57,.28); --mpd-topo: #414141;
}
/* Grafite: escuro, fundo #414141 e tons próximos, cinza #6E6E6E nas bordas e superfícies,
   destaque #BAFF39 e verde da marca #73C62C como apoio. */
:root[data-tema="grafite"] {
  --brand: #BAFF39;
  --brand-2: #73C62C;
  --brand-ink: #BAFF39;
  --bg: #2F2F2F;
  --bg-2: #383838;
  --surface: rgba(255,255,255,0.06);
  --surface-2: rgba(255,255,255,0.11);
  --surface-solid: #414141;
  --border: rgba(255,255,255,0.16);
  --border-strong: #6E6E6E;
  --text: #FFFFFF;
  --muted: #C2C2C2;
  --desc: #DADADA;
  --shadow: 0 18px 40px -22px rgba(0,0,0,0.65);
  --ok: #4ADE80; --ok-bg: rgba(74,222,128,.16);
  --info: #7DB5FF; --info-bg: rgba(125,181,255,.16);
  --warn: #FBBF24; --warn-bg: rgba(251,191,36,.16);
  --danger: #FF8A8A; --danger-bg: rgba(255,138,138,.16);
  --neutral-bg: rgba(255,255,255,.09);
  --blob1: #6E6E6E; --blob2: #BAFF39; --blob3: #73C62C;
  color-scheme: dark;
  --mpd-accent-fg: #1D1D1D; --mpd-accent-soft: rgba(186,255,57,.18); --mpd-topo: #2B2B2B;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; font-size: 14px;
  transition: background .4s ease, color .4s ease;
}
a { color: var(--brand-ink); }
button, input, select, textarea { font-family: inherit; }
.slab { font-family: 'Roboto Slab', Georgia, serif; }

/* ===== Mesh ===== */
.mesh { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .42; }
[data-tema="light"] .blob, [data-tema="lima"] .blob { opacity: .34; filter: blur(80px); }
[data-tema="grafite"] .blob { opacity: .22; }
.blob.b1 { width: 44vw; height: 44vw; left: -8vw; top: -12vw; background: radial-gradient(circle, var(--blob1), transparent 65%); animation: float1 22s ease-in-out infinite; }
.blob.b2 { width: 38vw; height: 38vw; right: -6vw; top: 2vw; background: radial-gradient(circle, var(--blob2), transparent 60%); animation: float2 26s ease-in-out infinite; }
.blob.b3 { width: 36vw; height: 36vw; left: 24vw; bottom: -16vw; background: radial-gradient(circle, var(--blob3), transparent 62%); animation: float3 30s ease-in-out infinite; }
.mesh.calmo .blob { opacity: .2; }
@keyframes float1 { 0%,100%{ transform: translate(0,0) scale(1);} 50%{ transform: translate(6vw,4vw) scale(1.12);} }
@keyframes float2 { 0%,100%{ transform: translate(0,0) scale(1);} 50%{ transform: translate(-5vw,5vw) scale(1.1);} }
@keyframes float3 { 0%,100%{ transform: translate(0,0) scale(1);} 50%{ transform: translate(3vw,-4vw) scale(1.15);} }

.wrap { position: relative; z-index: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 16px clamp(16px,4vw,48px) 56px; }

/* ===== Header ===== */
.topo { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 14px; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: -.01em; font-size: 15px; text-decoration: none; color: var(--text); }
.brand-logo { height: 34px; padding: 5px 10px; border-radius: 10px; background: #1B1F1C; display: flex; align-items: center; border: 1px solid var(--border); }
.brand-logo img { height: 24px; display: block; }
[data-tema="light"] .brand-logo, [data-tema="lima"] .brand-logo, [data-tema="grafite"] .brand-logo { background: var(--grafite); border-color: var(--grafite); }
.brand .sep { width: 1px; height: 22px; background: var(--border-strong); }
.brand small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.h-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); padding: 5px 11px 5px 5px; border-radius: 999px; font-size: 13px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #2F7D12, var(--brand)); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.pill { font-size: 11px; color: var(--muted); }

/* ===== Botões e campos ===== */
.btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer; padding: 7px 13px; border-radius: 9px; font-size: 13px; font-weight: 600; transition: .2s; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.prim { background: var(--brand); border-color: var(--brand); color: #10140F; }
[data-tema="light"] .btn.prim { color: #fff; }
[data-tema="lima"] .btn.prim, [data-tema="grafite"] .btn.prim { color: #1D1D1D; }
.btn.prim:hover { filter: brightness(1.08); }
.btn.perigo { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.btn.ativo { color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); }
.btn-ico { width: 32px; height: 32px; padding: 0; justify-content: center; }
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo > span { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.campo > small { font-size: 11px; color: var(--muted); }
.inp, select.inp, textarea.inp { background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text); padding: 8px 11px; border-radius: 9px; font-size: 13.5px; width: 100%; min-width: 0; }
textarea.inp { resize: vertical; min-height: 70px; line-height: 1.45; }
.inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.inp[readonly] { opacity: .75; }
.inp.num { text-align: right; font-variant-numeric: tabular-nums; }
.busca { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 7px 13px 7px 32px; border-radius: 9px; font-size: 13px; min-width: 200px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A7B0A6' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 9px center; background-size: 15px; }
.busca:focus { outline: none; border-color: var(--border-strong); }
select.mini { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 9px; font-size: 12.5px; }

/* ===== Hero / stats (hub) ===== */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-top: 6px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; margin: 0; }
h1 { font-family: 'Roboto Slab', Georgia, serif; font-size: clamp(26px, 4vw, 38px); font-weight: 700; letter-spacing: -.02em; margin: 5px 0 4px; line-height: 1.08; }
h1 .nome { background: linear-gradient(100deg, var(--brand-2), #2FB59A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--desc); font-size: 14px; max-width: 560px; margin: 0; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 16px; backdrop-filter: blur(10px); text-align: center; min-width: 96px; }
.stat .l { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: 20px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v.alerta { color: var(--danger); }
.stat .v.sm { font-size: 13px; font-family: var(--mono); margin-top: 5px; }

.sec-head { display: flex; align-items: center; gap: 12px; margin: 26px 0 14px; flex-wrap: wrap; }
.sec-head h2 { font-size: 17px; font-weight: 700; margin: 0; }
.sec-head .count { font-size: 13px; color: var(--muted); }
.sec-head .dir { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ===== Grid de cards (hub) ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 14px; }
.card {
  position: relative; text-align: left; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); border-radius: var(--radius); padding: 18px; backdrop-filter: blur(12px);
  box-shadow: var(--shadow); transition: transform .28s cubic-bezier(.2,.7,.2,1), border-color .28s, background .28s, opacity .4s;
  opacity: 0; transform: translateY(16px); color: var(--text); width: 100%; font-family: inherit; font-size: inherit;
}
.card.in { opacity: 1; transform: translateY(0); }
.card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--ca) 60%, var(--border)); background: var(--surface-2); }
.card.hide { display: none; }
.card .fig { width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 14px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--ca) 26%, transparent), color-mix(in srgb, var(--ca) 6%, transparent));
  border: 1px solid color-mix(in srgb, var(--ca) 30%, transparent); color: var(--ca); }
.card .fig svg { width: 28px; height: 28px; }
.card h3 { font-size: 15px; font-weight: 700; margin: 0 0 5px; }
.card p { font-size: 12.5px; color: var(--desc); line-height: 1.45; margin: 0 0 16px; min-height: 36px; }
.card .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.card .foot .id { font-size: 11px; font-family: var(--mono); color: var(--muted); letter-spacing: .02em; }
.card .foot .go { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ca); }
.card .foot .go svg { width: 15px; height: 15px; transition: transform .25s; }
.card:hover .foot .go svg { transform: translateX(3px); }
.card .badge-c { position: absolute; top: 14px; right: 14px; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.card .badge-c.alerta { color: var(--danger); background: var(--danger-bg); border-color: transparent; }
.card .badge-c.aviso { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.card.projeto .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.card.projeto .meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.card.projeto.sel { border-color: color-mix(in srgb, var(--brand) 70%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 40%, transparent), var(--shadow); }
.card.novo { border-style: dashed; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 168px; }
.vazio { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 16px; }
.carregando { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 14px; padding: 40px 0; }

/* ===== Animações das figuras (hover) ===== */
svg .part { transform-box: fill-box; }
svg .draw { stroke-dasharray: 64; }
.card:hover .bar { animation: barUp .6s cubic-bezier(.2,.8,.2,1) both; transform-origin: bottom; }
.card:hover .bar.d2 { animation-delay: .1s; } .card:hover .bar.d3 { animation-delay: .2s; }
@keyframes barUp { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.card:hover .needle { animation: sweep 1s cubic-bezier(.4,0,.2,1) both; transform-origin: center; }
@keyframes sweep { 0%{ transform: rotate(-58deg);} 70%{ transform: rotate(38deg);} 100%{ transform: rotate(18deg);} }
.card:hover .led { animation: blink 1.2s steps(1) infinite; }
.card:hover .led.l2 { animation-delay: .4s; } .card:hover .led.l3 { animation-delay: .8s; }
@keyframes blink { 0%,33%{ opacity: 1;} 34%,100%{ opacity: .25;} }
.card:hover .spark { animation: spin 3s linear infinite; transform-origin: center; }
.card:hover .spin { animation: spin 2.4s linear infinite; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.card:hover .draw { animation: draw .75s ease both; }
@keyframes draw { from { stroke-dashoffset: 64; } to { stroke-dashoffset: 0; } }
.card:hover .pulse { animation: pulse 1.5s ease-in-out infinite; transform-origin: center; }
@keyframes pulse { 0%,100%{ transform: scale(.82); opacity: .6;} 50%{ transform: scale(1.08); opacity: 1;} }
.card:hover .roll { animation: roll 1s ease-in-out infinite; transform-origin: center; }
@keyframes roll { 0%,100%{ transform: translateX(-2px);} 50%{ transform: translateX(2px);} }
.card:hover .arrow { animation: adv 1.2s ease-in-out infinite; transform-origin: center; }
.card:hover .arrow.a2 { animation-delay: .18s; } .card:hover .arrow.a3 { animation-delay: .36s; }
@keyframes adv { 0%,100%{ transform: translateX(-1.5px); opacity: .55;} 50%{ transform: translateX(2px); opacity: 1;} }
.card:hover .coin { animation: coindrop 1.5s ease-in-out infinite; transform-origin: center; }
@keyframes coindrop { 0%{ transform: translateY(-3px); opacity: 0;} 25%{ opacity: 1;} 65%{ transform: translateY(5px); opacity: 1;} 100%{ transform: translateY(5px); opacity: 0;} }
.card:hover .arrowdn { animation: arrowdn 1.1s ease-in-out infinite; transform-origin: center; }
@keyframes arrowdn { 0%,100%{ transform: translateY(-1.5px);} 50%{ transform: translateY(3px);} }
.card:hover .arrowup { animation: arrowup 1.1s ease-in-out infinite; transform-origin: center; }
@keyframes arrowup { 0%,100%{ transform: translateY(1.5px);} 50%{ transform: translateY(-3px);} }
.card:hover .wave { animation: wave 1.2s ease-in-out infinite; transform-origin: left center; }
@keyframes wave { 0%,100%{ transform: skewX(0) scaleX(1);} 50%{ transform: skewX(-10deg) scaleX(.92);} }
.card:hover .glow { animation: flash 1.3s ease-in-out infinite; }
@keyframes flash { 0%,100%{ opacity: .5;} 50%{ opacity: 1;} }

/* ===== App do projeto ===== */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.lateral { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 12px; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(14px); display: flex; flex-direction: column; gap: 4px; }
.lateral .brand { padding: 2px 4px 12px; }
.lateral .proj { padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 8px; }
.lateral .proj b { display: block; font-size: 14px; }
.lateral .proj span { font-size: 11.5px; color: var(--muted); }
.lateral .grp { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 12px 8px 4px; }
.lateral a.it { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 9px; color: var(--desc); text-decoration: none; font-size: 13px; font-weight: 500; }
.lateral a.it svg { width: 17px; height: 17px; flex: none; color: var(--ca, var(--muted)); }
.lateral a.it:hover { background: var(--surface); color: var(--text); }
.lateral a.it.ativo { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--text); font-weight: 700; }
.lateral a.it .n { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--danger-bg); color: var(--danger); }
.lateral .rodape-l { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.principal { min-width: 0; padding: 16px clamp(14px, 3vw, 34px) 12px; }
.principal > :last-child { margin-bottom: 0; }
.barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.barra h2 { font-family: 'Roboto Slab', Georgia, serif; font-size: 22px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.barra .desc { color: var(--muted); font-size: 12.5px; width: 100%; margin-top: -6px; }
.barra .dir { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.menu-movel { display: none; }

.painel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(12px); box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; }
.painel > .ph { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.painel > .ph h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.painel > .ph .k { font-size: 11.5px; color: var(--muted); }
.painel > .ph .dir { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.painel > .pb { padding: 14px 16px; }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.duas > .painel { margin-bottom: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 13px 15px; backdrop-filter: blur(10px); position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ca, var(--brand)); opacity: .9; }
.kpi .l { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 22px; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .s { font-size: 11.5px; color: var(--muted); }
.kpi.clic { cursor: pointer; }
.kpi.clic:hover { background: var(--surface-2); }
.nota { background: color-mix(in srgb, var(--brand) 9%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border)); border-radius: 11px; padding: 10px 13px; font-size: 12.5px; line-height: 1.5; color: var(--desc); }
.nota.aviso { background: var(--warn-bg); border-color: transparent; color: var(--text); }
.nota.erro { background: var(--danger-bg); border-color: transparent; color: var(--text); }

/* ===== Tabela (grade) ===== */
.tw { overflow: auto; max-height: calc(100vh - 176px); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.t th { position: sticky; top: 0; z-index: 2; background: var(--surface-solid); text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; cursor: pointer; user-select: none; }
table.t th.num, table.t td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t th .ord { opacity: .7; margin-left: 3px; }
table.t td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; max-width: 360px; }
table.t td.wrap { white-space: normal; min-width: 220px; }
table.t td.cod { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
table.t tbody tr { cursor: pointer; }
table.t tbody tr:hover td { background: var(--surface); }
table.t tbody tr.vencido td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
table.t tbody tr.critico td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.t tbody tr.atencao td:first-child { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--warn) 50%, transparent); }
table.t tfoot td { position: sticky; bottom: 0; z-index: 3; background: var(--surface-solid); font-weight: 800; border-top: 2px solid color-mix(in srgb, var(--brand) 60%, var(--border)); padding: 9px 10px; }
table.t tr.nivel-Etapa td { font-weight: 800; background: color-mix(in srgb, var(--brand) 7%, transparent); }
table.t tr.nivel-Grupo td { font-weight: 700; }
table.t tr.nivel-Grupo td.desc { padding-left: 18px; }
table.t tr.nivel-Item td.desc { padding-left: 30px; }
table.t .neg { color: var(--danger); }
table.t .pos { color: var(--ok); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--neutral-bg); color: var(--desc); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.brand { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand-ink); }
.dias { font-size: 11px; font-weight: 700; }
.filtros { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filtros .f { background: var(--surface); border: 1px solid var(--border); color: var(--desc); border-radius: 999px; padding: 4px 10px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.filtros .f.on { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--text); border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.vazio-t { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ===== Agenda / timeline / barras ===== */
.ag { display: flex; flex-direction: column; }
.ag .l { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: start; padding: 9px 2px; border-bottom: 1px solid var(--border); cursor: pointer; }
.ag .l:last-child { border-bottom: 0; }
.ag .l:hover { background: var(--surface); }
.ag .dt { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px; }
.ag .dt small { display: block; font-weight: 600; font-size: 10.5px; }
.ag .tt { font-size: 13px; line-height: 1.35; }
.ag .tt small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.tl { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.tl .m { flex: 0 0 210px; border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; background: var(--bg-2); position: relative; cursor: pointer; }
.tl .m::after { content: ''; position: absolute; right: -13px; top: 22px; width: 12px; height: 2px; background: var(--border-strong); }
.tl .m:last-child::after { display: none; }
.tl .m .d { font-size: 11.5px; font-weight: 800; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.tl .m .n { font-weight: 700; font-size: 12.5px; margin: 4px 0; line-height: 1.3; }
.tl .m .x { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.prog { height: 8px; border-radius: 99px; background: var(--neutral-bg); overflow: hidden; }
.prog > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #2FB59A); border-radius: 99px; }
.prog.over > i { background: var(--danger); }
.contrato { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.contrato:last-child { border-bottom: 0; }
.contrato .nm { font-weight: 700; font-size: 13px; }
.contrato .nm small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.contrato .vl { text-align: right; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.contrato .prog { grid-column: 1 / -1; }
.graf { position: relative; height: 300px; }
.graf.baixo { height: 220px; }

/* ===== Gaveta (formulário) e modal ===== */
.veu { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .2s; }
.veu.on { opacity: 1; pointer-events: auto; }
.gaveta { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--surface-solid); border-left: 1px solid var(--border-strong); z-index: 81; transform: translateX(102%); transition: transform .26s ease; display: flex; flex-direction: column; box-shadow: -20px 0 50px -20px rgba(0,0,0,.5); }
.gaveta.on { transform: none; }
.gaveta .gh { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 10px; }
.gaveta .gh h3 { margin: 0; font-size: 16px; }
.gaveta .gh .k { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.gaveta .gh .x { margin-left: auto; }
.gaveta .gb { flex: 1; overflow-y: auto; padding: 16px 18px; }
.gaveta .gf { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; }
.gaveta .gf .dir { margin-left: auto; display: flex; gap: 8px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.calc { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; }
.calc div { font-size: 11px; color: var(--muted); }
.calc b { display: block; font-size: 13.5px; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 2px; }
.comp-ed { display: flex; flex-direction: column; gap: 6px; }
.comp-ed .ln { display: grid; grid-template-columns: 1fr 140px 30px; gap: 6px; }
.hist { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.hist h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hist .h { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 12px; background: var(--bg-2); }
.hist .h .q { color: var(--muted); font-size: 11px; }
.hist .h .dif { margin-top: 4px; display: grid; grid-template-columns: 120px 1fr; gap: 2px 8px; }
.hist .h .dif s { color: var(--danger); opacity: .8; }
.hist .h .dif ins { text-decoration: none; color: var(--ok); }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -48%) scale(.98); width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 16px; z-index: 91; opacity: 0; pointer-events: none; transition: .2s; display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
.modal.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal.largo { width: min(1080px, calc(100vw - 32px)); }
.modal .mh { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal .mh h3 { margin: 0; font-size: 16px; }
.modal .mb { padding: 16px 18px; overflow-y: auto; }
.modal .mf { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.veu.modal-veu { z-index: 90; }
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--surface-solid); border: 1px solid var(--border-strong); color: var(--text); padding: 10px 14px; border-radius: 12px; font-size: 13px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; animation: entra .25s ease; max-width: min(560px, 92vw); }
.toast.erro { border-color: var(--danger); }
.toast.ok { border-color: var(--brand); }
@keyframes entra { from { opacity: 0; transform: translateY(10px); } }

/* revisão de propostas do assistente */
.prop { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--bg-2); }
.prop .ph2 { display: flex; gap: 10px; align-items: center; }
.prop .ph2 b { font-size: 13px; }
.prop table { width: 100%; font-size: 12px; border-collapse: collapse; margin-top: 8px; }
.prop td { padding: 4px 6px; border-top: 1px solid var(--border); vertical-align: top; }
.prop td:first-child { color: var(--muted); width: 160px; }
.prop s { color: var(--danger); }
.prop ins { text-decoration: none; color: var(--ok); font-weight: 600; }
.prop .erro-op { color: var(--danger); font-size: 12px; margin-top: 6px; }

/* ===== Login ===== */
.login { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .caixa { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 28px; backdrop-filter: blur(16px); box-shadow: var(--shadow); }
.login .caixa .logo-g { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login .caixa .logo-g .brand-logo { height: 46px; padding: 8px 14px; }
.login .caixa .logo-g .brand-logo img { height: 30px; }
.login h1 { font-size: 26px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.login .alt { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; margin-top: 4px; flex-wrap: wrap; }
.login .alt a { cursor: pointer; }
.login .msg { font-size: 12.5px; min-height: 18px; }
.login .msg.erro { color: var(--danger); }
.login .msg.ok { color: var(--brand-ink); }

.rodape { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); }

/* ===== Responsivo ===== */
@media (max-width: 1100px) { .duas { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; z-index: 70; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-102%); transition: transform .25s; background: var(--surface-solid); }
  .lateral.on { transform: none; }
  .menu-movel { display: inline-flex; }
  .form { grid-template-columns: 1fr; }
  .tw { max-height: none; }
}
@media (max-width: 640px) {
  .stats { width: 100%; } .stat { flex: 1; }
  .busca { min-width: 0; width: 100%; }
  .ag .l { grid-template-columns: 74px 1fr; } .ag .l > :last-child { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { *, .blob { animation: none !important; transition: none !important; } .card { opacity: 1; transform: none; } }
@media print {
  .mesh, .lateral, .barra .dir, .cop-fab, .cop-painel, .menu-movel { display: none !important; }
  .app { display: block; } body { background: #fff; color: #000; }
  .painel, .kpi { box-shadow: none; backdrop-filter: none; border-color: #ccc; background: #fff; }
  .tw { max-height: none; overflow: visible; }
}

/* Linha do tempo (Gantt simplificado) */
.gt-leg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 12px; color: var(--muted); margin-left: auto; }
.gt-leg .lg { display: inline-block; width: 18px; height: 8px; border-radius: 3px; margin-right: -6px; }
.gt-leg .lg.marco { width: 9px; height: 9px; transform: rotate(45deg); border-radius: 1px; background: var(--text); }
.gt-w { overflow: auto; max-height: calc(100vh - 200px); border-top: 1px solid var(--border); }
.gt { position: relative; min-width: 100%; }
.gt-row { display: flex; height: 30px; border-bottom: 1px solid var(--border); }
.gt-row[data-id] { cursor: pointer; }
.gt-row[data-id]:hover .gt-l, .gt-row[data-id]:hover { background: var(--surface); }
.gt-l { flex: 0 0 280px; position: sticky; left: 0; z-index: 3; background: var(--surface-solid); padding: 0 10px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--border-strong); }
.gt-l .cod { color: var(--muted); font-size: 11px; }
.gt-t { position: relative; flex: none; }
.gt-h { position: sticky; top: 0; z-index: 4; background: var(--surface-solid); }
.gt-h .gt-l { z-index: 5; font-weight: 700; }
.gt-h .gt-t span { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding-left: 6px; font-size: 11.5px; color: var(--muted); overflow: hidden; }
.gt-gr { background: var(--surface); cursor: pointer; }
.gt-gr .gt-l { background: var(--bg-2); }
.gt-ov { position: absolute; top: 30px; bottom: 0; pointer-events: none; z-index: 1; }
.gt-ov i { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.gt-ov i.s { border-left-style: dotted; opacity: .6; }
.gt-ov i.hoje { border-left: 2px solid var(--danger); z-index: 2; }
.gt-b, .gt-leg .lg { background: var(--muted); }
.gt-b { position: absolute; top: 6px; height: 14px; border-radius: 4px; opacity: .55; }
.gt-r2 { position: absolute; top: 21px; height: 4px; border-radius: 2px; background: var(--text); opacity: .75; }
.gt-m { position: absolute; top: 7px; width: 14px; height: 14px; transform: rotate(45deg); border-radius: 2px; background: var(--muted); }
.gt-m.gate { border: 2px solid var(--text); }
.gt-b.crit, .gt-m.crit { outline: 2px solid var(--text); outline-offset: 1px; }
.gt .previsto, .gt-leg .previsto { background: var(--muted); }
.gt .andamento, .gt-leg .andamento { background: var(--brand); }
.gt .ok, .gt-leg .ok { background: var(--ok); }
.gt .warn, .gt-leg .warn { background: var(--warn); }
.gt .danger, .gt-leg .danger { background: var(--danger); }
.gt .cancelado { background: var(--muted); opacity: .25; }
.gt-b.andamento, .gt-b.ok, .gt-b.warn, .gt-b.danger { opacity: .9; }
.gt-nota { padding: 10px 14px; font-size: 12.5px; color: var(--muted); }

/* Colunas ajustáveis e botão de ordenar (tabela.js) */
table.t th .col-r { position: absolute; top: 0; right: 0; width: 7px; height: 100%; cursor: col-resize; z-index: 3; touch-action: none; }
table.t th .col-r:hover, table.t th .col-r.on { background: color-mix(in srgb, var(--brand) 55%, transparent); }
table.t th .ord-b { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; margin-left: 4px; font-size: 10px; line-height: 1; opacity: .55; }
table.t th:hover .ord-b, table.t th .ord-b.on { opacity: 1; color: var(--brand-ink); }
table.t.fixa th { overflow: hidden; text-overflow: ellipsis; }
table.t.fixa td { overflow: hidden; text-overflow: ellipsis; max-width: none; }
table.t.fixa td.wrap { white-space: normal; }

/* Botão do assistente só com o ícone: não reserva espaço no rodapé */
body .cop-fab { font-size: 0; gap: 0; padding: 0; width: 40px; height: 40px; justify-content: center; right: 14px; bottom: 14px; opacity: .92; }
body .cop-fab span { font-size: 17px; }

/* O atributo hidden precisa vencer display:flex/grid de .campo e similares (ex.: Nome no login) */
[hidden] { display: none !important; }
