@font-face { font-family: 'Lavishly Yours'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/lavishly-yours-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: local('Poppins'), url('fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: local('Poppins'), url('fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: local('Poppins'), url('fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: local('Poppins'), url('fonts/poppins-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #ffffff; --surface: #ffffff; --head: #f3f5f7; --ro: #f8f9fb; --grp: #e8eef3; --grp-soft: #f1f5f8;
  --text: #1b2733; --text-2: #4a5a69; --muted: #6b7a89;
  --line: #d3dae1; --line-soft: #e6eaee;
  --accent: #0b4f9e; --accent-2: #073565; --accent-soft: #e6eef9; --on-accent: #ffffff;
  --laranja: #f28c1b; --laranja-soft: #fff1e0; --laranja-esc: #b45f00;
  --sel: #e6eef9; --sel-soft: #f1f6fc;
  --bad: #c0392b; --good: #1f8a4c; --warn: #b7791f;
  --shadow: 0 8px 28px rgba(15, 30, 45, .18);
  --gt-we: rgba(120, 140, 160, .10); --gt-line: rgba(120, 140, 160, .13);
  --c0: #0b4f9e; --c1: #f28c1b; --c2: #3b9a6d; --c3: #8a63c8; --c4: #c8514f; --c5: #b59a1e; --c6: #2b9aa0; --c7: #7a8a99;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131a21; --surface: #1a232c; --head: #1d2731; --ro: #161e26; --grp: #223140; --grp-soft: #19242e;
    --text: #e6edf3; --text-2: #b5c2cf; --muted: #8b9aa9;
    --line: #2f3d4a; --line-soft: #243039;
    --accent: #5aa2f0; --accent-2: #8bbcf5; --accent-soft: #14304f; --on-accent: #06182b;
    --laranja: #f5a14a; --laranja-soft: #3a2a14; --laranja-esc: #f5a14a;
    --sel: #12304d; --sel-soft: #0f2740;
    --bad: #ff7b6b; --good: #55c98a; --warn: #e3b04b;
    --shadow: 0 8px 28px rgba(0, 0, 0, .5);
    --gt-we: rgba(150, 170, 190, .07); --gt-line: rgba(150, 170, 190, .09);
    --c0: #5aa2f0; --c1: #f5a14a; --c2: #55b98a; --c3: #a583e0; --c4: #e0706d; --c5: #cfb43a; --c6: #4bb7bd; --c7: #96a6b5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131a21; --surface: #1a232c; --head: #1d2731; --ro: #161e26; --grp: #223140; --grp-soft: #19242e;
  --text: #e6edf3; --text-2: #b5c2cf; --muted: #8b9aa9; --line: #2f3d4a; --line-soft: #243039;
  --accent: #5aa2f0; --accent-2: #8bbcf5; --accent-soft: #14304f; --on-accent: #06182b; --laranja: #f5a14a; --laranja-soft: #3a2a14; --laranja-esc: #f5a14a; --sel: #12304d; --sel-soft: #0f2740;
  --bad: #ff7b6b; --good: #55c98a; --warn: #e3b04b; --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  --gt-we: rgba(150, 170, 190, .07); --gt-line: rgba(150, 170, 190, .09);
  --c0: #5aa2f0; --c1: #f5a14a; --c2: #55b98a; --c3: #a583e0; --c4: #e0706d; --c5: #cfb43a; --c6: #4bb7bd; --c7: #96a6b5;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 12.5px/1.45 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.muted { color: var(--muted); }
code { background: var(--head); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

#app { height: 100dvh; display: flex; flex-direction: column; opacity: 0; transition: opacity .2s; }
body.ready #app { opacity: 1; }

/* ---------- topo ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); min-height: 56px; flex-wrap: wrap; border-bottom: 3px solid var(--laranja); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 280px; }
.logo { width: 30px; height: 30px; flex: none; display: block; }
.logo .b1 { fill: var(--laranja); } .logo .b2 { fill: var(--accent); } .logo .b3 { fill: var(--accent); opacity: .55; }
.brand-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.proj-name { border: 1px solid transparent; background: transparent; font-size: 16px; font-weight: 650; padding: 1px 6px; margin-left: -6px; border-radius: 6px; width: 100%; max-width: 520px; text-overflow: ellipsis; }
.proj-name:hover { border-color: var(--line); }
.proj-name:focus { border-color: var(--accent); outline: none; background: var(--bg); }
.brand-t small { color: var(--muted); font-size: 11.5px; padding-left: 0; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.pill { font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.pill.off { background: var(--laranja-soft); color: var(--laranja-esc); } .pill.off::before { background: var(--laranja); }
.saved { font-size: 11.5px; color: var(--good); min-width: 56px; }
.saved.dirty { color: var(--muted); }
.kpis { display: flex; gap: 8px; margin-left: auto; }
.kpi { display: flex; flex-direction: column; padding: 2px 12px; border-left: 3px solid var(--laranja); line-height: 1.2; }
.kpi span { font-size: 11px; color: var(--muted); }
.kpi b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.kpi small { font-size: 11px; color: var(--muted); }
.kpi.pos { border-color: var(--good); } .kpi.neg { border-color: var(--bad); } .kpi.neg b { color: var(--bad); }

/* ---------- botões ---------- */
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 5px 11px; font-weight: 500; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--head); border-color: var(--muted); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.icon { padding: 5px 9px; min-width: 32px; }
.btn.sm { padding: 2px 9px; font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg-b { border: 0; background: var(--surface); padding: 5px 11px; border-right: 1px solid var(--line); }
.seg-b:last-child { border-right: 0; }
.seg-b[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.search { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 5px 10px; width: 100%; max-width: 280px; }

/* ---------- abas ---------- */
.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--head); overflow-x: auto; flex: none; }
.tab { border: 0; background: transparent; padding: 9px 14px; font-weight: 500; color: var(--text-2); border-bottom: 3px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--laranja); font-weight: 650; background: var(--surface); }

.views { flex: 1; min-height: 0; position: relative; }
.view { display: none; height: 100%; flex-direction: column; min-height: 0; }
.view.on { display: flex; }
.view:not(.on) { display: none !important; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 7px 12px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.tg { display: flex; align-items: center; gap: 6px; }
.tg.grow { flex: 1; min-width: 160px; }
.statusbar { flex: none; padding: 5px 14px; border-top: 1px solid var(--line); background: var(--head); color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- planejamento ---------- */
.plan .split { flex: 1; display: flex; min-height: 0; }
.pane-grid { position: relative; overflow: hidden; min-width: 0; }
.pane-gantt { position: relative; flex: 1; min-width: 0; }
.splitter { touch-action: none; flex: 0 0 7px; cursor: col-resize; background: var(--head); border-left: 1px solid var(--line); border-right: 1px solid var(--line); position: relative; }
.splitter::after { content: ""; position: absolute; left: 2px; top: 50%; width: 3px; height: 34px; margin-top: -17px; border-radius: 2px; background: var(--line); }
.splitter:hover::after { background: var(--accent); }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none; }
body.dragging-bar, body.dragging-bar * { cursor: grabbing !important; user-select: none; }
.empty { margin: auto; text-align: center; max-width: 440px; padding: 40px 20px; }
.empty[hidden], .split[hidden] { display: none; }
.empty h3 { font-size: 18px; margin: 0 0 6px; }
.empty .row { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }

/* ---------- grade ---------- */
.grid { position: absolute; inset: 0; }
.g-scroll { position: absolute; top: 0; left: 0; bottom: 0; right: calc(0px - var(--sbw, 0px)); overflow: auto; outline: none; background: var(--bg); }
.flat-grid .g-scroll, .bgrid .g-scroll { right: 0; }
.g-inner { position: relative; }
.g-head { position: sticky; top: 0; z-index: 5; display: flex; background: var(--head); border-bottom: 1px solid var(--line); }
.hc { position: relative; flex: none; height: 100%; padding: 0 8px; display: flex; align-items: center; font-size: 11px; font-weight: 650; letter-spacing: .03em; color: var(--text-2); border-right: 1px solid var(--line-soft); overflow: hidden; }
.hc > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hc.num { justify-content: flex-end; }
.hc.stick { position: sticky; left: 0; z-index: 6; background: var(--head); justify-content: center; padding: 0; }
.rs { position: absolute; right: 0; top: 0; bottom: 0; width: 7px; cursor: col-resize; }
.rs:hover { background: var(--accent); opacity: .35; }
.g-body { position: relative; }
.g-rows { position: absolute; left: 0; top: 0; width: 100%; }
.g-row { position: absolute; left: 0; display: flex; height: var(--rowh, 28px); border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.g-row.rsel { background: var(--sel-soft); }
.g-row.inc .c { font-style: italic; }
.c { flex: none; height: var(--rowh, 28px); line-height: calc(var(--rowh, 28px) - 1px); padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid var(--line-soft); cursor: cell; }
.c.num { text-align: right; font-variant-numeric: tabular-nums; }
.c.ro { background: var(--ro); color: var(--text-2); }
.c.rn { position: sticky; left: 0; z-index: 2; background: var(--head); color: var(--muted); text-align: center; font-size: 11px; padding: 0; cursor: pointer; }
.c.rn.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.c.sel { background: var(--sel); }
.c.cur { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--bg); position: relative; z-index: 1; }
.c.err { color: var(--bad); }
.c.drv { color: var(--accent); }
.g-row.grp { background: var(--grp); font-weight: 600; z-index: 0; }
.g-row.grp.rsel { background: var(--accent-soft); }
.gi { position: sticky; left: 0; display: flex; align-items: center; gap: 10px; height: calc(var(--rowh, 28px) - 1px); padding: 0 10px 0 6px; overflow: hidden; }
.gi .gtog { cursor: pointer; width: 18px; text-align: center; color: var(--muted); user-select: none; flex: none; }
.gi .gtog:hover { color: var(--accent); }
.gdot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--bc); }
.gname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 80px; flex: 0 1 auto; }
.gmeta { color: var(--muted); font-weight: 450; font-size: 12px; white-space: nowrap; flex: none; }
.gsum { margin-left: auto; display: flex; gap: 14px; align-items: center; font-weight: 450; color: var(--text-2); flex: none; font-variant-numeric: tabular-nums; }
.gsum b { color: var(--text); font-weight: 650; }
.errtxt { color: var(--bad); }
.g-edit { position: absolute; z-index: 20; background: var(--bg); box-shadow: 0 0 0 2px var(--accent), 0 4px 14px rgba(0, 0, 0, .2); }
.g-edit input { width: 100%; height: 100%; border: 0; padding: 0 8px; background: transparent; outline: none; }

/* autocomplete */
.ac, .fac-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 320px; overflow: auto; }
.ac { position: fixed; z-index: 1000; }
.ac-i { display: flex; gap: 12px; align-items: baseline; padding: 6px 12px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.ac-i:last-child { border-bottom: 0; }
.ac-i b { flex: none; min-width: 64px; font-weight: 650; }
.ac-i span { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.ac-i em { flex: none; font-style: normal; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ac-i.hi { background: var(--accent-soft); }
.ac-empty { padding: 10px 12px; color: var(--muted); }
.fac { position: fixed; z-index: 1000; }
.fac input { width: 100%; padding: 8px 12px; border: 2px solid var(--accent); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); outline: none; }
.fac-list { margin-top: 4px; }

/* ---------- gantt ---------- */
.gantt { position: absolute; inset: 0; }
.gt-scroll { position: absolute; inset: 0; overflow: auto; background: var(--bg); outline: none; }
.gt-inner { position: relative; }
.gt-head { position: sticky; top: 0; z-index: 5; background: var(--head); border-bottom: 1px solid var(--line); }
.tier { position: relative; border-bottom: 1px solid var(--line-soft); }
.tier:last-child { border-bottom: 0; }
.tier .t { position: absolute; top: 0; bottom: 0; padding: 0 6px; font-size: 11px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; border-left: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; }
.tier .t.d { justify-content: center; padding: 0; font-weight: 500; gap: 2px; }
.tier .t.d small { font-size: 9px; color: var(--muted); }
.tier .t.we { background: var(--gt-we); }
.tier .t.td { background: var(--accent); color: var(--on-accent); border-radius: 3px; }
.tier .t.td small { color: var(--on-accent); }
.gt-body { position: relative; }
.gt-bg { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; }
.gt-layer { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.gt-row { position: absolute; left: 0; right: 0; border-bottom: 1px solid var(--line-soft); pointer-events: none; }
.gt-row.on { background: var(--sel-soft); }
.gt-row.grp { background: color-mix(in srgb, var(--grp) 55%, transparent); }
.gt-today { position: absolute; top: 0; width: 2px; margin-left: -1px; background: var(--bad); opacity: .65; z-index: 1; pointer-events: none; display: none; }
.gt-links { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 2; }
.lnk { fill: none; stroke: var(--text-2); stroke-width: 1.2; }
.arrh { fill: var(--text-2); }
.bar { position: absolute; z-index: 3; box-sizing: border-box; }
.bar.task { background: var(--bc); border-radius: 4px; cursor: grab; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.bar.task:hover { filter: brightness(1.1); }
.bar.task.drv { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .22) 0 4px, transparent 4px 8px); }
.bar.task.done { opacity: .7; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0, 0, 0, .32); border-radius: 4px 0 0 4px; pointer-events: none; }
.bar .hdl { position: absolute; right: 0; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.bar.sum { height: 9px; background: var(--bc); clip-path: polygon(0 0, 100% 0, 100% 100%, calc(100% - 5px) 55%, 5px 55%, 0 100%); }
.bar.sum i { background: rgba(0, 0, 0, .35); border-radius: 0; }
.blabel { position: absolute; font-size: 11px; color: var(--text-2); white-space: nowrap; pointer-events: none; z-index: 3; }
.gt-tip { display: none; position: absolute; z-index: 30; pointer-events: none; background: var(--text); color: var(--bg); padding: 6px 10px; border-radius: 6px; font-size: 12px; max-width: 340px; box-shadow: var(--shadow); line-height: 1.45; }
.c0 { --bc: var(--c0); } .c1 { --bc: var(--c1); } .c2 { --bc: var(--c2); } .c3 { --bc: var(--c3); }
.c4 { --bc: var(--c4); } .c5 { --bc: var(--c5); } .c6 { --bc: var(--c6); } .c7 { --bc: var(--c7); }

/* ---------- menus, modais, toasts ---------- */
.menu { position: fixed; z-index: 2000; min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; }
.mi { display: flex; width: 100%; justify-content: space-between; gap: 18px; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; }
.mi:hover:not(:disabled) { background: var(--accent-soft); }
.mi.danger { color: var(--bad); }
.mi.checked .mi-l::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.mi:not(.checked) .mi-l { padding-left: 0; }
.mi-h { color: var(--muted); font-size: 11.5px; }
.mtitle { padding: 6px 10px 3px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.sep { height: 1px; background: var(--line-soft); margin: 4px 2px; }
.modal-back { position: fixed; inset: 0; background: rgba(10, 20, 30, .45); z-index: 3000; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 12px 12px; overflow: auto; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: min(480px, 100%); display: flex; flex-direction: column; max-height: 84vh; }
.modal.wide { width: min(760px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 6px; }
.modal-h h2 { margin: 0; font-size: 16px; }
.modal .x { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); padding: 2px 8px; }
.modal-b { padding: 6px 18px 12px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line-soft); }
.field { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.field > span { font-weight: 600; font-size: 12px; color: var(--text-2); }
.field small { color: var(--muted); font-size: 11.5px; }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 6px 9px; width: 100%; }
.cfg h3 { margin: 14px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
#toasts { position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%); z-index: 4000; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: min(560px, 92vw); transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(6px); }
.projlist { display: flex; flex-direction: column; gap: 6px; }
.proj { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px 4px 4px; }
.proj.cur { border-color: var(--accent); background: var(--accent-soft); }
.proj-open { flex: 1; text-align: left; border: 0; background: transparent; padding: 6px 10px; display: flex; flex-direction: column; }
.proj-open small { color: var(--muted); }

/* ---------- abas planas / resumo / base ---------- */
.flat, .basev { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.flat-grid { position: relative; flex: 1; min-height: 0; }
.bgrid { position: absolute; inset: 0; }
.flat-total { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.flat-total span { display: flex; flex-direction: column; line-height: 1.15; }
.flat-total em { font-style: normal; font-size: 11px; color: var(--muted); }
.flat-total b { font-variant-numeric: tabular-nums; }
.resumo { padding: 16px; overflow: auto; flex: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--line); }
.card span { font-size: 12px; color: var(--muted); }
.card b { font-size: 21px; font-variant-numeric: tabular-nums; }
.card small { color: var(--muted); font-size: 11.5px; }
.card.pos { border-top-color: var(--good); } .card.neg { border-top-color: var(--bad); } .card.neg b { color: var(--bad); }
.stack { display: flex; height: 14px; border-radius: 4px; overflow: hidden; margin: 8px 0 6px; background: var(--head); }
.stack i, .legend i { background: var(--bc); }
.k1 { --bc: var(--c0); } .k2 { --bc: var(--c1); } .k3 { --bc: var(--c2); } .k4 { --bc: var(--c3); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }
.tblwrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.rtab { border-collapse: collapse; width: 100%; min-width: 1100px; font-variant-numeric: tabular-nums; }
.rtab th, .rtab td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; }
.rtab th { background: var(--head); font-size: 11px; letter-spacing: .03em; color: var(--text-2); position: sticky; top: 0; }
.rtab th:first-child, .rtab td:first-child { text-align: left; }
.rtab td.obra { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.rtab tfoot td { font-weight: 700; background: var(--head); border-bottom: 0; }
.rtab .neg { color: var(--bad); }
.barcol { width: 190px; text-align: left !important; }
.dbar { height: 7px; background: var(--head); border-radius: 3px; margin: 3px 0; overflow: hidden; }
.dbar i { display: block; height: 100%; border-radius: 3px; }
.dbar i.s { background: var(--c0); } .dbar i.c { background: var(--c1); }
.note { color: var(--muted); font-size: 12px; margin-top: 12px; }

/* ---------- responsivo / impressão ---------- */
@media (max-width: 900px) {
  .kpis { order: 5; width: 100%; margin: 0; overflow-x: auto; }
  .topbar { padding: 6px 10px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .toolbar { padding: 6px 8px; }
  .btn { padding: 6px 10px; }
}
@media print {
  .topbar .top-actions, .tabs, .toolbar, .statusbar, .splitter { display: none !important; }
  body { overflow: visible; } #app { height: auto; }
  .view:not(.on) { display: none; }
  .resumo { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- hub: tela inicial por setor ---------- */
.hub { width: 100%; max-width: 760px; margin: 0 auto; padding: 22px 16px 48px; overflow: auto; flex: 1; min-height: 0; display: grid; gap: 14px; align-content: start; grid-auto-rows: max-content; }
.hub-saud h1 { font-size: 20px; font-weight: 600; margin: 0; color: var(--accent-2); }
.hub-saud p { margin: 2px 0 0; }
.hub-setor { min-height: max-content; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 1px 2px rgba(11, 79, 158, .06); }
.hub-cab { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-left: 4px solid var(--laranja); }
.hub-cab h2 { font-size: 15px; font-weight: 600; margin: 0; flex: 1; }
.hub-chip { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.hub-setor.config .hub-chip { background: var(--laranja-soft); color: var(--laranja); }
.hub-setor.config .hub-cab { border-left-color: var(--accent); }
.ic { width: 20px; height: 20px; flex: none; }
.hub-lista { border-top: 1px solid var(--line-soft); }
.hub-row { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 16px 12px 20px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; font: inherit; font-size: 13px; color: var(--text); }
.hub-row:last-child { border-bottom: 0; }
.hub-row::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--laranja); flex: none; }
.hub-row:hover:not(:disabled) { background: var(--accent-soft); }
.hub-row:disabled { cursor: default; opacity: .55; }
.hub-nome { flex: 1; }
.hub-go { color: var(--accent); display: grid; }
.hub-go .ic { width: 16px; height: 16px; }
.hub-tag { font-size: 10.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--laranja-soft); color: var(--laranja-esc); }
.aviso { background: var(--laranja-soft); border-left: 4px solid var(--laranja); border-radius: 8px; padding: 10px 14px; font-size: 12.5px; color: var(--laranja-esc); margin: 0; }

/* ---------- login ---------- */
.login { min-height: 100%; flex: 1; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #0b4f9e 0%, #073565 100%); overflow: auto; }
.login-card { background: var(--surface); border-radius: 20px; padding: 26px 22px; width: 100%; max-width: 380px; display: grid; gap: 12px; border-top: 5px solid var(--laranja); box-shadow: var(--shadow); }
.login-card h1 { font-size: 20px; font-weight: 600; margin: 0; color: var(--accent-2); }
.login-card p { margin: 0; }
.login-logo .logo { width: 44px; height: 44px; }
.login-msg { min-height: 1.3em; font-size: 12.5px; }
.full { width: 100%; }
.login-card input, .adm input[type="text"], .adm input[type="email"], .modal input.full { font: inherit; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); color: var(--text); }
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card .btn.primary { padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.link { border: 0; background: none; color: var(--accent); text-decoration: underline; padding: 0; cursor: pointer; font: inherit; justify-self: start; }
.user-chip { color: var(--text-2); font-size: 12.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: center; }

/* ---------- configurações e administração ---------- */
.adm { padding: 14px 16px; overflow: auto; flex: 1; min-height: 0; }
.adm.cfg { max-width: 760px; width: 100%; margin: 0 auto; display: grid; gap: 14px; align-content: start; grid-auto-rows: max-content; }
.hcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.hcard h3 { font-size: 14px; font-weight: 600; color: var(--accent-2); margin: 0 0 10px; }
.hcard p { margin: 0; color: var(--text-2); }
.hcard.conta { display: flex; align-items: center; gap: 14px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 18px; flex: none; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.tag.or { background: var(--laranja-soft); color: var(--laranja-esc); }
.sim { color: var(--good); font-weight: 600; } .nao { color: var(--muted); }
td.c, th.c { text-align: center; }
.btns { display: grid; gap: 10px; }
.btns .btn { padding: 10px 14px; border-radius: 12px; border-color: var(--accent); color: var(--accent); font-weight: 500; }
.btns .btn.laranja { border-color: var(--laranja); color: var(--laranja-esc); }
.chk { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; white-space: nowrap; }
.papeis-col { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.btn.sm { padding: 3px 10px; font-size: 12px; }

/* ---------- situação de publicação (Rascunho / Publicado / alterado) ---------- */
.pubchip { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; background: var(--laranja-soft); color: var(--laranja-esc); border: 1px solid transparent; }
.pubchip.publicado { background: var(--accent-soft); color: var(--accent-2); }
.pubchip.alterado { background: var(--laranja-soft); color: var(--laranja-esc); border-color: var(--laranja); }
.pubchip:empty { display: none; }
.btn.pub { border-color: var(--laranja); }
.btn.pub.primary { background: var(--laranja); border-color: var(--laranja); color: #fff; }
.btn.pub.primary:hover:not(:disabled) { background: var(--laranja-esc); border-color: var(--laranja-esc); }

/* ---------- celular: tabela em cima, Gantt embaixo ---------- */
@media (max-width: 900px), (pointer: coarse) and (orientation: portrait) {
  .plan .split { flex-direction: column; }
  .pane-grid, .pane-gantt { min-height: 0; min-width: 0; width: 100%; }
  .pane-gantt { flex: 1 1 0; }
  .splitter { flex: 0 0 16px; cursor: row-resize; border-left: 0; border-right: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .splitter::after { left: 50%; top: 50%; width: 38px; height: 4px; margin: -2px 0 0 -19px; }
}
@media (max-width: 900px), (pointer: coarse) and (orientation: portrait) {
  .topbar { flex-wrap: wrap; gap: 6px; }
  .topbar .top-actions { flex-wrap: wrap; gap: 5px; max-width: 100%; width: 100%; }
  .topbar .top-actions .btn { padding: 5px 9px; font-size: 12px; }
  .user-chip { display: none; }
  .kpis { gap: 14px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs .tab { flex: none; }
  .toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 6px 12px; }
  .toolbar .tg { flex: none; }
  .toolbar .tg.grow { min-width: 0; }
  .toolbar .search { width: 150px; }
  .flat-total { white-space: nowrap; }
  .modal-back { padding: 4vh 8px 8px; }
  .modal { max-height: 92vh; }
  .modal-f { flex-wrap: wrap; }
  .modal-f .btn { flex: 1 1 auto; }
  .field input, .field select, .modal input, .modal select { font-size: 16px; } /* evita o zoom automático do iOS */
}

@media (pointer: coarse) {
  .btn, select.search, .tab { min-height: 36px; }
  .hub-row { min-height: 46px; }
}
@media (max-width: 900px), (pointer: coarse) and (orientation: portrait) {
  /* Informe: os botões de publicar precisam ficar à vista, então a barra quebra em linhas */
  .inf .toolbar { flex-wrap: wrap; overflow: visible; gap: 6px 8px; }
  .inf .toolbar .tg { flex-wrap: wrap; max-width: 100%; }
  .inf .toolbar .tg .search { flex: 1 1 130px; width: auto; min-width: 0; }
  .inf .toolbar .tg.grow { flex: 1 1 100%; }
  .inf .flat-total { display: flex; gap: 16px; }
}

@media (pointer: coarse) {
  .g-edit input { font-size: 16px; }
  .ac { font-size: 14px; }
  .ac-i { padding-top: 9px; padding-bottom: 9px; }
}

/* ---------- celular: telas de configuração e administração ---------- */
.cfg > *, .adm > *, .hcard { min-width: 0; }
.tblwrap { max-width: 100%; }
@media (max-width: 900px), (pointer: coarse) and (orientation: portrait) {
  .cfg, .adm { padding: 12px 12px 28px; }
  .hcard { padding: 14px; border-radius: 14px; overflow-wrap: anywhere; }
  .hcard.conta { flex-wrap: wrap; }
  .btns { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .btns .btn { width: 100%; min-height: 44px; }
  .adm-list { border: 0; overflow: visible; }
  .ctab.pilha, .ctab.pilha tbody, .ctab.pilha tr, .ctab.pilha td { display: block; width: 100%; }
  .ctab.pilha thead { display: none; }
  .ctab.pilha tr { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; }
  .ctab.pilha td { border: 0; padding: 4px 0; }
  .ctab.pilha td.papeis { display: flex; flex-wrap: wrap; gap: 4px 4px; padding: 8px 0; }
  .ctab.pilha td.papeis::before { content: attr(data-l); width: 100%; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .chk { padding: 6px 4px; margin-right: 8px; }
  .chk input { width: 20px; height: 20px; }
  .ctab.pilha .btn.sm { min-height: 40px; width: 100%; }
  .field input, .field select, .field textarea { min-height: 44px; }
  .modal .papeis-col { display: grid; gap: 4px; }
}
.ctab { border-collapse: collapse; width: 100%; }
.ctab th, .ctab td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.ctab th { background: var(--head); font-size: 11px; letter-spacing: .03em; color: var(--text-2); }
.ctab th.c, .ctab td.c { text-align: center; }
.ctab .sim { color: var(--good); font-weight: 600; } .ctab .nao { color: var(--muted); }
@media (max-width: 900px), (pointer: coarse) and (orientation: portrait) {
  .adm-list, .ctab.pilha { height: auto; overflow: visible; }
}

/* ---------- Departamento Pessoal: solicitação e Kanban ---------- */
.ctabs { display: flex; gap: 4px; padding: 6px 12px 0; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.ctabs .tab { border: 0; background: none; padding: 9px 14px; font-weight: 500; color: var(--text-2); border-bottom: 3px solid transparent; cursor: pointer; font: inherit; }
.ctabs .tab.on { color: var(--accent); border-bottom-color: var(--laranja); font-weight: 600; }
.view.sol { overflow: hidden; }
.sol-corpo { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 28px; }
.solform, .lista-sol { max-width: 860px; margin: 0 auto; display: grid; gap: 14px; align-content: start; }
.hcard.sec h3 { font-size: 15px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 14px; margin-top: 6px; }
.g2 .span2 { grid-column: 1 / -1; }
.field input.ro { background: var(--head); color: var(--text); font-weight: 600; }
.field input[type="text"], .field input[type="date"], .field select, .field textarea { font: inherit; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--bg); color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field[hidden], .sub[hidden], .hid[hidden] { display: none; }
.chks { display: flex; flex-wrap: wrap; gap: 8px 4px; }
.radios { display: flex; gap: 14px; padding: 4px 0; }
.sub { margin-top: 6px; }
.chk input { accent-color: var(--accent); width: 18px; height: 18px; }
.btn.big { padding: 14px 18px; font-size: 16px; font-weight: 600; border-radius: 14px; }
.combo { position: relative; }
.combo-lista { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 260px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.combo-it { padding: 9px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.combo-it.on, .combo-it:hover { background: var(--accent-soft); color: var(--accent-2); }
.combo-vazio { padding: 10px 12px; color: var(--muted); }
.sol-it { display: grid; gap: 4px; }
.sol-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sol-top b { flex: 1 1 160px; }
.sol-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.pdfbox .btns { margin-top: 12px; display: grid; gap: 8px; }
.pdfbox .btn { text-align: center; text-decoration: none; padding: 12px 14px; border-radius: 12px; display: block; }
.pdfbox p { margin: 0 0 6px; word-break: break-all; }

/* detalhes */
.det { display: grid; gap: 12px; }
.det-bloco { background: var(--grp-soft); border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; }
.det-bloco h4 { margin: 0 0 10px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-2); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.det .k { display: block; font-size: 11px; color: var(--muted); }
.det .v { font-weight: 500; font-size: 13.5px; word-break: break-word; }
.det .v.sal { color: var(--good); font-weight: 700; }
.det .v.or { color: var(--laranja-esc); }
.det .g2 { gap: 10px 14px; margin-bottom: 8px; }
.det .just { font-style: italic; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; color: var(--text-2); }
.linha { border-left: 2px solid var(--accent-soft); margin-left: 6px; padding-left: 16px; display: grid; gap: 14px; }
.passo { position: relative; }
.passo i { position: absolute; left: -23px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--laranja); border: 2px solid var(--surface); }
.passo p { margin: 4px 0 0; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 8px; padding: 6px 9px; color: var(--text-2); }
.ok { color: var(--good); } .nok { color: var(--bad); }

/* kanban */
.view.gestao { background: var(--head); }
.kb { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 14px; overflow-x: auto; align-items: flex-start; scroll-snap-type: x proximity; }
.kb-col { flex: none; width: 300px; max-height: 100%; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 14px; scroll-snap-align: start; }
.kb-col.fim { border-top-color: var(--good); }
.kb-col header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.kb-col h2 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--accent-2); }
.kb-n { background: var(--laranja-soft); color: var(--laranja-esc); font-weight: 700; font-size: 12px; padding: 1px 9px; border-radius: 99px; }
.kb-zona { padding: 10px; display: grid; gap: 10px; overflow-y: auto; min-height: 70px; align-content: start; border-radius: 0 0 12px 12px; }
.kb-zona.over { background: var(--accent-soft); outline: 2px dashed var(--accent); outline-offset: -4px; }
.kb-card { background: var(--bg); border: 1px solid var(--line); border-left: 4px solid var(--laranja); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.kb-card.fim { border-left-color: var(--good); }
.kb-card:hover { box-shadow: 0 4px 14px rgba(15, 30, 45, .14); transform: translateY(-1px); }
.kb-cargo { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.kb-nome { font-weight: 600; line-height: 1.25; margin-top: 2px; }
.kb-mini { margin-top: 8px; background: var(--head); border-radius: 8px; padding: 6px 8px; font-size: 11.5px; color: var(--text-2); display: grid; gap: 3px; }
.kb-mini div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-pe { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted); }
.kb-pe .mv { color: var(--accent); border-color: var(--accent); }
@media (max-width: 900px), (pointer: coarse) and (orientation: portrait) {
  .g2, .g3 { grid-template-columns: 1fr; }
  .sol-corpo { padding: 12px 12px 28px; }
  .ctabs { padding: 4px 8px 0; overflow-x: auto; }
  .kb { padding: 10px; gap: 10px; scroll-snap-type: x mandatory; }
  .kb-col { width: 84vw; max-width: 340px; }
  .kb-pe .mv { padding: 7px 12px; font-size: 12.5px; }
  .field input[type="text"], .field input[type="date"], .field select, .field textarea { font-size: 16px; }
  .btn.big { width: 100%; }
  .view.gestao .toolbar { flex-wrap: wrap; overflow: visible; }
  .view.gestao .toolbar .tg.grow { flex: 1 1 100%; order: 3; }
  .view.gestao .toolbar .search { width: 100%; }
}
.field .chk input, .field .radios input { width: 18px; height: 18px; padding: 0; border: 0; flex: none; }
.field .chk { margin-right: 10px; }
.field .chk input, .field .radios input { min-height: 0; min-width: 0; box-shadow: none; }
.field .chk, .field .radios .chk { padding: 6px 4px; min-height: 0; }
.tag.verde { background: #e3f4ea; color: var(--good); }
.tag.verm { background: #fdeae7; color: var(--bad); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.verde { background: #153524; } :root:not([data-theme="light"]) .tag.verm { background: #3a1b17; } }
.kb-card.fim-ok { border: 2px solid var(--good); background: color-mix(in srgb, var(--good) 6%, var(--bg)); }
.kb-card.fim-nok { border: 2px solid var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--bg)); }
.kb-sit { float: right; font-size: 10px; padding: 1px 8px; letter-spacing: 0; text-transform: none; }

/* ---------- Suprimentos: consulta de materiais ---------- */
.sp { display: flex; flex-direction: column; min-height: 0; }
.sp-bar select { max-width: 230px; }
.sp-corpo { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 24px; }
.sp-cards { margin-bottom: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.sp-cards .card b { font-size: 18px; }
.sp-info { margin: 0 0 10px; font-size: 12.5px; }
.sp-lista { display: flex; flex-direction: column; gap: 8px; }
.sp-mat { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; background: var(--surface); }
.sp-mat.urg { border-left-color: var(--laranja); }
.sp-mat.tarde { border-left-color: var(--bad); }
.sp-topo { display: grid; grid-template-columns: 22px minmax(200px, 2.2fr) 1fr 1.1fr 1fr 1fr 1fr; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; }
.sp-seta { color: var(--muted); font-size: 15px; }
.sp-nome { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-nome b { font-weight: 600; overflow-wrap: anywhere; }
.sp-num { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.sp-num small { font-size: 11px; }
.k { font-size: 11px; color: var(--muted); }
.sp-in { width: 100%; min-width: 0; font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); }
.sp-in:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.sp-st.st-2 { color: var(--accent); } .sp-st.st-3 { color: var(--laranja-esc); font-weight: 600; } .sp-st.st-4 { color: var(--good); font-weight: 600; }
.sp-filhos { border-top: 1px solid var(--line-soft); background: var(--head); border-radius: 0 0 10px 10px; padding: 6px 12px 10px 34px; display: flex; flex-direction: column; gap: 6px; }
.sp-cc { display: grid; grid-template-columns: minmax(200px, 2.2fr) 1fr 1.3fr 1.4fr; gap: 10px; align-items: center; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 8px; font-size: 13px; }
.sp-cc.tarde { border-color: var(--bad); }
.sp-cc-n { display: flex; flex-direction: column; min-width: 0; }
.sp-cc-s { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-cc-q, .sp-cc-d, .sp-cc-e { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-vazio { padding: 24px 4px; text-align: center; }
@media (max-width: 900px) {
  .sp-corpo { padding: 10px 10px 20px; }
  .sp-topo { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .sp-seta { display: none; }
  .sp-topo .sp-nome { grid-column: 1 / 3; }
  .sp-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sp-cards .card { padding: 8px 10px; }
  .sp-cards .card b { font-size: 15px; }
  .sp-filhos { padding: 6px 8px 10px; }
  .sp-cc { grid-template-columns: 1fr 1fr; }
  .sp-cc-n { grid-column: 1 / 3; }
  .sp-cc-e { grid-column: 1 / 3; }
  .sp-bar select { max-width: none; }
}

/* Suprimentos: orçamentos e saldo */
.sp-topo { grid-template-columns: 22px minmax(200px, 2.2fr) 1fr 1.1fr 1.1fr 1fr; }
.sp-mat.novo { border-left-color: var(--laranja); }
.sp-det { border-top: 1px solid var(--line-soft); background: var(--head); border-radius: 0 0 10px 10px; padding: 8px 12px 12px 30px; display: flex; flex-direction: column; gap: 8px; }
.sp-sec { padding: 4px 2px 0; font-size: 13px; }
.sp-saldo { display: flex; flex-direction: column; gap: 6px; border: 1px dashed var(--laranja); border-radius: 10px; padding: 8px; background: var(--laranja-soft); }
.sp-saldo .sp-sec { color: var(--laranja-esc); }
.sp-cc.sp-cc-s { grid-template-columns: 22px minmax(200px, 2.2fr) 1fr 1.3fr 1.2fr; cursor: pointer; }
.sp-cc-sv { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-acao { display: flex; justify-content: flex-end; }
.sp-orc { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.sp-orc.canc { opacity: .6; }
.sp-orc-h { display: grid; grid-template-columns: minmax(150px, 1.2fr) 1.4fr 1.1fr 1fr 1fr; gap: 10px; align-items: start; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.sp-orc-t { display: flex; flex-direction: column; gap: 2px; }
.sp-orc .sp-filhos { background: transparent; border: 0; padding: 6px 10px 10px; }
.or { color: var(--laranja-esc); } .ok { color: var(--good); } .nok { color: var(--bad); }
.novomat { display: flex; flex-direction: column; gap: 10px; min-width: min(560px, 80vw); }
@media (max-width: 900px) {
  .sp-topo { grid-template-columns: 1fr 1fr; }
  .sp-det { padding: 8px 8px 12px; }
  .sp-orc-h { grid-template-columns: 1fr 1fr; }
  .sp-orc-t { grid-column: 1 / 3; }
  .sp-cc.sp-cc-s { grid-template-columns: 22px 1fr 1fr; }
  .sp-cc.sp-cc-s .sp-cc-n { grid-column: 2 / 4; }
}
.sp-cc > *, .sp-orc-h > *, .sp-topo > * { min-width: 0; }
.sp-cc-n b { overflow-wrap: anywhere; }
.sp-saldo, .sp-orc, .sp-det { min-width: 0; max-width: 100%; }
@media (max-width: 900px) { .sp-cc, .sp-cc.sp-cc-s { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .sp-cc.sp-cc-s { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); } .sp-cc-d, .sp-cc-q { overflow: hidden; } }
.sp-cc, .sp-cc-s, .sp-orc, .sp-topo { white-space: normal; }

/* ---------- Gestão de Engenharia ---------- */
.ger { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.ger-lista { padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 8px; overflow: auto; flex: 1; min-height: 0; }
.ger-it { display: grid; grid-template-columns: minmax(220px, 3fr) auto minmax(120px, 2fr) auto; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ger-it-n { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .ger-it-n b { overflow-wrap: anywhere; }
.ger-obs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gchip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--head); color: var(--text-2); white-space: nowrap; }
.gchip.ok { background: rgba(31, 138, 76, .14); color: var(--good); } .gchip.nok { background: rgba(192, 57, 43, .14); color: var(--bad); }
.gchip.or { background: var(--laranja-soft); color: var(--laranja-esc); } .gchip.az { background: var(--accent-soft); color: var(--accent); }
.ger-cab { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.ger-tit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; } .ger-tit > div:nth-child(2) { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; }
.ger-acoes { margin-left: auto; }
.ger > .cards { padding: 10px 16px 0; margin: 0; flex: none; }
.ger-bar { flex: none; }
.ger-leg { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.ger-leg i { display: inline-block; width: 22px; height: 8px; border-radius: 3px; } .ger-leg .lp { background: var(--c0); } .ger-leg .le { background: var(--good); height: 5px; }
.ger-area { flex: 1; min-height: 0; display: flex; }
.ger-split { display: flex; flex: 1; min-height: 0; width: 100%; }
.ger-tab { flex: 0 0 min(640px, 48%); overflow: auto; border-right: 2px solid var(--line); }
.ger-gt { flex: 1; min-width: 0; position: relative; display: flex; }
.ger-gt .gantt { flex: 1; min-width: 0; }
.ger-t { border-collapse: collapse; width: 100%; font-size: 12.5px; table-layout: fixed; }
.ger-t th { position: sticky; top: 0; z-index: 2; background: var(--head); height: 34px; padding: 0 6px; text-align: left; font-size: 11px; color: var(--text-2); border-bottom: 1px solid var(--line); }
.ger-t td { padding: 0 6px; border-bottom: 1px solid var(--line-soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-sizing: border-box; }
.ger-t th:nth-child(1) { width: 19%; } .ger-t th:nth-child(2), .ger-t th:nth-child(3) { width: 11%; } .ger-t th:nth-child(4), .ger-t th:nth-child(5) { width: 10%; } .ger-t th:nth-child(6), .ger-t th:nth-child(7), .ger-t th:nth-child(8) { width: 8%; } .ger-t th:nth-child(9) { width: 15%; }
.ger-t.sem-inf .ci { display: none; } .ger-t.sem-inf th:nth-child(1) { width: 28%; } .ger-t.sem-inf th:nth-child(2), .ger-t.sem-inf th:nth-child(3) { width: 12%; } .ger-t.sem-inf th:nth-child(4), .ger-t.sem-inf th:nth-child(5) { width: 13%; } .ger-t.sem-inf th:nth-child(7) { width: 10%; } .ger-t.sem-inf th:nth-child(9) { width: 16%; }
.gs.dv1 { background: rgba(242, 140, 27, .22); color: var(--laranja-esc); } .gs.dv2 { background: rgba(192, 57, 43, .18); color: var(--bad); }
.bar.task.dv1 { outline: 2px solid var(--laranja); outline-offset: 1px; } .bar.task.dv2 { outline: 2px solid var(--bad); outline-offset: 1px; }
.ger-leg .ld1, .ger-leg .ld2 { background: transparent; height: 8px; } .ger-leg .ld1 { outline: 2px solid var(--laranja); } .ger-leg .ld2 { outline: 2px solid var(--bad); }
.ger-t td.n { max-width: 0; } .ger-t td.q { text-align: right; font-variant-numeric: tabular-nums; }
.ger-t tr.gg td { background: var(--grp); font-weight: 600; }
.gs { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--head); }
.gs.ok { background: rgba(31, 138, 76, .14); color: var(--good); } .gs.nok { background: rgba(192, 57, 43, .14); color: var(--bad); } .gs.or { background: var(--laranja-soft); color: var(--laranja-esc); } .gs.az { background: var(--accent-soft); color: var(--accent); }
.bar.exec { background: var(--good); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); } .bar.exec.atr { background: var(--bad); }
.ger-hist { margin-top: 12px; font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; } .ger-hist p { margin: 2px 0 0; color: var(--text-2); }
.ger-dec textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
@media (max-width: 900px) {
  .ger-it { grid-template-columns: 1fr auto; } .ger-it .ger-obs { grid-column: 1 / 3; white-space: normal; } .ger-it .btn { grid-column: 1 / 3; }
  .ger-area { overflow: auto; } .ger-split { flex-direction: column; min-height: 640px; }
  .ger-tab { flex: 0 0 280px; border-right: 0; border-bottom: 2px solid var(--line); } .ger-gt { min-height: 300px; }
  .ger-acoes { margin-left: 0; width: 100%; } .ger-acoes .btn { width: 100%; }
}

/* ---------- Gestão de Engenharia › Relatórios ---------- */
.rel-top { gap: 8px; flex-wrap: wrap; } .rel-top select { max-width: 340px; }
.rel-cont { padding: 12px 16px 40px; min-width: 0; flex: 1 1 auto; min-height: 0; overflow: auto; } .rel-top, .ger > .ctabs { flex: none; }
.rel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.rel-nota { font-size: 12px; margin: 0; max-width: 980px; line-height: 1.5; }
.graf-host { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 6px 4px; overflow: hidden; }
.graf { display: block; max-width: 100%; }
.graf .g-grade { stroke: var(--line-soft); stroke-width: 1; } .graf .g-eixo { fill: var(--muted); font-size: 11px; font-family: inherit; }
.graf .g-hoje { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 3 3; }
.g-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.g-leg span { display: inline-flex; align-items: center; gap: 5px; } .g-leg i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; } .g-leg i.ln { height: 3px; width: 18px; border-radius: 2px; }
.rel-wrap { max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.rel-t { min-width: 0; } .rel-t td { white-space: nowrap; } .rel-t tbody tr.tot td, .rel-t tr.tot td { font-weight: 700; background: var(--head); position: sticky; bottom: 0; }
.rel-t td:nth-child(3) { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.rel-prog { position: relative; width: 96px; height: 18px; background: var(--head); border-radius: 4px; overflow: hidden; margin-left: auto; }
.rel-prog i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--good); opacity: .35; } .rel-prog b { position: relative; font-size: 11.5px; line-height: 18px; padding-right: 6px; display: block; text-align: right; }
.rel-obras { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 10px; }
.rel-ob { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rel-ob > b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-lb { display: grid; grid-template-columns: 150px 1fr 110px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); } .rel-lb em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.rel-lb .dbar { height: 8px; background: var(--head); border-radius: 4px; overflow: hidden; } .rel-lb .dbar i { display: block; height: 100%; }
.rel-lb i.s { background: var(--c0); } .rel-lb i.c { background: var(--c4); } .rel-lb i.r { background: var(--c2); } .rel-lb i.a { background: var(--c1); }
@media (max-width: 640px) { .rel-lb { grid-template-columns: 110px 1fr 90px; } .rel-top select { max-width: 100%; width: 100%; } }

/* ---------- Configurações › Cadastros ---------- */
.cad .cad-seg { flex-wrap: wrap; margin: 6px 0 10px; } .cad .cad-tools { padding: 0; margin-bottom: 6px; gap: 8px; } .cad-res { display: block; margin: 2px 0 8px; font-size: 12px; }
.cad-wrap { max-height: 62vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.cad-t { width: 100%; min-width: 0; } .cad-t th { position: sticky; top: 0; background: var(--head); z-index: 1; text-align: left; font-size: 11px; color: var(--text-2); padding: 8px 10px; }
.cad-t td { padding: 7px 10px; vertical-align: middle; } .cad-t th.r, .cad-t td.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cad-t tr.cad-off td { opacity: .55; } .cad-t tr.cad-off td:last-child { opacity: 1; }
.cad-acoes { white-space: nowrap; text-align: right; } .cad-acoes .btn { margin-left: 6px; }
.adm.cfg:has(.cad) { max-width: 1180px; width: 100%; } .cad-t td:nth-child(2) { max-width: 520px; }
.cad-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; } .cad-f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-2); } .cad-f.lg { grid-column: 1 / -1; }
.cad-f input:disabled { opacity: .6; } .cad-prev, .cad-aviso { display: block; margin: 8px 0 0; }
@media (max-width: 640px) { .cad-form { grid-template-columns: 1fr; } .cad-t td:nth-child(n+4):not(:last-child), .cad-t th:nth-child(n+4):not(:last-child) { display: none; } .cad-acoes .btn { margin: 2px 0 0 0; display: block; width: 100%; } }
.rel-per { gap: 8px 12px; flex-wrap: wrap; padding-top: 0; } .rel-cust { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; } .rel-cust input { padding: 4px 6px; }
.rel-per .tg { flex-wrap: wrap; align-items: center; gap: 6px 8px; } .rel-per-t { font-weight: 600; color: var(--text-2); }

/* ---------- Orçamento ---------- */
.orc-card-t { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.orc-card-t h3 { margin: 0; }
.orc-card .row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.orc-lotes { display: grid; gap: 4px; max-height: 46vh; overflow: auto; margin: 6px 0 10px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.orc-lote { display: flex; gap: 8px; align-items: flex-start; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.orc-lote:hover { background: var(--accent-soft); }
.orc-lote.usado { opacity: .75; cursor: default; }
.orc-lote small { color: var(--muted); }
.orc-ed { height: 100%; }
.view.orc { display: flex; flex-direction: column; overflow: auto; }
.view.orc .adm { padding: 14px; }

.orc-sum { justify-content: flex-start !important; gap: 28px !important; padding: 6px 14px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.orc-sum span { flex-direction: row !important; align-items: baseline; gap: 6px; }
.orc-sum b { font-size: 15px; }
.field .orc-lote { display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 10px; text-align: left; }
.field .orc-lote input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.field .orc-lote > span { flex: 1; font-weight: 400; font-size: 13.5px; color: var(--text); line-height: 1.35; }

/* Planejamento Geral: itens do orçamento em negrito; itens fora do orçamento (aditivo) em peso normal */
.ac-i.dest b, .ac-i.dest span { font-weight: 700; color: var(--text); }
.ac-i.nd b { font-weight: 400; } .ac-i.nd span { font-weight: 400; }
.g-row .c.orc-in { font-weight: 700; }
.kpi.orc-med b { color: var(--accent); } .kpi.orc-adi b { color: var(--accent2, #d9730d); }
.orc-pick small { display: block; color: var(--muted); }

/* aditivo (Planejamento Geral): quantidade acima do orçado ou serviço fora do orçamento */
.g-row .c.adit:not(.cur):not(.sel) { background: rgba(245, 158, 11, .22); }
.g-row .c.adit { color: #b45309; }
.c.auto-cp { color: var(--accent); }
