:root {
  --bg: #cfcdc5; --card: #e8e5dd; --card-2: #dedbd2; --line: #d2cec3;
  --ink: #1f1f17; --muted: #8a887d; --olive: #6b6b38; --olive-2: #a3a85a; --brown: #a08470;
  --strong: #26261b; --on-strong: #e8e5dd; --danger: #a5523f; --ok: #6d7c3a;
  --num: linear-gradient(180deg, #8c8c55, #4f4f28);
  --e-descoberta: #a08470; --e-definicao: #858a55; --e-design: #a3a85a; --e-ajustes: #c4a55e; --e-delivery: #2c2c20;
  --radius: 3px; --font: "neue-haas-grotesk-text", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121211; --card: #1b1b19; --card-2: #23231f; --line: #2d2d28;
  --ink: #e2e5dc; --muted: #8b8e84; --olive: #c5ccc1; --olive-2: #b3ba6c; --brown: #b0947f;
  --strong: #c5ccc1; --on-strong: #121211; --danger: #d0806b; --ok: #b3ba6c;
  --num: linear-gradient(180deg, #dde3d8, #9aa08e);
  --e-delivery: #c5ccc1;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* layout */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { padding: 28px 20px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.logo { color: var(--strong); width: 150px; display: block; }
.logo svg { width: 100%; height: auto; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { text-decoration: none; padding: 9px 12px; border-radius: var(--radius); color: var(--muted); font-size: 13px; letter-spacing: .02em; display: flex; justify-content: space-between; }
.nav a:hover { color: var(--ink); }
.nav a.on { background: var(--card); color: var(--ink); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.main { padding: 28px 32px 60px; min-width: 0; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.top h1 { font-size: 34px; font-weight: 400; margin: 0; letter-spacing: -.02em; }
.top .sub { color: var(--muted); margin-top: 4px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid.two { grid-template-columns: 2fr 1fr; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.tall { min-height: 250px; display: flex; flex-direction: column; }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
.card-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.link { color: var(--muted); font-size: 13px; text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; }
.link:hover { color: var(--ink); }
.big { font-size: 64px; line-height: 1; letter-spacing: -.04em; background: var(--num); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 400; }
.big small { font-size: 22px; letter-spacing: 0; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px var(--card-2); }
.bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--olive-2); border-radius: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--card-2); color: var(--ink); white-space: nowrap; }
.pill.late { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.pill.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.empty { color: var(--muted); padding: 20px 0; text-align: center; }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; padding: 10px 16px; border-radius: var(--radius); background: var(--strong); color: var(--on-strong); font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn.line { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid currentColor; }
.btn:hover { filter: brightness(1.08); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
input, select, textarea { background: var(--card-2); border: 1px solid transparent; border-radius: var(--radius); padding: 10px 12px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--olive-2); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--olive); padding: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

dialog { border: 0; border-radius: var(--radius); background: var(--card); color: var(--ink); padding: 24px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 10, 8, .45); }
dialog h2 { margin: 0 0 18px; font-weight: 400; font-size: 24px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: color-mix(in srgb, var(--card) 55%, transparent); border-radius: var(--radius); padding: 12px; min-height: 300px; }
.col-h { display: flex; justify-content: space-between; margin-bottom: 10px; }
.kcard { background: var(--card); border-radius: var(--radius); padding: 13px; margin-bottom: 8px; cursor: pointer; text-decoration: none; display: block; }
.kcard:hover { outline: 1px solid var(--olive-2); }
.kcard b { font-weight: 400; display: block; margin-bottom: 2px; }

/* stages */
.stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.stage { background: var(--card); border-radius: var(--radius); padding: 16px; border-top: 3px solid var(--line); }
.stage.ativa { border-top-color: var(--olive-2); }
.stage.concluida { border-top-color: var(--strong); }
.stage h3 { margin: 0 0 2px; font-weight: 400; font-size: 20px; }
.check { display: flex; gap: 9px; align-items: flex-start; padding: 6px 0; cursor: pointer; font-size: 13px; }
.check input { margin-top: 2px; flex: none; }
.check.ok span { color: var(--muted); text-decoration: line-through; }

/* tabs */
.tabs { display: inline-flex; background: var(--card); border-radius: var(--radius); padding: 3px; }
.tabs button { border: 0; background: none; padding: 7px 14px; border-radius: var(--radius); cursor: pointer; color: var(--muted); font-size: 13px; }
.tabs button.on { background: var(--strong); color: var(--on-strong); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.cal .dow { background: var(--card-2); padding: 8px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.cal .day { background: var(--card); min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day.out { opacity: .4; }
.cal .day.today .n { background: var(--strong); color: var(--on-strong); border-radius: 99px; padding: 0 7px; }
.cal .n { font-size: 12px; align-self: flex-start; margin-bottom: 2px; }
.chip { font-size: 11px; padding: 2px 6px; border-radius: 2px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; display: block; }
.chip.meet { background: transparent !important; color: var(--ink); border: 1px dashed var(--muted); }

/* gantt */
.gantt { overflow-x: auto; }
.g-grid { display: grid; position: relative; min-width: 900px; }
.g-head { font-size: 11px; color: var(--muted); padding: 4px 0 8px; border-left: 1px solid var(--line); padding-left: 4px; white-space: nowrap; }
.g-name { padding: 10px 12px 10px 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0; background: var(--card); z-index: 2; text-decoration: none; }
.g-track { position: relative; height: 40px; border-top: 1px solid var(--line); }
.g-seg { position: absolute; top: 10px; height: 20px; border-radius: 2px; font-size: 10px; color: #fff; padding: 3px 6px; overflow: hidden; white-space: nowrap; }
.g-seg.pendente { opacity: .45; }
.g-seg.late { box-shadow: inset 0 0 0 2px var(--danger); }
.g-today { position: absolute; top: 0; bottom: 0; width: 1px; border-left: 1px dashed var(--ink); z-index: 1; pointer-events: none; }
.g-today i { position: absolute; top: -2px; left: -18px; font-style: normal; font-size: 10px; background: var(--strong); color: var(--on-strong); padding: 1px 6px; border-radius: 99px; }
:root[data-theme="dark"] [style*="e-delivery"] { color: #121211; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 10px; }
td { padding: 12px 10px; border-top: 1px solid var(--line); }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--card-2); }

.mob-top { display: none; }

/* portal: cronograma com etapa atual em destaque */
.p-etapa { opacity: .5; }
.p-etapa .p-nome { font-size: 17px; }
.p-etapa.ativa { opacity: 1; background: var(--card-2); border-radius: var(--radius); border-top-color: transparent; padding: 18px 16px; margin: 6px -16px; box-shadow: inset 3px 0 0 var(--cor); }
.p-etapa.ativa + .row { border-top-color: transparent; }
.p-etapa.ativa .p-nome { font-size: 26px; letter-spacing: -.02em; }
.p-etapa.ativa .dot { width: 11px; height: 11px; margin-top: 12px !important; }

@media (max-width: 1000px) {
  .grid, .grid.two { grid-template-columns: 1fr 1fr; }
  .span2 { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 14px 16px; gap: 12px; }
  .side .logo { width: 110px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .side-foot { flex-direction: row; margin: 0; }
  .main { padding: 8px 16px 40px; }
  .grid, .grid.two, .cols { grid-template-columns: 1fr; }
  .big { font-size: 52px; }
  .cal .day { min-height: 64px; } .cal .chip { font-size: 0; height: 5px; padding: 0; }
  .hide-m { display: none; }
}
