/* ==========================================================================
   TeroProjects — sistema visual
   Claro e calmo, à maneira do Notion, com a identidade de teromovigo.com:
   títulos em Space Grotesk, texto em Inter, tinta quase preta, e o areia do
   logótipo (#C1AB7A) como único acento. Botões principais pretos, em pílula.
   ========================================================================== */

@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("../fonts/space-grotesk-latin-wght-normal.87c506d88b9f.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-wght-normal.a15f9d568fb0.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #ffffff;
  --side: #f7f7f5;
  --hover: #efefed;
  --active: #e9e9e6;
  --panel: #fbfbfa;
  --ink: #1d1d1b;
  --ink-2: #37352f;
  --muted: #787774;
  --faint: #a5a4a0;
  --line: #e9e9e7;
  --line-2: #dcdbd7;
  --sand: #c1ab7a;
  --sand-ink: #8a7445;
  --sand-soft: #f6f1e7;
  --t-gray: #f1f1ef;   --t-gray-ink: #787774;
  --t-blue: #e7f3f8;   --t-blue-ink: #337ea9;
  --t-green: #edf3ec;  --t-green-ink: #448361;
  --t-yellow: #fbf3db; --t-yellow-ink: #b27a1f;
  --t-red: #fdebec;    --t-red-ink: #d44c47;
  --t-sand: #f6f1e7;   --t-sand-ink: #8a7445;
  --focus: rgb(193 171 122 / .35);
  --shadow: 0 1px 2px rgb(15 15 15 / .04);
  --pop: 0 0 0 1px rgb(15 15 15 / .05), 0 3px 6px rgb(15 15 15 / .08), 0 9px 24px rgb(15 15 15 / .12);
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --sidebar: 244px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191919; --side: #202020; --hover: #2c2c2b; --active: #323231; --panel: #1f1f1f;
    --ink: #ebebe9; --ink-2: #d4d4d1; --muted: #9b9a97; --faint: #6f6e6b;
    --line: #2f2f2e; --line-2: #3a3a38;
    --sand: #c9b584; --sand-ink: #d8c69c; --sand-soft: #2d291f;
    --t-gray: #2f2f2e; --t-gray-ink: #a6a5a2; --t-blue: #1d3a4a; --t-blue-ink: #7fb8d8;
    --t-green: #1f3528; --t-green-ink: #7cc49a; --t-yellow: #3b3120; --t-yellow-ink: #e2b458;
    --t-red: #3e2322; --t-red-ink: #f08a84; --t-sand: #2d291f; --t-sand-ink: #d8c69c;
    --shadow: none; --pop: 0 0 0 1px rgb(255 255 255 / .06), 0 9px 24px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #191919; --side: #202020; --hover: #2c2c2b; --active: #323231; --panel: #1f1f1f;
  --ink: #ebebe9; --ink-2: #d4d4d1; --muted: #9b9a97; --faint: #6f6e6b;
  --line: #2f2f2e; --line-2: #3a3a38;
  --sand: #c9b584; --sand-ink: #d8c69c; --sand-soft: #2d291f;
  --t-gray: #2f2f2e; --t-gray-ink: #a6a5a2; --t-blue: #1d3a4a; --t-blue-ink: #7fb8d8;
  --t-green: #1f3528; --t-green-ink: #7cc49a; --t-yellow: #3b3120; --t-yellow-ink: #e2b458;
  --t-red: #3e2322; --t-red-ink: #f08a84; --t-sand: #2d291f; --t-sand-ink: #d8c69c;
  --shadow: none; --pop: 0 0 0 1px rgb(255 255 255 / .06), 0 9px 24px rgb(0 0 0 / .5);
  color-scheme: dark;
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 14px/1.55 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--focus); }
:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.mono, code { font-family: var(--mono); font-size: .9em; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.icon { flex: none; }

/* ---- Estrutura ------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.content { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 10px; background: var(--side); border-right: 1px solid var(--line); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: var(--ink); }
.brand__logo { width: 132px; height: auto; color: var(--ink); }
.brand__mark { width: 26px; height: 26px; color: var(--ink); }
.brand__app { font: 500 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--sand-ink); padding: 3px 7px; border-radius: 99px; background: var(--sand-soft); }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav__label { font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 16px 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 450; font-size: 14px; transition: background .1s;
}
.nav a .icon { color: var(--muted); }
.nav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { background: var(--active); color: var(--ink); font-weight: 550; }
.nav a[aria-current="page"] .icon { color: var(--ink); }
.nav__count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav a[aria-current="page"] .nav__count { color: var(--ink-2); }

.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.me { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: var(--r-sm); }
.me:hover { background: var(--hover); }
.me__info { min-width: 0; flex: 1; overflow: hidden; }
.me__name { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me__role { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font: 600 11px/1 var(--font); background: var(--t-sand); color: var(--t-sand-ink);
}
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.avatar--xs { width: 20px; height: 20px; font-size: 9px; }
.avatars { display: flex; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--bg); margin-left: -5px; }
.avatars .avatar:first-child { margin-left: 0; }
.avatar[data-tone="1"] { background: var(--t-blue); color: var(--t-blue-ink); }
.avatar[data-tone="2"] { background: var(--t-green); color: var(--t-green-ink); }
.avatar[data-tone="3"] { background: var(--t-yellow); color: var(--t-yellow-ink); }
.avatar[data-tone="4"] { background: var(--t-red); color: var(--t-red-ink); }
.avatar[data-tone="5"] { background: var(--t-gray); color: var(--t-gray-ink); }
.icon-btn {
  width: 28px; height: 28px; border-radius: var(--r-sm); border: 0; background: none;
  display: grid; place-items: center; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }

.main { min-width: 0; padding: 40px clamp(20px, 5vw, 96px) 96px; max-width: 1320px; margin: 0 auto; }
.topbar { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; flex-wrap: wrap; }
.eyebrow { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.eyebrow a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.eyebrow .sep { color: var(--faint); }
.title { font-family: var(--display); font-size: clamp(28px, 3vw, 38px); line-height: 1.12; letter-spacing: -.02em; font-weight: 600; }
.title em { font-style: normal; color: var(--sand-ink); }
.subtitle { color: var(--muted); margin-top: 8px; max-width: 70ch; font-size: 15px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- Grelhas e cartões ------------------------------------------------------ */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.split--wide { grid-template-columns: minmax(0, 1fr) 380px; }
.split > *, .grid > *, .stack > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.span-2 { grid-column: 1 / -1; }

.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
a.card { display: block; transition: background .12s, border-color .12s; }
a.card:hover { background: var(--panel); border-color: var(--line-2); }
.card--flush { padding: 0; overflow: hidden; }
.card--ink, .card--muted { background: var(--panel); }
.card--accent { background: var(--sand-soft); border-color: transparent; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card__title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card__title .icon { color: var(--muted); }
.card__title .count { font-weight: 400; color: var(--muted); font-size: 13px; }
.card__section { padding: 16px 20px; border-top: 1px solid var(--line); }
.card__section:first-child { border-top: 0; }
.section-title { font-family: var(--display); font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.section-title .count { font: 400 13px var(--font); color: var(--muted); }

.kpi__label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi__value { font-family: var(--display); font-size: 30px; line-height: 1.1; margin-top: 10px; letter-spacing: -.02em; font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi__foot { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kpi__contour, .hero__contours { display: none; }

/* ---- Botões ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg); color: var(--ink);
  font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .1s, border-color .1s;
}
.btn:hover { background: var(--hover); }
.btn .icon { color: var(--muted); }
.btn--primary { background: var(--ink); color: var(--bg); border-color: var(--ink); border-radius: 99px; padding: 0 16px; }
.btn--primary:hover { background: color-mix(in srgb, var(--ink) 84%, var(--bg)); }
.btn--primary .icon { color: inherit; }
.btn--accent { background: var(--sand); color: #1d1d1b; border-color: var(--sand); border-radius: 99px; padding: 0 16px; }
.btn--accent:hover { background: color-mix(in srgb, var(--sand) 88%, #000); }
.btn--accent .icon { color: inherit; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--hover); }
.btn--danger { color: var(--t-red-ink); }
.btn--danger .icon { color: inherit; }
.btn--sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn--lg { height: 40px; padding: 0 20px; font-size: 14.5px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.inline-form { display: inline; }

/* ---- Etiquetas ---------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px;
  font-size: 12.5px; font-weight: 450; white-space: nowrap; background: var(--t-gray); color: var(--t-gray-ink);
}
.badge--accent { background: var(--t-sand); color: var(--t-sand-ink); }
.badge--info { background: var(--t-blue); color: var(--t-blue-ink); }
.badge--ok { background: var(--t-green); color: var(--t-green-ink); }
.badge--warn { background: var(--t-yellow); color: var(--t-yellow-ink); }
.badge--danger { background: var(--t-red); color: var(--t-red-ink); }
.badge--muted { background: var(--t-gray); color: var(--t-gray-ink); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 2px 7px; border-radius: 4px;
  background: var(--t-gray); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tag--overdue { background: var(--t-red); color: var(--t-red-ink); }

/* ---- Progresso ------------------------------------------------------------------ */
.bar { width: 100%; height: 4px; }
.bar__track { fill: var(--t-gray); }
.bar__fill { fill: var(--sand); }
.bar--ok .bar__fill { fill: var(--t-green-ink); }
.ring__track { fill: none; stroke: var(--t-gray); stroke-width: 3.4; }
.ring__fill { fill: none; stroke: var(--sand); stroke-width: 3.4; stroke-linecap: round; }
.ring__label { font: 600 9.5px var(--font); fill: var(--ink); text-anchor: middle; dominant-baseline: central; }

/* ---- Tabelas (tipo base de dados) --------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12.5px; font-weight: 450; color: var(--muted);
  padding: 8px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--panel); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-link { font-weight: 500; }
.row-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }

/* ---- Cartões de obra ----------------------------------------------------------- */
.project-card { display: flex; flex-direction: column; gap: 14px; }
a.card.project-card, article.project-card { display: flex; }
article.project-card { cursor: pointer; transition: background .12s, border-color .12s; }
article.project-card:hover { background: var(--panel); border-color: var(--line-2); }
.project-card__ref { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.project-card__title { font-family: var(--display); font-size: 18px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
.project-card__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.project-card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.services { display: flex; flex-direction: column; gap: 9px; }
.service-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; font-size: 13px; }
.service-line__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service-line__qty { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.service-line .bar { grid-column: 1 / -1; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.list__main { flex: 1; min-width: 0; }
.list__title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.list__sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.empty {
  padding: 28px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2);
  border-radius: var(--r); display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty .serif { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--ink); }

/* ---- Tarefas ------------------------------------------------------------------- */
.task { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 14px; scroll-margin-top: 20px; }
.task__head { display: flex; gap: 12px; align-items: flex-start; }
.task__title { font-size: 15px; font-weight: 600; }
.task__title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.task__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.task__meta span { display: inline-flex; align-items: center; gap: 5px; }
.stages { display: flex; gap: 4px; }
.stage { flex: 1; min-width: 0; }
.stage__btn { width: 100%; border: 0; background: none; padding: 0; text-align: left; display: grid; gap: 6px; cursor: default; }
.stage__btn[type="submit"] { cursor: pointer; }
.stage__pip { height: 4px; border-radius: 2px; background: var(--t-gray); transition: background .15s; }
.stage--done .stage__pip { background: var(--sand); }
.stage--current .stage__pip { background: repeating-linear-gradient(-45deg, var(--sand) 0 3px, var(--sand-soft) 3px 6px); }
.stage__btn[type="submit"]:hover .stage__pip { background: var(--line-2); }
.stage--done .stage__btn[type="submit"]:hover .stage__pip { background: var(--sand-ink); }
.stage__name { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage--done .stage__name, .stage--current .stage__name { color: var(--ink); }
.stage--current .stage__name { font-weight: 550; }
.unit-suffix { font-size: 13px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.fields-public { display: flex; flex-wrap: wrap; gap: 6px; }

.stepper { list-style: none; margin: 0; padding: 0; }
.stepper li { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; position: relative; }
.stepper li::before { content: ""; position: absolute; left: 12px; top: -8px; height: 16px; width: 2px; background: var(--line); }
.stepper li:first-child::before { display: none; }
.stepper li.is-done::before { background: var(--sand); }
.step__dot {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--bg);
  display: grid; place-items: center; color: transparent; cursor: pointer; padding: 0; position: relative; z-index: 1;
}
button.step__dot:hover { border-color: var(--sand); color: var(--faint); }
.is-done .step__dot { background: var(--sand); border-color: var(--sand); color: #fff; }
.is-current .step__dot { border-color: var(--sand); background: var(--sand-soft); }
.step__name { font-weight: 500; }
.step__sub { font-size: 12px; color: var(--muted); }
.step__date input { width: 150px; }

/* ---- Cronograma --------------------------------------------------------------------- */
.gantt__row { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: 16px; align-items: center; min-height: 36px; }
.gantt__label { font-size: 13px; min-width: 0; }
.gantt__label a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.gantt__label small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt__track { position: relative; height: 36px; }
.gantt svg { width: 100%; height: 100%; overflow: visible; }
.gantt__axis { height: 24px; min-height: 24px; }
.gantt__tick { stroke: var(--line-2); }
.gantt__ticklabel { font: 500 10.5px var(--font); fill: var(--muted); }
.gantt__grid { stroke: var(--line); stroke-dasharray: 2 4; }
.gantt__today { stroke: var(--t-red-ink); stroke-width: 1.25; }
.gantt__todaylabel { font: 600 10px var(--font); fill: var(--t-red-ink); }
.gantt__due { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.gantt__bar { fill: var(--t-gray); stroke: var(--line-2); stroke-width: .8; }
.gantt__fill { fill: var(--sand); }
.gantt__bar--done { fill: var(--t-green); stroke: transparent; }
.gantt__bar--done + .gantt__fill { fill: var(--t-green-ink); }
.gantt__bar--overdue { stroke: var(--t-red-ink); }
.gantt__legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.gantt__legend i { display: inline-block; width: 14px; height: 6px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.lg-done { background: var(--t-green-ink); } .lg-prog { background: var(--sand); } .lg-plan { background: var(--t-gray); border: 1px solid var(--line-2); }
.lg-today { background: var(--t-red-ink); width: 2px !important; height: 11px !important; border-radius: 0 !important; }

/* ---- Timeline -------------------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 0 0 16px; }
.tl__dot { width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line-2); color: var(--muted); position: relative; z-index: 1; }
.tl__dot .icon { width: 12px; height: 12px; }
.tl--award .tl__dot, .tl--delivery .tl__dot { background: var(--sand-soft); border-color: var(--sand); color: var(--sand-ink); }
.tl--stage .tl__dot, .tl--status .tl__dot { color: var(--t-green-ink); }
.tl--comment .tl__dot { color: var(--t-blue-ink); }
.tl--note .tl__dot { border-style: dashed; }
.tl__body { min-width: 0; padding-top: 2px; }
.tl__msg { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl--comment .tl__msg, .tl--note .tl__msg { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; margin-top: 5px; }
.tl--note .tl__msg { border-style: dashed; background: transparent; }
.tl__meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.tl__meta strong { color: var(--ink-2); font-weight: 550; }
.tl__meta .pill { font-size: 11px; border: 1px dashed var(--line-2); border-radius: 99px; padding: 0 6px; }

/* ---- Ficheiros ------------------------------------------------------------------------------ */
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.file { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: var(--r-sm); }
.file:hover { background: var(--panel); }
.file__icon { width: 34px; height: 38px; border-radius: 5px; display: grid; place-items: center; font: 600 9px var(--font); text-transform: uppercase; background: var(--t-gray); color: var(--t-gray-ink); }
.file__icon[data-g="doc"] { background: var(--t-red); color: var(--t-red-ink); }
.file__icon[data-g="sheet"] { background: var(--t-green); color: var(--t-green-ink); }
.file__icon[data-g="img"] { background: var(--t-blue); color: var(--t-blue-ink); }
.file__icon[data-g="cad"] { background: var(--t-yellow); color: var(--t-yellow-ink); }
.file__icon[data-g="gis"], .file__icon[data-g="cloud"], .file__icon[data-g="zip"] { background: var(--t-sand); color: var(--t-sand-ink); }
.file__name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.file__meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.file__actions { display: flex; gap: 2px; align-items: center; }

.dropzone {
  border: 1px dashed var(--line-2); border-radius: var(--r); padding: 20px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; display: grid; gap: 4px; justify-items: center; color: var(--muted); position: relative;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--sand); background: var(--sand-soft); color: var(--ink); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone__name { font-weight: 500; color: var(--ink); }

/* ---- Formulários ----------------------------------------------------------------------------- */
.form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.field .help { font-size: 12px; color: var(--faint); }
.field .errors { font-size: 12.5px; color: var(--t-red-ink); list-style: none; margin: 0; padding: 0; }
.input, .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .field textarea {
  width: 100%; min-height: 36px; padding: 7px 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--bg); color: var(--ink); outline: none; transition: border-color .12s, box-shadow .12s;
}
.field textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--sand); box-shadow: 0 0 0 3px var(--focus); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--t-red-ink); }
.field select, select.input {
  appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23787774' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.field--check { grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.field--check > label { font-weight: 450; color: var(--ink); order: 2; font-size: 14px; }
.field--check .help, .field--check .errors { grid-column: 2; order: 3; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.checks label { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; }
.checks label:has(input:checked) { border-color: var(--sand); background: var(--sand-soft); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding-top: 4px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }
.search { position: relative; }
.search .icon { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search input { padding-left: 32px !important; min-width: 240px; }
.filters { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.chip { height: 28px; padding: 0 10px; border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.chip:hover { background: var(--hover); color: var(--ink); }
.chip[aria-current="true"] { color: var(--ink); background: var(--active); font-weight: 500; }
.chip .n { font-size: 12px; color: var(--faint); }

.lines { display: grid; gap: 6px; }
.line { display: grid; gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); }
.line--request { grid-template-columns: minmax(0, 2.2fr) minmax(90px, .8fr) minmax(0, 2fr); }
.line .field > label { font-size: 11.5px; }

/* ---- Mensagens ------------------------------------------------------------------------------ */
.flashes { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); background: var(--bg); color: var(--ink); box-shadow: var(--pop); animation: flash-in .3s var(--ease) both; font-size: 13.5px; }
.flash .icon { color: var(--t-green-ink); margin-top: 2px; }
.flash--error .icon { color: var(--t-red-ink); }
.flash button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; }
.flash.is-leaving { animation: flash-out .25s var(--ease) forwards; }
@keyframes flash-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes flash-out { to { opacity: 0; transform: translateY(6px); } }

.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); font-size: 13.5px; align-items: flex-start; }
.callout--warn { background: var(--t-yellow); border-color: transparent; color: var(--t-yellow-ink); }
.callout--danger { background: var(--t-red); border-color: transparent; color: var(--t-red-ink); }
.callout--ok { background: var(--t-green); border-color: transparent; color: var(--t-green-ink); }
.callout--accent { background: var(--sand-soft); border-color: transparent; }
.callout .icon { margin-top: 2px; }

.dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; margin: 0; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; text-align: right; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---- Cabeçalho da obra (claro) ------------------------------------------------------------ */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.hero__meta { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--muted); align-items: center; }
.hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero__meta strong { color: var(--ink); font-weight: 500; }
.hero__progress { text-align: right; }
.hero__pct { font-family: var(--display); font-size: 44px; line-height: 1; letter-spacing: -.03em; font-weight: 500; }
.hero__pct small { font-size: .5em; color: var(--sand-ink); }
.hero__pctlabel { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.hero__actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* ---- Entrada ------------------------------------------------------------------------------ */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 40px 16px; background: var(--bg); }
.auth__card { width: min(360px, 100%); display: grid; gap: 20px; }
.auth__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.auth__logo { width: 150px; color: var(--ink); }
.auth__card h1 { font-family: var(--display); font-size: 28px; line-height: 1.15; letter-spacing: -.02em; font-weight: 600; }
.auth__card .lead { color: var(--muted); margin-top: 6px; }
.auth__secure { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--faint); justify-content: center; }
.auth__foot { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--faint); }
.otp { font: 500 22px var(--mono) !important; letter-spacing: .3em; text-align: center; height: 52px; }
.qr { background: #fff; padding: 10px; border-radius: var(--r); display: inline-block; border: 1px solid var(--line); }
.qr svg { width: 168px; height: 168px; }
.secret { font: 500 13.5px var(--mono); letter-spacing: .08em; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font: 500 14px var(--mono); }
.codes span { padding: 9px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); text-align: center; }

.lang { display: inline-flex; gap: 1px; padding: 2px; border-radius: var(--r-sm); background: var(--hover); }
.lang__btn { border: 0; background: none; font: 500 11.5px/1 var(--font); padding: 5px 8px; border-radius: 4px; color: var(--muted); cursor: pointer; }
.lang__btn:hover { color: var(--ink); }
.lang__btn[aria-current="true"] { background: var(--bg); color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.sidebar__foot .lang { align-self: flex-start; margin-left: 6px; }

/* ---- Documento da proposta (vista HTML) ------------------------------------------------------ */
.doc { max-width: 880px; }
.doc__head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.doc__logo { width: 150px; color: var(--ink); }
.doc__kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; color: var(--sand-ink); text-transform: uppercase; }
.doc__num { font-family: var(--display); font-size: 18px; font-weight: 600; }
.doc__title { font-family: var(--display); font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -.02em; font-weight: 600; margin: 28px 0 20px; }
.doc__parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; padding-bottom: 24px; font-size: 14px; }
.doc__parties h4 { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.doc-table th { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: right; padding: 8px 0 8px 12px; border-bottom: 1.5px solid var(--ink); }
.doc-table th:first-child { text-align: left; padding-left: 0; }
.doc-table td { padding: 9px 0 9px 12px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; font-variant-numeric: tabular-nums; }
.doc-table td:first-child { text-align: left; padding-left: 0; }
.doc-table .sec td { border-bottom: 0; padding-top: 20px; font-family: var(--display); font-size: 15px; font-weight: 600; }
.doc-table .sec td:last-child { font: 400 13px var(--font); color: var(--muted); }
.doc-table .sec i { display: inline-block; width: 7px; height: 7px; background: var(--sand); border-radius: 2px; margin-right: 9px; vertical-align: 2px; }
.doc-table .sub td { color: var(--muted); font-weight: 500; padding-top: 2px; padding-bottom: 6px; }
/* Um subtítulo agrupa as linhas seguintes: sem traço por cima, só por baixo. */
.doc-table tr:has(+ tr.sub) td { border-bottom: 0; }
.doc-table .opt td { color: var(--muted); }
.doc-table .unit { color: var(--muted); }
.doc-total { margin: 24px 0 6px auto; width: min(360px, 100%); background: var(--ink); color: var(--bg); border-radius: var(--r-lg); padding: 16px 20px; display: grid; gap: 6px; }
.doc-total div { display: flex; justify-content: space-between; gap: 20px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.doc-total .grand { font-family: var(--display); font-size: 15px; font-weight: 500; align-items: baseline; }
.doc-total .grand strong { font-size: 24px; font-weight: 600; }
.doc-note { text-align: right; font-size: 12.5px; color: var(--muted); }
.doc-infos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 28px; }
.doc-infos div { background: var(--sand-soft); border-radius: var(--r); padding: 12px 14px; }
.doc-infos h4 { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.doc-infos p { font-family: var(--display); font-size: 16px; font-weight: 500; margin-top: 2px; }
.doc__terms { margin-top: 24px; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }
.decision { position: sticky; top: 24px; }

/* ---- Editor de orçamentos ------------------------------------------------------------------ */
.qe { max-width: 980px; }
.qe-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 0; margin: -16px 0 18px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.qe-status { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.qe-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--t-green-ink); }
.qe-status[data-state="dirty"]::before, .qe-status[data-state="saving"]::before { background: var(--t-yellow-ink); }
.qe-status[data-state="error"]::before { background: var(--t-red-ink); }
.qe-status[data-state="error"] { color: var(--t-red-ink); }
.qe-title { width: 100%; border: 0; outline: 0; background: transparent; font-family: var(--display); font-size: clamp(26px, 3.2vw, 36px); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; padding: 4px 0; resize: none; overflow: hidden; }
.qe-title::placeholder, .qe-plain::placeholder, .qe-cell::placeholder { color: var(--faint); }
.props { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 2px 8px; margin: 14px 0 28px; font-size: 14px; }
.props > label { display: flex; align-items: center; gap: 8px; color: var(--muted); height: 34px; font-size: 13.5px; }
.props > label .icon { color: var(--faint); }
.props > .v { min-height: 34px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.qe-plain { width: 100%; border: 0; outline: 0; background: transparent; padding: 6px 8px; border-radius: var(--r-sm); min-height: 32px; color: var(--ink); }
.qe-plain:hover { background: var(--hover); }
.qe-plain:focus { background: var(--bg); box-shadow: 0 0 0 1px var(--line-2), 0 0 0 4px var(--focus); }
select.qe-plain { appearance: none; cursor: pointer; }
.seg { display: inline-flex; gap: 1px; padding: 2px; border-radius: var(--r-sm); background: var(--hover); }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 4px; font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }

.qe-section { margin-top: 26px; }
.qe-section__head { display: flex; align-items: center; gap: 8px; border-bottom: 1.5px solid var(--ink); padding-bottom: 4px; }
.qe-section__head i { width: 8px; height: 8px; background: var(--sand); border-radius: 2px; flex: none; }
.qe-section__title { flex: 1; border: 0; outline: 0; background: transparent; font-family: var(--display); font-size: 18px; font-weight: 600; padding: 4px 6px; border-radius: var(--r-sm); min-width: 0; }
.qe-section__title:hover { background: var(--hover); }
.qe-section__title:focus { background: var(--bg); box-shadow: 0 0 0 4px var(--focus); }
.qe-section__sum { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.qe-cols, .qe-line { display: grid; grid-template-columns: 22px minmax(0, 1fr) 72px 82px 104px 118px 30px; gap: 6px; align-items: start; }
.qe-cols { font-size: 11.5px; color: var(--muted); padding: 8px 0 4px; }
.qe-cols span:nth-child(n+3) { text-align: right; padding-right: 8px; }
.qe-line { padding: 2px 0; border-bottom: 1px solid var(--line); position: relative; }
.qe-line:hover { background: var(--panel); }
.qe-line.is-heading .qe-cell--desc { font-weight: 600; color: var(--muted); }
.qe-line.is-optional { color: var(--muted); }
.qe-line.is-dragging { opacity: .4; }
.qe-line.drop-before { box-shadow: inset 0 2px 0 var(--sand); }
.qe-handle { height: 32px; display: grid; place-items: center; color: var(--faint); cursor: grab; opacity: 0; border-radius: 4px; }
.qe-line:hover .qe-handle { opacity: 1; }
.qe-handle:hover { background: var(--hover); color: var(--ink); }
.qe-cell { width: 100%; border: 0; outline: 0; background: transparent; padding: 6px 8px; border-radius: var(--r-sm); min-height: 32px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.qe-cell:hover { background: var(--hover); }
.qe-cell:focus { background: var(--bg); box-shadow: 0 0 0 1px var(--line-2), 0 0 0 4px var(--focus); }
.qe-cell--desc { resize: none; overflow: hidden; display: block; }
.qe-cell--num { text-align: right; }
.qe-total { text-align: right; padding: 6px 8px; font-variant-numeric: tabular-nums; white-space: nowrap; min-height: 32px; font-weight: 500; }
.qe-total.is-manual { color: var(--sand-ink); }
.qe-line .qe-flag { position: absolute; left: 30px; bottom: -1px; font-size: 10.5px; color: var(--sand-ink); }
.qe-menu-btn { height: 32px; opacity: 0; }
.qe-line:hover .qe-menu-btn, .qe-menu-btn[aria-expanded="true"] { opacity: 1; }
.qe-add { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.qe-add .btn { color: var(--muted); }
.qe-add .btn:hover { color: var(--ink); }
.menu { position: absolute; z-index: 40; min-width: 210px; background: var(--bg); border-radius: var(--r); box-shadow: var(--pop); padding: 5px; display: grid; }
.menu button, .menu a { display: flex; align-items: center; gap: 9px; border: 0; background: none; text-align: left; padding: 6px 9px; border-radius: 5px; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.menu button:hover, .menu a:hover { background: var(--hover); }
.menu button .icon { color: var(--muted); }
.menu hr { margin: 4px 2px; }
.menu .danger { color: var(--t-red-ink); }
.menu .danger .icon { color: inherit; }
.menu__search { border: 0; outline: 0; padding: 7px 9px; border-bottom: 1px solid var(--line); margin-bottom: 4px; background: transparent; }
.menu__list { max-height: 280px; overflow-y: auto; display: grid; }
.menu__item-sub { margin-left: auto; font-size: 12px; color: var(--muted); }
.qe-footer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; margin-top: 36px; align-items: start; }
.qe-sum { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: grid; gap: 8px; font-size: 13.5px; }
.qe-sum > div { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-variant-numeric: tabular-nums; }
.qe-sum .grand { border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 2px; font-family: var(--display); font-size: 15px; font-weight: 600; }
.qe-sum .grand span:last-child { font-size: 22px; }
.qe-sum input.qe-plain { width: 72px; text-align: right; min-height: 28px; padding: 3px 6px; }
.qe-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.qe-notes { display: grid; gap: 14px; }
.qe-notes textarea { width: 100%; min-height: 70px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--bg); resize: vertical; outline: 0; line-height: 1.5; }
.qe-notes textarea:focus { border-color: var(--sand); box-shadow: 0 0 0 3px var(--focus); }
.qe-client { display: flex; gap: 6px; width: 100%; align-items: center; }
.qe-client select { max-width: 50%; }

.modal-back { position: fixed; inset: 0; background: rgb(15 15 15 / .35); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--pop); width: min(480px, 100%); padding: 22px; display: grid; gap: 14px; }
.modal h3 { font-family: var(--display); font-size: 18px; }

/* ---- Gráfico financeiro --------------------------------------------------------------------- */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 170px; padding-top: 10px; }
.bars__col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars__pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bars__pair svg { width: 40%; height: 100%; max-width: 12px; }
.bars__a { fill: var(--sand); }
.bars__i { fill: var(--line-2); }
.bars__label { font-size: 11px; color: var(--muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend .a { background: var(--sand); } .legend .i { background: var(--line-2); }
.meter { display: grid; gap: 6px; }
.meter__row { display: flex; justify-content: space-between; font-size: 13px; }

/* ---- Erros --------------------------------------------------------------------------------- */
.error-page { min-height: 70dvh; display: grid; place-items: center; text-align: center; }
.error-page .code { font-family: var(--display); font-size: clamp(72px, 12vw, 140px); line-height: .9; letter-spacing: -.04em; font-weight: 600; }
.error-page .code em { font-style: normal; color: var(--sand); }

/* ---- Utilitários (a CSP não permite style="") -------------------------------------------------- */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; } .mt-6 { margin-top: 28px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 24px; }
.gap-5 { gap: 20px; } .w-narrow { max-width: 560px; } .w-mid { max-width: 780px; } .w-full { width: 100%; }

/* Só opacidade: um transform no antepassado desviaria elementos position: fixed. */
@keyframes rise { from { opacity: 0; } }
.reveal > * { animation: rise .3s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Responsivo ------------------------------------------------------------------------------ */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .split--wide, .qe-footer { grid-template-columns: 1fr; }
  .decision { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--pop); }
  .nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgb(15 15 15 / .3); z-index: 39; opacity: 0; pointer-events: none; transition: opacity .25s; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
  .topbar .brand { padding: 0; }
  .main { padding: 24px 16px 64px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero__progress { text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .line--request { grid-template-columns: 1fr 1fr; }
  .line--request .field:last-child { grid-column: 1 / -1; }
  .gantt__row { grid-template-columns: 110px 1fr; gap: 10px; }
  .table-stack thead { display: none; }
  .table-stack tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 14px; border-bottom: 1px solid var(--line); gap: 4px 10px; }
  .table-stack td { padding: 0; border: 0; }
  .table-stack td.hide-sm { display: none; }
  .props { grid-template-columns: 1fr; }
  .props > label { height: auto; padding-top: 8px; }
  .qe-cols { display: none; }
  .qe-line { grid-template-columns: 22px minmax(0, 1fr) 30px; }
  .qe-line .qe-cell--unit, .qe-line .qe-cell--qty, .qe-line .qe-cell--price { grid-column: 2; }
  .qe-line .qe-total { grid-column: 2; text-align: left; }
  .search input { min-width: 0; }
}
@media (min-width: 901px) { .scrim { display: none; } }
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .kpi__value { font-size: 24px; }
  .file { grid-template-columns: 34px minmax(0, 1fr); }
  .file__actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media print {
  .sidebar, .topbar, .no-print, .flashes, .decision { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .split { display: block; }
}

.qe-line.is-heading .qe-cell--desc { grid-column: 2 / 7; }
.qe-line.is-heading .qe-menu-btn { grid-column: 7; }

.grid > .card__section { border-top: 0; }

/* Editor: como no documento, o traço de uma linha seguida de subtítulo desaparece. */
.qe-line:has(+ .qe-line.is-heading) { border-bottom-color: transparent; }

/* Menu de estado das propostas (<details>, sem JavaScript obrigatório). */
.status-menu { position: relative; display: inline-block; }
.status-menu > summary { list-style: none; cursor: pointer; gap: 4px; user-select: none; }
.status-menu > summary::-webkit-details-marker { display: none; }
.status-menu > summary:hover { filter: brightness(.96); }
.status-menu[open] > summary { box-shadow: 0 0 0 2px var(--focus); }
.status-menu__list { top: calc(100% + 4px); left: 0; min-width: 170px; z-index: 60; }
.status-menu__list form { display: block; }
.status-menu__list button { width: 100%; }
.status-menu__list button[disabled] { cursor: default; background: var(--panel); }
td:last-child .status-menu__list, .page-actions .status-menu__list { left: auto; right: 0; }
/* A tabela não pode cortar o menu de estado. */
.table-wrap:has(.status-menu), .card--flush:has(.status-menu) { overflow: visible; }
.menu--floating { position: fixed !important; z-index: 80; }
.status-menu > .menu:not(.menu--floating) { display: none; }

/* Campos lado a lado alinham pelo topo, mesmo que um tenha texto de ajuda. */
.form-grid { align-items: start; }
