/* ===== Tokens ===== */
:root {
  --brand: #0B4BB7;
  --brand-ink: #0a3f99;
  --accent: #8BE67D;
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --surface-3: #eef3fc;
  --ink: #17223a;
  --muted: #64708a;
  --line: #e1e6ef;
  --ok: #2f8a22;   --ok-bg: #e5f7e1;
  --info: #0B4BB7; --info-bg: #e8f0ff;
  --warn: #9a5b00; --warn-bg: #fff2dc;
  --bad: #b42318;  --bad-bg: #fdeceb;
  --shadow: 0 1px 2px rgba(23, 34, 58, .06), 0 4px 16px rgba(23, 34, 58, .05);
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #5b8fff; --brand-ink: #8db0ff; --bg: #0f1522; --surface: #172033; --surface-2: #1c273c; --surface-3: #22314c;
    --ink: #e9eef8; --muted: #9aa7be; --line: #2b3852;
    --ok: #79d46b; --ok-bg: #1d3a22; --info: #8db0ff; --info-bg: #1e2f52; --warn: #f1b45a; --warn-bg: #3d2d12; --bad: #ff8a80; --bad-bg: #44201f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #5b8fff; --brand-ink: #8db0ff; --bg: #0f1522; --surface: #172033; --surface-2: #1c273c; --surface-3: #22314c;
  --ink: #e9eef8; --muted: #9aa7be; --line: #2b3852;
  --ok: #79d46b; --ok-bg: #1d3a22; --info: #8db0ff; --info-bg: #1e2f52; --warn: #f1b45a; --warn-bg: #3d2d12; --bad: #ff8a80; --bad-bg: #44201f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
h1, h2, h3 { margin: 0 0 6px; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 14px; margin-top: 22px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); border-color: var(--brand); }
input[type="range"] { padding: 0; border: 0; accent-color: var(--brand); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small, small { font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; margin-right: 6px; vertical-align: middle; }
.eyebrow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--brand); margin: 0 0 4px; display: flex; align-items: center; }
.clickable { cursor: pointer; }

/* ===== Layout ===== */
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card { margin-bottom: 16px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== Header ===== */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-inner { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 14px; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo { height: 38px; width: auto; display: block; }
.menu-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 9px; cursor: pointer; flex-direction: column; justify-content: space-between; flex: none; }
.nav-works { display: none; }
/* Login e acesso */
body.locked .top, body.locked main { display: none; }
#login { display: none; }
body.locked #login { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.login-card .logo { height: 46px; align-self: center; }
.login-card > p.muted { text-align: center; margin: -6px 0 6px; }
.login-seg { align-self: stretch; display: flex; }
.login-seg button { flex: 1; }
.link-btn { border: 0; background: none; color: var(--brand); padding: 4px 0; cursor: pointer; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-name { display: flex; flex-direction: column; line-height: 1.15; text-align: right; font-size: 13px; }
.user-name small { color: var(--muted); font-size: 11.5px; }
body.reader-link .work-pick { visibility: hidden; }
.menu-btn span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.brand > span { border-left: 1px solid var(--line); padding-left: 10px; }
.saved { font-size: 13px; font-weight: 600; color: var(--ok); background: var(--ok-bg); padding: 5px 10px; border-radius: 20px; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; pointer-events: none; white-space: nowrap; }
.saved.show { opacity: 1; transform: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { font-weight: 400; color: var(--muted); font-size: 12px; }
.work-pick { flex: 1; display: flex; gap: 8px; min-width: 0; }
.work-pick select { max-width: 380px; width: 100%; font-weight: 600; }
.top-tools { display: flex; gap: 8px; align-items: center; }
.tabs { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--brand); border-color: var(--brand); }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: #0B4BB7; border-color: #0B4BB7; color: #fff; }
.btn.primary:hover { background: #093f9b; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; }
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 14px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--brand); color: #fff; }

/* ===== Forms ===== */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.field > input, .field > select, .field > textarea { color: var(--ink); font-size: 15px; }
.grid-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.grid-form .span-2 { grid-column: span 2; }
.teams-pick { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
.teams-pick legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches i { display: block; width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; }
.swatches input:checked + i { border-color: var(--ink); }
.swatches input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ===== Badges, bars ===== */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.muted { background: var(--surface-3); color: var(--muted); }
.chip { display: inline-flex; align-items: center; font-size: 12.5px; background: var(--surface-3); border-radius: 20px; padding: 2px 9px; margin-right: 4px; }
.bar { position: relative; height: 8px; border-radius: 6px; background: var(--surface-3); overflow: visible; }
.bar > b { display: block; height: 100%; border-radius: 6px; background: var(--brand); }
.bar .expected { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .55; border-radius: 1px; }
.empty { padding: 18px; text-align: center; color: var(--muted); background: var(--surface-2); border-radius: 8px; font-size: 14px; }

/* ===== Painel ===== */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: linear-gradient(115deg, var(--surface) 40%, var(--surface-3)); }
.hero-pct { text-align: center; color: var(--muted); }
.ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring span { width: 76px; height: 76px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.kpi > small { color: var(--muted); font-size: 12.5px; }
.kpi > b { font-size: 22px; line-height: 1.2; }
.kpi > b .muted { font-size: 15px; font-weight: 500; }
.kpi > span { font-size: 13px; }
.kpi.clickable:hover { border-color: var(--brand); }
.team-progress { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.team-progress:last-child { border-bottom: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--line); border-radius: 6px; }
.list li:last-child { border-bottom: 0; }
.list li.clickable:hover { background: var(--surface-2); }
.list li .grow { display: flex; flex-direction: column; }
.list li small { color: var(--muted); }

/* ===== Tabelas ===== */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table .num { text-align: right; }
.table tfoot td { font-weight: 700; background: var(--surface-2); }
.table tr.row-bad td { background: color-mix(in srgb, var(--bad-bg) 60%, transparent); }
.table .actions { text-align: right; }
.crono { min-width: 980px; }
.crono tr.clickable:hover td { background: var(--surface-2); }
.crono tr.parent td { background: var(--surface-3); font-weight: 600; }
.crono tr.parent.clickable:hover td { background: color-mix(in srgb, var(--surface-3) 70%, var(--line)); }
.crono tr.child td.name { padding-left: 26px; }
.crono td.code { color: var(--muted); font-variant-numeric: tabular-nums; width: 48px; }
.crono td.name { min-width: 300px; }
.crono td.status-cell { min-width: 170px; }
.crono { min-width: 1150px; }
.crono .note-line { display: block; font-weight: 400; color: var(--muted); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crono .pct-cell { min-width: 110px; }
.crono .pct-cell small { color: var(--muted); }
.crono .icons { color: var(--muted); font-size: 13px; white-space: nowrap; }
.team-card { border-top: 4px solid var(--team); }
.team-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.summary { display: grid; grid-template-columns: 240px 1fr; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.summary dt, .summary dd { margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.summary dt { background: var(--surface-2); color: var(--brand); font-weight: 600; }
.summary dt:last-of-type, .summary dd:last-of-type { border-bottom: 0; }

/* ===== Tarefas e pendências ===== */
.grid-form .span-4 { grid-column: 1 / -1; }
.task-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.task-chip { font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 7px; border-radius: 12px; border: 1px solid #9aa0a8; background: transparent; color: #6b7078; filter: grayscale(1); white-space: nowrap; }
button.task-chip { cursor: pointer; }
button.task-chip:hover { border-color: var(--ink); color: var(--ink); }
.task-chip.done { filter: none; background: var(--c); border-color: var(--c); color: #fff; }
.task-chip.done::before { content: '✓ '; }
.tasks { list-style: none; padding: 0; margin: 0; }
.tasks li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-bottom: 1px solid var(--line); color: var(--muted); }
.tasks li.done { color: var(--ink); }
.task-check { width: 24px; height: 24px; border-radius: 6px; border: 2px solid #9aa0a8; background: transparent; color: #fff; display: grid; place-items: center; font-weight: 700; padding: 0; flex: none; }
button.task-check { cursor: pointer; }
.tasks li.done .task-check { background: var(--c); border-color: var(--c); }
.tasks .weight { font-variant-numeric: tabular-nums; font-weight: 600; }
.task-editor { display: flex; flex-direction: column; gap: 8px; }
.task-rows { display: flex; flex-direction: column; gap: 6px; }
.task-row { display: flex; gap: 8px; align-items: center; }
.t-weight-wrap { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.t-weight { width: 72px; text-align: right; }
.issue { display: block; color: var(--bad); font-weight: 600; margin-top: 4px; max-width: 240px; }
.issue-text { color: var(--bad); }
.issues-box { border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-bg); border-radius: 10px; padding: 4px 14px 12px; margin-bottom: 14px; }
.issues-box h3 { color: var(--bad); margin-top: 10px; }
.issues { list-style: none; padding: 0; margin: 0 0 8px; }
.issues li { display: flex; gap: 10px; align-items: center; padding: 6px 0; color: var(--bad); }
.issues small { color: var(--muted); font-weight: 400; }

/* ===== Gantt ===== */
.gantt { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.gantt-inner { position: relative; }
.g-row { display: grid; grid-template-columns: 260px 1fr; min-height: 30px; border-bottom: 1px solid var(--line); }
.g-row:last-child { border-bottom: 0; }
.g-label { padding: 6px 10px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0; background: var(--surface); z-index: 2; border-right: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }
.g-track { position: relative; overflow: hidden; }
.g-head { min-height: 28px; background: var(--surface-2); }
.g-head .g-label { background: var(--surface-2); }
.g-month { position: absolute; top: 0; bottom: 0; font-size: 11.5px; color: var(--muted); padding: 6px 4px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.g-team { background: var(--surface-2); }
.g-team .g-label { font-weight: 700; background: var(--surface-2); }
.g-parent .g-label { font-weight: 600; }
.g-child .g-label { padding-left: 24px; color: var(--muted); }
.g-row.clickable:hover .g-label { color: var(--brand); }
.g-code { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 26px; }
.g-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); z-index: 1; }
.g-bar { position: absolute; border-radius: 4px; min-width: 3px; }
.g-bar.plan { top: 7px; height: 16px; background: color-mix(in srgb, var(--c) 28%, transparent); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); }
.g-bar.plan.late { border: 1.5px dashed var(--bad); }
.g-bar.real { top: 12px; height: 6px; }
.g-child .g-bar.plan { top: 8px; height: 14px; }
.gantt.compact .g-row { grid-template-columns: 220px 1fr; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.lg.plan { background: color-mix(in srgb, var(--brand) 28%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 60%, transparent); }
.lg.real { background: var(--brand); height: 5px; }
.lg.late { border: 1.5px dashed var(--bad); }
.lg.today { width: 2px; height: 14px; background: var(--bad); }

/* ===== Dias parados ===== */
.kpis.small .kpi > b { font-size: 20px; }
.month-group h3 { margin-top: 18px; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); }
.month-group h3::first-letter { text-transform: uppercase; }
.blocks { list-style: none; margin: 0; padding: 0; }
.blocks li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.blocks li.weekend { opacity: .6; }
.blocks time { display: flex; flex-direction: column; width: 64px; line-height: 1.15; }
.blocks time small { color: var(--muted); }
.reason { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 6px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.reason.r-chuva { background: var(--info-bg); color: var(--info); }
.reason.r-feriado { background: var(--ok-bg); color: var(--ok); }
.reason.r-férias-coletivas { background: var(--warn-bg); color: var(--warn); }

/* ===== Fotos ===== */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.photo-grid figure { margin: 0; position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.photo-grid .thumb { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: var(--surface-3); cursor: zoom-in; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid figcaption { padding: 7px 9px; display: flex; flex-direction: column; font-size: 13px; }
.photo-grid figcaption b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-grid figcaption small { color: var(--muted); }
.photo-grid .del { position: absolute; top: 6px; right: 6px; background: rgba(0, 0, 0, .55); color: #fff; }
.photo-grid .del:hover { background: var(--bad); color: #fff; }
.upload { margin-bottom: 14px; }

/* ===== Diálogos ===== */
dialog { border: 0; border-radius: 14px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
dialog.wide { width: min(940px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(15, 21, 34, .5); }
#dlg-body, #confirm form { padding: 20px 22px; overflow-y: auto; max-height: calc(100vh - 40px); }
.dlg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0 0 16px; }
.facts div { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.notes { list-style: none; padding: 0; margin: 10px 0 0; }
.notes li { display: flex; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.notes time { color: var(--muted); font-size: 13px; width: 84px; flex: none; }

#lightbox { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; background: rgba(8, 12, 20, .94); border-radius: 0; display: none; place-items: center; }
#lightbox[open] { display: grid; }
#lb-img { max-width: calc(100vw - 120px); max-height: calc(100vh - 110px); object-fit: contain; border-radius: 6px; }
#lb-caption { position: fixed; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; display: flex; flex-direction: column; gap: 2px; padding: 0 16px; }
#lb-caption span { color: #b8c2d6; font-size: 13px; }
.lb-btn { position: fixed; background: rgba(255, 255, 255, .12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 28px; cursor: pointer; }
.lb-btn:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ===== Toasts ===== */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #17223a; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); font-size: 14px; transition: opacity .3s, transform .3s; }
.toast.ok { border-left: 4px solid #8BE67D; }
.toast.bad { border-left: 4px solid #ff8a80; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ===== Responsivo ===== */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .top-inner { flex-wrap: wrap; gap: 8px; }
  .brand span { display: none; }
  .work-pick { order: 3; flex-basis: 100%; }
  .top-tools { margin-left: auto; }
  .logo { height: 30px; }
  .menu-btn { display: flex; }
  /* Menu de telas vira lista suspensa aberta pelos 3 risquinhos. */
  .tabs { display: none; flex-direction: column; padding: 4px 12px 10px; gap: 0; border-top: 1px solid var(--line); }
  body.menu-open .tabs { display: flex; }
  .tabs button { text-align: left; border-bottom: 0; border-left: 3px solid transparent; padding: 12px 12px; border-radius: 0 6px 6px 0; }
  .tabs button.on { border-left-color: var(--brand); background: var(--surface-2); }
  .nav-works { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
  .nav-works small { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; padding: 6px 12px; }
  .saved { position: fixed; top: 10px; left: 50%; transform: translate(-50%, -4px); z-index: 50; }
  .saved.show { transform: translate(-50%, 0); }
  main { padding: 14px 12px 50px; }
  .card { padding: 14px; }
  .hero { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 21px; }
  .grid-form { grid-template-columns: minmax(0, 1fr); }
  .grid-form .span-2 { grid-column: auto; }
  .summary { grid-template-columns: 1fr; }
  .summary dt { border-bottom: 0; padding-bottom: 2px; }
  .summary dd { padding-top: 2px; }
  .g-row, .gantt.compact .g-row { grid-template-columns: 150px 1fr; }
  .team-head { flex-direction: column; }
  #lb-img { max-width: 100vw; }
  .lb-prev, .lb-next { top: auto; bottom: 70px; transform: none; }
}
