/* ============================================================
   Camelo & Costa — Gestão de Obras e Comercial
   Design system compartilhado · v2 "clean" (ver brand-spec.md)
   Refresh: raios generosos, sombras difusas, bordas suaves,
   tabelas leves, sidebar navy refinada, componentes de drawer.
   ============================================================ */
:root {
  --bg:      oklch(0.977 0.003 190);
  --surface: oklch(0.995 0.002 190);
  --fg:      oklch(0.22 0.025 235);
  --muted:   oklch(0.52 0.018 225);
  --border:  oklch(0.915 0.007 200);
  --border-soft: oklch(0.945 0.005 200);
  --accent:  oklch(0.47 0.09 183);
  --accent-deep: oklch(0.38 0.08 185);
  --accent-soft: oklch(0.95 0.018 183);
  --sidebar: oklch(0.20 0.03 235);
  --sidebar-ink: oklch(0.93 0.005 210);
  --success: oklch(0.55 0.13 155);
  --success-soft: oklch(0.95 0.035 155);
  --warn: oklch(0.70 0.14 75);
  --warn-soft: oklch(0.965 0.045 85);
  --danger: oklch(0.54 0.19 25);
  --danger-soft: oklch(0.955 0.025 25);
  --s-vendas: #00795B;
  --s-reservas: #C4913F;
  --font-display: "Archivo", "Barlow Semi Condensed", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px oklch(0.22 0.025 235 / .03), 0 6px 20px oklch(0.22 0.025 235 / .05);
  --shadow-2: 0 4px 12px oklch(0.22 0.025 235 / .06), 0 16px 40px oklch(0.22 0.025 235 / .10);
  --shadow-pop: 0 24px 80px oklch(0.20 0.03 235 / .25);
  --elev-btn: 0 6px 16px oklch(0.47 0.09 183 / .30);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px; line-height: 1.55;
  color: var(--fg); background: var(--bg);
  display: grid; grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, .display { font-family: var(--font-display); }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.2; }
h2 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.005em; }
h3 { font-size: 15px; font-weight: 600; }
.eyebrow {
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted);
}
.num { font-variant-numeric: tabular-nums; }
small, .small { font-size: 13px; letter-spacing: 0.01em; }
.muted { color: var(--muted); }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--sidebar); color: var(--sidebar-ink);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 22px 20px 18px;
}
.brand svg { flex: none; }
.brand-name {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  letter-spacing: 0.02em; line-height: 1.15; color: #fff;
}
.brand-name span {
  display: block; font-weight: 500; font-size: 9px;
  letter-spacing: 0.18em; color: oklch(0.68 0.035 195); margin-top: 3px;
}
.side-nav { flex: 1; padding: 6px 12px 20px; }
.nav-group { margin-bottom: 22px; }
.nav-group > .eyebrow { color: oklch(0.58 0.02 225); padding: 0 12px 7px; display: block; font-size: 10px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; letter-spacing: 0.01em;
  color: oklch(0.78 0.012 220); text-decoration: none;
  margin-bottom: 2px; min-height: 38px;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-item svg { flex: none; opacity: .7; }
.nav-item:hover { background: oklch(1 0 0 / .07); color: #fff; }
.nav-item.active {
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 18px oklch(0.47 0.09 183 / .40);
}
.nav-item.active svg { opacity: 1; }
.side-foot {
  border-top: 1px solid oklch(1 0 0 / .07);
  padding: 16px 20px; display: flex; align-items: center; gap: 11px;
}
.side-foot .avatar { background: var(--accent); color: #fff; }
.side-foot b { display: block; font-size: 13px; color: #fff; font-weight: 600; }
.side-foot small { color: oklch(0.62 0.02 220); font-size: 11.5px; letter-spacing: 0.02em; }

/* ---------- Main / topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 32px;
  background: color-mix(in oklab, oklch(0.995 0.002 190) 82%, transparent);
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; z-index: 40;
}
.topbar .crumb { font-size: 12.5px; color: var(--muted); letter-spacing: 0.01em; }
.topbar .crumb b { color: var(--fg); font-weight: 600; }
.topbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: oklch(0.958 0.004 195); border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 14px; width: 300px; color: var(--muted); font-size: 13px;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.search:focus-within { background: var(--surface); border-color: var(--accent); }
.search input { border: none; background: none; outline: none; width: 100%; font-size: 13px; }
.search kbd {
  font-family: var(--font-body); font-size: 10.5px; letter-spacing: 0.02em;
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px;
  color: var(--muted); background: var(--surface);
}
.content { padding: 28px 32px 56px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 200px; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 8px 16px;
  border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13.5px; font-weight: 500; letter-spacing: 0.02em;
  text-decoration: none; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { border-color: oklch(0.84 0.015 205); background: oklch(0.985 0.003 190); }
.btn-primary {
  background: var(--accent); border-color: transparent; color: #fff;
  box-shadow: var(--elev-btn);
}
.btn-primary:hover { background: var(--accent-deep); box-shadow: 0 8px 20px oklch(0.47 0.09 183 / .36); }
.btn-ghost { border-color: transparent; box-shadow: none; background: none; color: var(--muted); }
.btn-ghost:hover { background: oklch(0.22 0.025 235 / .05); color: var(--fg); border-color: transparent; }
.btn-sm { min-height: 31px; padding: 4px 12px; font-size: 12.5px; border-radius: 9px; }
.btn:active { transform: translateY(1px); }

/* ---------- Cards / KPIs ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border-soft);
}
.card-head .spacer { flex: 1; }
.card-body { padding: 18px 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 18px 20px; }
.kpi .eyebrow { display: block; margin-bottom: 9px; }
.kpi .val {
  font-family: var(--font-display); font-size: 30px; font-weight: 700;
  letter-spacing: -0.015em; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.kpi .delta { font-size: 12.5px; margin-top: 6px; letter-spacing: 0.01em; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }

/* ---------- Badges & status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  padding: 2.5px 9px; border-radius: 999px; white-space: nowrap;
}
.badge svg { flex: none; }
.b-ok      { background: var(--success-soft); color: oklch(0.40 0.11 155); }
.b-warn    { background: var(--warn-soft);    color: oklch(0.50 0.12 70); }
.b-late    { background: var(--danger-soft);  color: oklch(0.44 0.17 25); }
.b-info    { background: var(--accent-soft);  color: var(--accent-deep); }
.b-neutral { background: oklch(0.95 0.004 210); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: var(--success); } .dot.warn { background: var(--warn); }
.dot.late { background: var(--danger); } .dot.info { background: var(--accent); }

/* ---------- Avatares ---------- */
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  background: oklch(0.91 0.015 220); color: var(--fg);
}
.avatar.sm { width: 24px; height: 24px; font-size: 9.5px; }

/* ---------- Tabelas ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-family: var(--font-display); font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
  padding: 12px 16px; border-bottom: 1px solid var(--border-soft); white-space: nowrap;
}
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s var(--ease); }
.tbl tbody tr:hover { background: oklch(0.972 0.003 190); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td b { font-weight: 600; }

/* ---------- Progress ---------- */
.prog {
  height: 6px; border-radius: 999px; background: oklch(0.93 0.004 210);
  overflow: hidden; min-width: 60px;
}
.prog > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.prog.ok > span { background: var(--success); }
.prog.late > span { background: var(--danger); }

/* ---------- Kanban ---------- */
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: 276px;
  gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: start;
}
.kcol { background: oklch(0.958 0.005 195); border-radius: var(--radius); }
.kcol-head {
  display: flex; align-items: center; gap: 8px; padding: 13px 16px 9px;
}
.kcol-head h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: oklch(0.42 0.02 230); }
.kcol-head .count {
  margin-left: auto; font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--surface);
  border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px oklch(0.22 0.025 235 / .05);
}
.kcol-body { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 9px; min-height: 60px; }
.kcard {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 13px 14px; box-shadow: 0 1px 2px oklch(0.22 0.025 235 / .04);
  cursor: pointer; display: block; text-decoration: none;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.kcard:hover { transform: translateY(-2px); border-color: var(--border); box-shadow: var(--shadow-2); }
.kcard h4 { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.kcard .meta { font-size: 12px; color: var(--muted); margin-top: 3px; letter-spacing: 0.01em; }
.kcard .foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.kempty {
  border: 1.5px dashed var(--border); border-radius: 12px;
  padding: 14px 10px; text-align: center; font-size: 12px; color: var(--muted);
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-soft); overflow-x: auto; }
.tab {
  padding: 9px 14px; font-size: 13.5px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
  transition: color .15s var(--ease);
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent-deep); border-bottom-color: var(--accent); font-weight: 600; }
.seg {
  display: inline-flex; background: oklch(0.945 0.005 200);
  border-radius: 12px; padding: 3px; gap: 2px;
}
.seg button, .seg a {
  padding: 5px 14px; border-radius: 9px; font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.02em; color: var(--muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; min-height: 29px;
  transition: color .15s var(--ease);
}
.seg .active { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px oklch(0.22 0.025 235 / .10); font-weight: 600; }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; }
.field .hint { font-size: 11.5px; color: var(--muted); letter-spacing: 0.01em; }
.input, .field input, .field select, .field textarea {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font-size: 13.5px; background: var(--surface);
  outline: none; min-height: 38px; width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px oklch(0.47 0.09 183 / .14);
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- Checklist / task rows ---------- */
.task-row {
  display: grid; grid-template-columns: 26px minmax(0,1fr) 150px 108px 108px 110px 30px;
  gap: 10px; align-items: center; padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft); font-size: 13px;
  transition: background .12s var(--ease);
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: oklch(0.972 0.003 190); }
.task-row.locked { opacity: .58; }
.task-row .t-name { font-weight: 500; display: flex; align-items: center; gap: 7px; min-width: 0; }
.task-row .t-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .t-date { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.check {
  width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; background: var(--surface);
  font-size: 11px;
}
.check.done { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Mapa de disponibilidade ---------- */
.quadra { padding: 16px 18px; }
.quadra h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.lots { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.lot {
  aspect-ratio: 1; border-radius: 12px; border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  cursor: pointer; letter-spacing: 0.01em;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.lot.disp { background: var(--success-soft); color: oklch(0.38 0.10 155); border-color: oklch(0.86 0.05 155); }
.lot.resv { background: var(--warn-soft); color: oklch(0.46 0.11 70); border-color: oklch(0.88 0.06 85); }
.lot.vend { background: var(--danger-soft); color: oklch(0.42 0.15 25); border-color: oklch(0.89 0.04 25); }
.lot:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.map-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ---------- Gráficos ---------- */
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); letter-spacing: 0.01em; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 18px; }
.bar-g { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar {
  width: 100%; max-width: 34px; background: var(--s-vendas);
  border-radius: 5px 5px 0 0; position: relative; min-height: 4px;
  transition: filter .12s var(--ease);
}
.bar:hover { filter: brightness(1.12); }
.bar .blabel {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums;
}
.bar-g .x { font-size: 11px; color: var(--muted); letter-spacing: 0.01em; }
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: var(--fg); color: #fff; font-size: 11.5px; font-weight: 500;
  padding: 6px 10px; border-radius: 9px; white-space: pre; z-index: 60;
  box-shadow: var(--shadow-2); pointer-events: none; letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Gantt ---------- */
.gantt { font-size: 12.5px; }
.g-row {
  display: grid; grid-template-columns: 210px minmax(0,1fr);
  border-bottom: 1px solid var(--border-soft); align-items: center;
}
.g-row:last-child { border-bottom: none; }
.g-label { padding: 9px 16px; display: flex; align-items: center; gap: 7px; min-width: 0; }
.g-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.g-track { position: relative; height: 34px; background:
  repeating-linear-gradient(to right, transparent 0, transparent calc(100%/6 - 1px), var(--border-soft) calc(100%/6 - 1px), var(--border-soft) calc(100%/6)); }
.g-bar {
  position: absolute; top: 8px; height: 18px; border-radius: 999px;
  background: var(--accent); opacity: .92; min-width: 8px;
}
.g-bar.done { background: var(--success); }
.g-bar.late { background: var(--danger); }
.g-bar.locked { background: oklch(0.87 0.008 220); border: 1px dashed var(--muted); }
.g-head { display: grid; grid-template-columns: 210px minmax(0,1fr); border-bottom: 1px solid var(--border-soft); }
.g-months { display: grid; grid-template-columns: repeat(6, 1fr); font-size: 11px; color: var(--muted); }
.g-months span { padding: 7px 8px; border-left: 1px solid var(--border-soft); letter-spacing: 0.02em; }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); opacity: .5; z-index: 2; }

/* ---------- Calendário ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--border-soft); border-left: 1px solid var(--border-soft); }
.cal .dow {
  font-family: var(--font-display); font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); padding: 8px 10px;
  border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); background: oklch(0.97 0.003 190);
}
.cal .day {
  min-height: 86px; padding: 6px 8px; border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft); font-size: 12px;
}
.cal .day .d { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal .day.off { background: oklch(0.97 0.003 190); }
.cal .day.today { background: var(--accent-soft); }
.cal .day.today .d { color: var(--accent-deep); font-weight: 700; }
.ev {
  display: block; font-size: 10.5px; font-weight: 500; letter-spacing: 0.01em;
  border-radius: 6px; padding: 2px 7px; margin-top: 4px;
  background: oklch(0.94 0.008 210); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ev.late { background: var(--danger-soft); color: oklch(0.44 0.17 25); }
.ev.ok { background: var(--success-soft); color: oklch(0.40 0.11 155); }
.ev.info { background: var(--accent-soft); color: var(--accent-deep); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: oklch(0.20 0.03 235 / .42);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-pop);
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border-soft); }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border-soft); }

/* ---------- Timeline ---------- */
.tl { list-style: none; position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border-soft); }
.tl li { position: relative; padding: 0 0 16px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before {
  content: ""; position: absolute; left: -21px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.tl li.pending::before { border-color: var(--border); }
.tl .tl-date { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.tl b { font-weight: 600; font-size: 13.5px; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 72%; padding: 11px 15px; border-radius: 16px; font-size: 13.5px; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border-soft); border-bottom-left-radius: 6px; box-shadow: var(--shadow-1); }
.msg.bot .tbl { font-size: 12.5px; margin-top: 8px; }
.msg.bot .tbl th, .msg.bot .tbl td { padding: 6px 10px; }

/* ---------- Drawer (detalhe sobre kanban) ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: oklch(0.20 0.03 235 / .40);
  z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity .22s var(--ease);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 12px; right: 12px; bottom: 12px;
  width: min(600px, calc(100vw - 24px));
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-pop);
  z-index: 95; display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(calc(100% + 32px));
  transition: transform .28s var(--ease);
}
.drawer.open { transform: none; }
.drawer-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 8px; }
.drawer-head .top { display: flex; align-items: center; gap: 8px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 28px; display: flex; flex-direction: column; gap: 24px; }
.drawer-sec { display: flex; flex-direction: column; gap: 10px; }
.drawer-sec > .eyebrow { display: block; }
.rings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ring-card {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--border-soft); border-radius: 14px;
}
.ring-card b { font-size: 13px; font-weight: 600; display: block; }
.ring-card small { color: var(--muted); font-size: 11.5px; }
.ring {
  width: 44px; aspect-ratio: 1; border-radius: 50%; flex: none;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), oklch(0.93 0.004 210) 0);
  font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; }
.ring.full { background: conic-gradient(var(--success) 100%, var(--success) 0); }
.clg { border: 1px solid var(--border-soft); border-radius: 14px; overflow: hidden; }
.clg summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 13.5px;
  font-family: var(--font-display);
}
.clg summary::-webkit-details-marker { display: none; }
.clg summary .chev { margin-left: auto; transition: transform .18s var(--ease); color: var(--muted); }
.clg[open] summary .chev { transform: rotate(90deg); }
.clg summary .prog { width: 70px; min-width: 70px; }
.clg summary .pct { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.subtask {
  display: grid; grid-template-columns: 22px minmax(0,1fr) auto 14px;
  gap: 10px; align-items: center; padding: 10px 16px;
  border-top: 1px solid var(--border-soft); cursor: pointer; font-size: 13px;
  transition: background .12s var(--ease);
}
.subtask:hover { background: oklch(0.972 0.003 190); }
.subtask .st-name { font-weight: 500; display: flex; align-items: center; gap: 7px; min-width: 0; }
.subtask .st-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtask .chev { color: var(--muted); }
.subtask .cmt-count { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment .bubble {
  background: oklch(0.968 0.003 190); border-radius: 4px 14px 14px 14px;
  padding: 10px 13px; font-size: 13px; flex: 1; min-width: 0;
}
.comment .bubble .who { font-size: 12px; margin-bottom: 2px; }
.comment .bubble .who b { font-weight: 600; }
.comment .bubble .who small { color: var(--muted); margin-left: 6px; font-size: 11px; }
.comment-form { display: flex; gap: 8px; align-items: center; padding-top: 4px; }
.comment-form input { flex: 1; }
.doc-line {
  display: flex; align-items: center; gap: 11px; padding: 10px 2px;
  border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
.doc-line:last-child { border-bottom: none; }
.doc-line .ic {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft);
  color: var(--accent-deep); display: inline-flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; flex: none;
}
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.meta-grid .eyebrow { display: block; margin-bottom: 3px; }
.meta-grid b { font-size: 13.5px; font-weight: 600; }

/* ---------- Util ---------- */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar select { border: 1px solid var(--border); border-radius: 10px; padding: 6px 11px; font-size: 12.5px; background: var(--surface); min-height: 34px; }
.divider { height: 1px; background: var(--border-soft); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border-soft); background: var(--surface);
  border-radius: 999px; padding: 3.5px 11px; letter-spacing: 0.01em;
}
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .side-nav { display: flex; overflow-x: auto; padding: 8px 12px; gap: 4px; }
  .nav-group { margin: 0; display: flex; gap: 4px; }
  .nav-group > .eyebrow { display: none; }
  .nav-item { white-space: nowrap; }
  .side-foot { display: none; }
  .kpis, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split, .grid-2, .form-grid { grid-template-columns: 1fr; }
  .search { display: none; }
  .content { padding: 16px 14px 44px; }
  .task-row { grid-template-columns: 26px minmax(0,1fr) 92px; }
  .task-row .t-resp, .task-row .t-date, .task-row .t-clip { display: none; }
  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 10px 14px; }
  .rings { grid-template-columns: 1fr; }
}
