/* ============================================================
   Kanban Equipe BI — estilos
   ============================================================ */
:root {
  --bg: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #eef2f7;
  --border: #e2e8f0;
  --border-2: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --header: #0b1220;
  --header-2: #16213a;
  --accent: #e11d48;
  --accent-2: #be123c;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 18px rgba(15, 23, 42, .06);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, .22);
  --radius: 14px;
  --radius-sm: 10px;

  --urgente: #dc2626;
  --standby: #64748b;
  --pendente: #d97706;
  --dev: #2563eb;
  --feito: #16a34a;
  --alta: #dc2626;
  --media: #d97706;
  --baixa: #16a34a;
}
:root[data-theme="dark"] {
  --bg: #070c18;
  --surface: #101a2e;
  --surface-2: #0c1426;
  --surface-3: #16223a;
  --border: #1e2b45;
  --border-2: #2c3b5a;
  --text: #e5ebf5;
  --text-2: #9fb0c8;
  --muted: #64748b;
  --header: #050912;
  --header-2: #0e172b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .55);
  --urgente: #f05252;
  --standby: #8b9bb4;
  --pendente: #f0a020;
  --dev: #4f8dfd;
  --feito: #2fbf62;
  --alta: #f05252;
  --media: #f0a020;
  --baixa: #2fbf62;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.i {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.muted { color: var(--muted); font-weight: 500; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid transparent; background: var(--surface-3);
  font-weight: 600; white-space: nowrap; transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #f43f5e, var(--accent)); color: #fff; box-shadow: 0 6px 16px rgba(225, 29, 72, .3); }
.btn-primary:hover { background: linear-gradient(180deg, #e11d48, var(--accent-2)); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-soft { background: color-mix(in srgb, var(--dev) 12%, transparent); color: var(--dev); }
.btn-soft:hover { background: color-mix(in srgb, var(--dev) 20%, transparent); }
.btn-danger-ghost { background: transparent; color: var(--urgente); }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--urgente) 10%, transparent); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-sm .i { width: 15px; height: 15px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 0; background: transparent; color: inherit;
}
.icon-btn:hover { background: rgba(148, 163, 184, .16); }

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; flex-wrap: nowrap; gap: 10px;
  padding: 8px 16px;
  background: radial-gradient(1200px 200px at 10% -50%, #24345a 0%, transparent 60%), linear-gradient(90deg, var(--header), var(--header-2));
  color: #e8eefb;
  box-shadow: 0 2px 12px rgba(2, 6, 23, .25);
}
.drawer-btn { position: relative; flex: none; }
.drawer-badge {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  display: grid; place-items: center; font-size: 10.5px; font-weight: 800; background: var(--accent); color: #fff;
  box-shadow: 0 0 0 2px var(--header);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.brand-icon { display: block; height: 34px; width: auto; flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.brand-text { display: flex; flex-direction: column; align-items: stretch; line-height: 1; }
.brand-text h1 { margin: 0; font: 800 21px/1 "Poppins", "Inter", sans-serif; letter-spacing: -.01em; color: #fff; white-space: nowrap; }
.brand-text p { display: flex; align-items: center; gap: 5px; margin: 3px 0 0; font: 600 10.5px/1 "Poppins", "Inter", sans-serif; color: #a8b6d3; white-space: nowrap; letter-spacing: .02em; }
.brand-text p::before, .brand-text p::after { content: ""; flex: 1; min-width: 8px; height: 1.5px; border-radius: 2px; background: #5b6b8c; }
.drawer-logo { height: 26px; width: auto; }

.search {
  flex: 1 1 200px; min-width: 150px; max-width: 340px;
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px;
  border-radius: 10px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
  transition: background .15s, border-color .15s;
}
.search:focus-within { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); }
.search .i { color: #a8b6d3; width: 17px; height: 17px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 13.5px; }
.search input::placeholder { color: #8795b2; }
.search kbd {
  font: 600 11px/1 "Inter", sans-serif; color: #a8b6d3; padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px;
}
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.header-actions .btn-primary { height: 38px; }

/* Filtros no cabeçalho */
.hfilters { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.hfilters::-webkit-scrollbar { display: none; }
.hfilters > * { flex: none; }
.filter-people { display: flex; align-items: center; gap: 4px; padding-right: 6px; margin-right: 2px; border-right: 1px solid rgba(255, 255, 255, .12); }
.pchip {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; transition: transform .15s;
}
.pchip:hover { transform: translateY(-1px); }
.pchip .avatar { --s: 34px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .15); opacity: .8; transition: box-shadow .15s, opacity .15s, filter .15s; }
.pchip:hover .avatar { opacity: 1; }
.filter-people.has-sel .pchip:not(.on) .avatar { opacity: .45; filter: grayscale(.7); }
.pchip.on .avatar { opacity: 1; filter: none; box-shadow: 0 0 0 2px var(--header), 0 0 0 4px var(--pc); }
.pchip .count {
  position: absolute; right: -1px; bottom: -1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; background: var(--pc);
  box-shadow: 0 0 0 2px var(--header);
}
.pchip.all {
  width: auto; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  color: #cbd5e1; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
}
.pchip.all.on { background: #fff; color: var(--header); border-color: #fff; }
.select {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 2px 0 9px;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 9px; background: rgba(255, 255, 255, .06); color: #a8b6d3;
  transition: border-color .15s, background .15s;
}
.select:hover { background: rgba(255, 255, 255, .1); }
.select.active { border-color: #60a5fa; background: rgba(96, 165, 250, .14); color: #bfdbfe; }
.select .i { width: 14px; height: 14px; }
.select select { border: 0; outline: 0; background: transparent; height: 100%; padding-right: 2px; font-size: 12.5px; font-weight: 600; color: #e8eefb; cursor: pointer; width: 92px; text-overflow: ellipsis; }
.select select option { background: #111a2e; color: #e8eefb; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: #a8b6d3; cursor: pointer; user-select: none; white-space: nowrap; }
.toggle { position: relative; }
.toggle input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toggle .track { width: 32px; height: 18px; border-radius: 999px; background: rgba(255, 255, 255, .2); position: relative; transition: background .15s; flex: none; }
.toggle .thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.toggle input:checked + .track { background: var(--feito); }
.toggle input:checked + .track .thumb { transform: translateX(14px); }
.toggle input:focus-visible + .track { outline: 2px solid #60a5fa; outline-offset: 2px; }
.clear-btn { width: 32px; height: 32px; color: #fda4af; }
.clear-btn .i { width: 16px; height: 16px; }

/* ---------- Layout ---------- */
.layout { display: flex; flex-direction: column; gap: 14px; padding: 14px 20px 20px; }

/* ---------- KPIs (sempre em uma linha) ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 12px; overflow-x: auto; scrollbar-width: none; }
.kpis::-webkit-scrollbar { display: none; }
.kpi {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 11px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.kpi::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 3px;
  background: var(--c); opacity: .85;
}
.kpi-ic {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c);
}
.kpi-ic .i { width: 19px; height: 19px; }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.kpi-value { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub b { color: var(--c); font-weight: 700; }
.ring { flex: none; width: 38px; height: 38px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: var(--surface-3); }
.ring .fg { stroke: var(--c); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }

/* ---------- Painel retrátil (esquerda) ---------- */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 70; width: min(360px, 90vw);
  display: flex; flex-direction: column; background: var(--bg); box-shadow: var(--shadow-lg);
  transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); visibility: hidden;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 20px; color: #e8eefb;
  background: linear-gradient(90deg, var(--header), var(--header-2));
}
.drawer-head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 800; }
.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.drawer-body > * { flex-shrink: 0; }
.drawer-body { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 65; background: rgba(2, 6, 23, .45); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* ---------- Avatar ---------- */
.avatar {
  position: relative; flex: none; width: var(--s, 32px); height: var(--s, 32px); border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--pc, #64748b); color: #fff; font-weight: 700; font-size: calc(var(--s, 32px) * .38);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.ring-on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--pc); }

/* ---------- Board ---------- */
.board-wrap {
  overflow: auto; max-height: calc(100vh - var(--hdr, 60px) - 30px); min-height: 360px;
  border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.board {
  display: grid;
  --pcol: 220px;
  grid-template-columns: var(--pcol) repeat(5, minmax(210px, 1fr));
  gap: 10px; padding: 0 10px 10px; min-width: min-content;
}
.bh {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 10px; margin-top: 8px;
  border-radius: 10px; font-weight: 700; font-size: 13.5px;
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--c);
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  box-shadow: 0 -8px 0 var(--surface-2), var(--shadow-sm);
}
.bh .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; flex: none; }
.bh .ic .i { width: 13px; height: 13px; }
.bh .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh .count {
  min-width: 24px; height: 20px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 18%, transparent); font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.bh .add { width: 24px; height: 24px; border-radius: 8px; border: 0; background: transparent; color: var(--c); display: grid; place-items: center; }
.bh .add:hover { background: color-mix(in srgb, var(--c) 18%, transparent); }
.bh.corner { left: 0; z-index: 7; background: var(--surface); color: var(--text); border-color: var(--border); }
.bh.corner .ic { background: var(--surface-3); color: var(--text-2); }

.person {
  position: sticky; left: 0; z-index: 4;
  display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 10px 0 0 var(--surface-2), var(--shadow-sm);
  overflow: hidden;
}
.person::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--pc); }
.person-top { display: flex; align-items: center; gap: 12px; }
.person .avatar { --s: 58px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--pc) 55%, transparent); }
.person .pname { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.person .prole { font-size: 12.5px; color: var(--text-2); line-height: 1.3; }
.person .order {
  position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 800; color: var(--muted);
}
.pstats { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-2); }
.pstats span { display: inline-flex; align-items: center; gap: 5px; }
.pstats .i { width: 14px; height: 14px; }
.pstats .late { color: var(--urgente); font-weight: 700; }
.pbar-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.progress { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--pc, var(--dev)); transition: width .4s ease; }
.progress.lg { height: 8px; }
.collapse-btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; margin-top: auto;
  border: 0; background: transparent; padding: 2px 0; font-size: 12px; font-weight: 600; color: var(--muted);
}
.collapse-btn:hover { color: var(--text); }
.collapse-btn .i { width: 14px; height: 14px; transition: transform .2s; }
.row-collapsed .collapse-btn .i { transform: rotate(-90deg); }

.cell, .bh, .person, .list, .card { min-width: 0; }
.cell {
  display: flex; flex-direction: column; min-height: 150px; padding: 8px;
  border-radius: 12px; background: color-mix(in srgb, var(--c) 4%, var(--surface-2));
  border: 1px dashed color-mix(in srgb, var(--c) 18%, var(--border));
  transition: background .15s, border-color .15s;
}
.row-collapsed.cell { min-height: 0; }
.is-dragging .cell { border-style: dashed; border-color: color-mix(in srgb, var(--c) 40%, var(--border)); }
.cell.drop-hover { background: color-mix(in srgb, var(--c) 12%, var(--surface-2)); border-color: var(--c); }
.list { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 48px; }
.list:empty::before {
  content: "Arraste tarefas aqui"; display: grid; place-items: center; flex: 1; min-height: 48px;
  font-size: 12px; color: var(--muted); opacity: .8;
}
.row-collapsed .list:empty::before { content: "—"; min-height: 28px; }
.cell-add {
  margin-top: 6px; height: 30px; border: 0; border-radius: 8px; background: transparent;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); opacity: 0; transition: opacity .15s, background .15s;
}
.row-collapsed.person {
  padding-top: 12px;
  padding-bottom: 10px;
  gap: 6px;
}
.row-collapsed.person .pstats,
.row-collapsed.person .pbar-row {
  display: none;
}
.row-collapsed.person .avatar { --s: 40px; }
.row-collapsed.person .collapse-btn {
  margin-top: auto;
  font-weight: 700;
  color: var(--dev);
}
.cell-add .i { width: 14px; height: 14px; }
.cell:hover .cell-add { opacity: 1; }
.cell-add:hover { background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
@media (hover: none) { .cell-add { opacity: 1; } }

/* ---------- Card ---------- */
.card {
  position: relative; padding: 11px 12px 10px 14px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  cursor: grab; transition: box-shadow .15s, transform .15s, border-color .15s;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--border-2); transform: translateY(-1px); }
.card::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--p);
}
.card.overdue { border-color: color-mix(in srgb, var(--urgente) 45%, var(--border)); }
.card-top { display: flex; align-items: flex-start; gap: 8px; }
.card-top .dot {
  flex: none; width: 12px; height: 12px; margin-top: 3px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent);
}
.card-title { flex: 1; min-width: 0; margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.card.done .card-title { color: var(--text-2); }
.card-menu {
  flex: none; width: 24px; height: 24px; margin: -3px -6px 0 0; border-radius: 6px; border: 0;
  background: transparent; color: var(--muted); display: grid; place-items: center; opacity: .6;
}
.card:hover .card-menu, .card-menu:focus-visible { opacity: 1; }
.card-menu:hover { background: var(--surface-3); color: var(--text); }
.card-menu .i { width: 16px; height: 16px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; padding-left: 20px; }
.badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  background: color-mix(in srgb, var(--b) 14%, transparent); color: var(--b);
}
.badge.tag { --b: var(--text-2); background: var(--surface-3); font-weight: 600; }
.card-next {
  margin: 8px 0 0 20px; font-size: 11.5px; color: var(--text-2);
  display: flex; gap: 5px; align-items: baseline; min-width: 0;
}
.card-next b { font-weight: 600; color: var(--muted); flex: none; }
.card-next span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-foot { display: flex; align-items: center; gap: 10px; margin-top: 9px; padding-left: 20px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.card-foot .i { width: 13px; height: 13px; }
.card-foot > span { display: inline-flex; align-items: center; gap: 4px; }
.due.today { color: var(--pendente); }
.due.late { color: var(--urgente); }
.due.ok-done { color: var(--feito); }
.steps-mini { flex: 1; display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.steps-mini .progress { max-width: 60px; height: 5px; }
.steps-mini .progress i { background: var(--dev); }
.steps-mini.full { color: var(--feito); }
.steps-mini.full .progress i { background: var(--feito); }

.compact .card { padding: 7px 10px 7px 12px; }
.compact .card-tags, .compact .card-next { display: none; }
.compact .card-foot { margin-top: 4px; }
.compact .card-title { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sortable */
.ghost { opacity: .45; border: 2px dashed var(--dev) !important; background: color-mix(in srgb, var(--dev) 8%, var(--surface)) !important; box-shadow: none !important; }
.ghost > * { visibility: hidden; }
.chosen { cursor: grabbing; }
.drag { transform: rotate(2deg) !important; box-shadow: var(--shadow-lg) !important; }

/* ---------- Sidebar ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; flex: 1; font-size: 14.5px; font-weight: 700; }
.panel-head .i { color: var(--text-2); }
.panel-head .pill {
  min-width: 24px; height: 22px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center;
  font-size: 12px; font-weight: 800; background: var(--urgente); color: #fff;
}
.panel-head .pill.zero { background: var(--surface-3); color: var(--muted); }
.panel.dark { background: linear-gradient(160deg, #0f1a33, #0b1220); color: #e5ebf5; border-color: #1c2a47; }
.panel.dark .panel-head { border-color: rgba(255, 255, 255, .08); }
.panel.dark .panel-head .i { color: #93a5c6; }
.panel-body { padding: 8px 16px 14px; }

.prod-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.prod-row:last-child { border-bottom: 0; }
.prod-row .avatar { --s: 38px; grid-row: span 2; }
.prod-name { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 13.5px; }
.prod-name small { font-weight: 600; color: var(--muted); font-size: 11.5px; }
.prod-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-2); }
.prod-meta .progress { height: 6px; }
.prod-meta b { font-variant-numeric: tabular-nums; }

.alert-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 8px; margin: 0 -8px;
  border: 0; background: transparent; border-radius: 10px; text-align: left;
  width: calc(100% + 16px);
}
.alert-item:hover { background: var(--surface-2); }
.alert-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.alert-ic .i { width: 16px; height: 16px; }
.alert-item strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.alert-item span { font-size: 12px; color: var(--text-2); }
.alert-item em { font-style: normal; color: var(--c); font-weight: 700; }
.empty-note { padding: 14px 0 6px; font-size: 13px; color: var(--muted); text-align: center; }

.hl-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.hl-row:last-child { border-bottom: 0; }
.hl-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); flex: none; }
.hl-val { font-size: 19px; font-weight: 800; color: var(--c); line-height: 1.1; }
.hl-lbl { font-size: 12px; color: #a8b6d3; }

.motto {
  display: flex; align-items: center; gap: 14px; padding: 18px;
  background: linear-gradient(135deg, #1e1b4b, #0b1220 70%); color: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.motto .i { width: 28px; height: 28px; color: #fb7185; }
.motto p { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.3; }
.motto small { display: block; color: #a8b6d3; font-weight: 500; font-size: 12px; margin-top: 2px; }

/* ---------- Dialog ---------- */
.dialog {
  width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0;
  border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(2, 6, 23, .55); backdrop-filter: blur(3px); }
.dialog[open] { animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px 24px; border-bottom: 1px solid var(--border); }
.dlg-crumb { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); font-weight: 600; min-width: 0; }
.dlg-crumb .avatar { --s: 24px; }
.dlg-crumb .badge { height: 22px; }
.dlg-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; overflow-y: auto; overflow-x: hidden; }
.dlg-main { padding: 18px 24px 22px; min-width: 0; }
.dlg-side { padding: 18px 20px 22px; background: var(--surface-2); border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px; }
.title-input {
  width: 100%; border: 0; outline: 0; background: transparent; padding: 4px 0;
  font-size: 22px; font-weight: 800; letter-spacing: -.01em;
}
.title-input.invalid { box-shadow: inset 0 -2px 0 var(--urgente); }
.desc-input {
  width: 100%; margin-top: 8px; padding: 10px 12px; border-radius: 10px; resize: vertical;
  border: 1px solid var(--border); background: var(--surface-2); outline: 0; line-height: 1.5;
}
.desc-input:focus, .step-add input:focus, .field input:focus { border-color: var(--dev); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dev) 18%, transparent); }
.steps-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 8px; }
.dlg-main h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14.5px; font-weight: 700; }
.dlg-main h3 .i { color: var(--text-2); }
.steps-pct { font-size: 13px; font-weight: 800; color: var(--dev); }
.steps-pct.full { color: var(--feito); }
#stepsBar { background: var(--dev); }
#stepsBar.full { background: var(--feito); }
.steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.step {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px;
  border: 1px solid transparent; transition: background .12s;
}
.step:hover { background: var(--surface-2); border-color: var(--border); }
.step .grip { color: var(--muted); cursor: grab; display: grid; opacity: .5; }
.step:hover .grip { opacity: 1; }
.step .grip .i { width: 15px; height: 15px; }
.chk {
  flex: none; appearance: none; width: 20px; height: 20px; margin: 0; border-radius: 6px;
  border: 2px solid var(--border-2); background: var(--surface); display: grid; place-items: center; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.chk:checked { background: var(--feito); border-color: var(--feito); }
.chk:checked::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translate(0, -1px) rotate(-45deg); }
.step-text { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 4px 2px; font-size: 13.5px; }
.step.done .step-text { text-decoration: line-through; color: var(--muted); }
.step-date { width: 122px; flex: none; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 3px 6px; font-size: 12px; color: var(--text-2); }
.step:hover .step-date, .step-date:focus { border-color: var(--border); background: var(--surface); outline: 0; }
.step-date.late { color: var(--urgente); font-weight: 700; }
.step-del { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; opacity: 0; }
.step:hover .step-del, .step-del:focus-visible { opacity: 1; }
.step-del:hover { background: color-mix(in srgb, var(--urgente) 12%, transparent); color: var(--urgente); }
.step-del .i { width: 15px; height: 15px; }
.step-add { display: flex; gap: 8px; margin-top: 8px; }
.step-add input { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); outline: 0; }
.step-add #stepText { flex: 1; min-width: 0; }
.step-add #stepDate { width: 140px; }
.step-add .btn { height: 36px; }
.history { margin-top: 24px; }
.history ol { list-style: none; margin: 10px 0 0; padding: 0 0 0 6px; }
.history li { position: relative; padding: 0 0 10px 18px; font-size: 12.5px; color: var(--text-2); }
.history li::before { content: ""; position: absolute; left: 0; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); }
.history li::after { content: ""; position: absolute; left: 3.5px; top: 15px; bottom: -3px; width: 1px; background: var(--border); }
.history li:last-child::after { display: none; }
.history time { color: var(--muted); font-size: 11.5px; margin-left: 4px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field.two label { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.field input[type="date"] { height: 38px; padding: 0 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); outline: 0; width: 100%; font-size: 13px; }
.owner-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.owner-opt {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); text-align: left; font-size: 13px; font-weight: 600;
}
.owner-opt .avatar { --s: 26px; }
.owner-opt.on { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 10%, var(--surface)); box-shadow: 0 0 0 1px var(--pc); }
.status-pick { display: flex; flex-direction: column; gap: 4px; }
.status-opt {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; font-size: 13px; font-weight: 600; color: var(--text-2); text-align: left;
}
.status-opt .i { width: 16px; height: 16px; color: var(--c); }
.status-opt:hover { background: var(--surface); border-color: var(--border); }
.status-opt.on { background: color-mix(in srgb, var(--c) 12%, var(--surface)); border-color: color-mix(in srgb, var(--c) 45%, transparent); color: var(--c); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; gap: 3px; border-radius: 10px; background: var(--surface-3); }
.seg button { height: 32px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: 13px; color: var(--text-2); }
.seg button.on { background: var(--surface); color: var(--b); box-shadow: var(--shadow-sm); }
.tag-input {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; min-height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
}
.tag-input:focus-within { border-color: var(--dev); }
.tag-input input { flex: 1; min-width: 90px; border: 0; outline: 0; background: transparent; font-size: 13px; padding: 2px 4px; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 4px 0 9px; border-radius: 6px; background: var(--surface-3); font-size: 12px; font-weight: 600; }
.tag-chip button { border: 0; background: transparent; color: var(--muted); display: grid; padding: 2px; border-radius: 4px; }
.tag-chip button:hover { color: var(--urgente); }
.tag-chip .i { width: 12px; height: 12px; }
.field.meta { font-size: 12px; color: var(--muted); gap: 4px; margin-top: auto; }
.dlg-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.spacer { flex: 1; }

/* ---------- Popover e toasts ---------- */
.popover {
  position: fixed; z-index: 60; min-width: 210px; padding: 6px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: pop .12s ease;
}
.popover button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px;
  border: 0; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 500; text-align: left;
}
.popover button:hover { background: var(--surface-3); }
.popover button .i { width: 16px; height: 16px; color: var(--c, var(--text-2)); }
.popover button.danger { color: var(--urgente); }
.popover button.danger .i { color: var(--urgente); }
.popover hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }
.popover .pop-lbl { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 10px 4px; }
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  border-radius: 12px; background: #0f172a; color: #e5ebf5; box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500;
  animation: toastIn .2s ease;
}
.toast.err { background: #7f1d1d; }
.toast button { border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 700; height: 28px; padding: 0 12px; border-radius: 8px; }
.toast button:hover { background: rgba(255, 255, 255, .22); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Alternar visão ---------- */
.view-seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); flex: none; }
.view-seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 7px;
  background: transparent; color: #a8b6d3; font-size: 12.5px; font-weight: 700;
}
.view-seg button .i { width: 16px; height: 16px; }
.view-seg button:hover { color: #fff; }
.view-seg button.on { background: #fff; color: var(--header); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }


/* ---------- Colaboração no quadro ---------- */
.board { position: relative; }
.who-mini { flex: none; margin-left: auto; }
.who-mini .avatar { --s: 18px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--pc); }
.collab { display: inline-flex !important; align-items: center; gap: 0 !important; color: var(--text-2); }
.collab .i { margin-right: 3px; }
.collab .avatar { --s: 18px; margin-left: -5px; box-shadow: 0 0 0 2px var(--surface); }
.collab .avatar:first-of-type { margin-left: 0; }
.pstats { flex-wrap: wrap; gap: 4px 10px; }
.pstats .help { color: var(--dev); font-weight: 700; }

.links { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.list.has-links:empty { display: none; }
.link-card {
  position: relative; padding: 9px 10px 9px 12px; border-radius: 11px; cursor: pointer;
  background: color-mix(in srgb, var(--oc) 7%, var(--surface));
  border: 1.5px dashed color-mix(in srgb, var(--oc) 55%, transparent);
  transition: box-shadow .15s, transform .15s, opacity .2s;
}
.link-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.link-head { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text-2); }
.link-head .i { width: 13px; height: 13px; color: var(--oc); }
.link-head .avatar { --s: 18px; box-shadow: 0 0 0 2px var(--oc); margin-left: 2px; }
.link-head b { color: var(--oc); font-weight: 800; }
.link-title { margin: 5px 0 6px; font-size: 12.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.link-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.link-steps li { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.link-steps label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.link-steps label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-steps time { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); }
.link-steps time.late { color: var(--urgente); }
.link-steps .more { color: var(--muted); font-size: 11px; padding-left: 23px; }
.chk.sm { width: 16px; height: 16px; border-radius: 5px; border-width: 1.5px; }
.chk.sm:checked::after { width: 8px; height: 4px; }

.hl-mode .card:not(.hl), .hl-mode .link-card:not(.hl) { opacity: .35; }
.card.hl, .link-card.hl { box-shadow: 0 0 0 2px var(--oc, var(--dev)), var(--shadow); }
.card.hl { --oc: var(--dev); }
.link-svg { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; overflow: visible; }
.link-svg path {
  fill: none; stroke: var(--oc); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 7 6;
  filter: drop-shadow(0 2px 4px color-mix(in srgb, var(--oc) 40%, transparent));
  animation: flow 1s linear infinite, fadein .25s ease both;
}
@keyframes flow { to { stroke-dashoffset: -26; } }
@keyframes fadein { from { opacity: 0; } }

/* ---------- Responsável por etapa (modal) ---------- */
.step-who {
  flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent;
  display: grid; place-items: center; opacity: .55; transition: opacity .15s, transform .15s;
}
.step-who .avatar { --s: 24px; }
.step:hover .step-who, .step-who.other, #stepWhoBtn { opacity: 1; }
.step-who.other .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--pc); }
.step-who:hover { transform: scale(1.08); }
.step-add .step-who { width: 36px; height: 36px; }
.steps-right { display: flex; align-items: center; gap: 12px; }
.steps-people { display: inline-flex; align-items: center; gap: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.steps-people span { margin-right: 6px; }
.steps-people .avatar { --s: 22px; margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.steps-people .avatar:first-of-type { margin-left: 0; }
.popover button .avatar { --s: 24px; }
.popover button small { margin-left: auto; color: var(--muted); font-size: 11px; }
.popover button.sel { background: color-mix(in srgb, var(--dev) 10%, transparent); font-weight: 700; }

/* ---------- Linha do tempo ---------- */
.tl-wrap {
  overflow: auto; max-height: calc(100vh - var(--hdr, 60px) - 112px); min-height: 360px;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.tl { position: relative; min-width: 100%; }
.tl-head { position: sticky; top: 0; z-index: 8; display: flex; background: var(--surface); border-bottom: 1px solid var(--border); }
.tl-corner {
  position: sticky; left: 0; z-index: 2; flex: none; display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: 0 14px; background: var(--surface); border-right: 1px solid var(--border);
}
.tl-corner small { font-size: 11px; color: var(--muted); font-weight: 600; }
.tl-nav { display: flex; gap: 4px; }
.tl-nav button {
  height: 26px; min-width: 26px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-2);
}
.tl-nav button:hover { border-color: var(--border-2); color: var(--text); }
.tl-nav button .i { width: 14px; height: 14px; }
.tl-nav button[data-tl="prev"] .i { transform: rotate(90deg); }
.tl-nav button[data-tl="next"] .i { transform: rotate(-90deg); }
.tl-scale { position: relative; flex: none; }
.tl-month {
  position: absolute; top: 0; height: 24px; padding: 5px 8px 0; font-size: 11.5px; font-weight: 800; color: var(--text);
  text-transform: capitalize; border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden;
}
.tl-day {
  position: absolute; top: 24px; height: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-2); line-height: 1.05; font-variant-numeric: tabular-nums;
}
.tl-day small { font-size: 9.5px; font-weight: 700; color: var(--muted); }
.tl-day.we { color: var(--muted); }
.tl-day.mon { box-shadow: inset 1px 0 0 var(--border); }
.tl-day.today { color: #fff; }
.tl-day.today::before { content: ""; position: absolute; inset: 3px 50% 3px 50%; margin: 0 -13px; border-radius: 8px; background: var(--accent); z-index: -1; }
.tl-today-pill { display: none; }
.tl-body {
  position: relative;
  background-image: linear-gradient(to right, color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px);
  background-size: var(--dw) 100%; background-position: var(--label) 0;
}
.tl-we { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--surface-3) 60%, transparent); }
.tl-week { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); z-index: 4; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.tl-row { position: absolute; left: 0; border-bottom: 1px solid var(--border); }
.tl-row.alt { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.tl-label {
  position: sticky; left: 0; z-index: 6; width: 200px; height: 100%; display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 12px 12px 16px; background: var(--surface); border-right: 1px solid var(--border);
  box-shadow: inset 4px 0 0 var(--pc);
}
.tl-row.alt .tl-label { background: var(--surface-2); }
.tl-label .avatar { --s: 40px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--pc) 60%, transparent); }
.tl-label b { display: block; font-size: 14px; font-weight: 800; }
.tl-label span { display: block; font-size: 11.5px; color: var(--text-2); line-height: 1.25; }
.tl-label em { display: flex; align-items: center; gap: 3px; margin-top: 4px; font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); }
.tl-label em .i { width: 12px; height: 12px; color: var(--dev); }
.tl-support-lbl { position: absolute; left: 212px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); z-index: 1; }

.tl-bar {
  position: absolute; z-index: 5; height: 28px; border-radius: 8px; cursor: pointer; overflow: visible;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, opacity .2s;
}
.tl-bar:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tl-fill { position: absolute; inset: 0 auto 0 0; border-radius: 7px 0 0 7px; background: color-mix(in srgb, var(--c) 45%, transparent); }
.tl-bar .tl-fill[style*="100%"] { border-radius: 7px; }
.tl-title {
  position: relative; display: block; padding: 0 10px; line-height: 26px; font-size: 12px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-bar.outside .tl-title { position: absolute; left: 100%; top: 0; padding-left: 8px; overflow: visible; color: var(--text-2); }
.tl-bar.late { border-color: var(--urgente); background-image: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--urgente) 12%, transparent) 6px 12px); }
.tl-bar.done { opacity: .7; }
.tl-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dashed; }
.tl-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), rgba(0, 0, 0, .35)); mask-image: linear-gradient(to right, #000 calc(100% - 24px), rgba(0, 0, 0, .35)); }
.tl-bar.outside.cut-r { -webkit-mask-image: none; mask-image: none; }
.tl-dot { position: absolute; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--surface); border: 2px solid var(--c); z-index: 1; }
.tl-dot.ok { background: var(--c); }
.tl-hand { position: absolute; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: var(--wc); transform: rotate(45deg); border: 2px solid var(--surface); z-index: 2; }

.tl-mark {
  position: absolute; z-index: 5; height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 22px;
  border-radius: 999px; cursor: pointer; white-space: nowrap; font-size: 11.5px; color: var(--text-2);
  background: var(--surface); border: 1.5px dashed color-mix(in srgb, var(--oc) 70%, transparent); box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, opacity .2s;
}
.tl-mark:hover { box-shadow: var(--shadow); }
.tl-mark .dia { position: absolute; left: 3px; top: 50%; width: 12px; height: 12px; margin-top: -6px; background: var(--oc); transform: rotate(45deg); border-radius: 2px; }
.tl-mark .avatar { --s: 18px; }
.tl-mark span { overflow: hidden; text-overflow: ellipsis; }
.tl-mark strong { color: var(--text); font-weight: 700; }
.tl-mark.done { border-style: solid; border-color: color-mix(in srgb, var(--feito) 60%, transparent); opacity: .75; }
.tl-mark.done .dia { background: var(--feito); }
.tl-mark.done strong { text-decoration: line-through; }
.tl-mark.late { border-color: var(--urgente); }
.tl-mark.nodate { border-style: dotted; }

.tl-links { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; overflow: visible; }
.tl-links path { fill: none; stroke: var(--oc); stroke-width: 2; stroke-dasharray: 5 5; opacity: .4; transition: opacity .2s, stroke-width .2s; }
.tl-links path.ok { stroke: var(--feito); stroke-dasharray: none; }
.tl-links circle { fill: var(--surface); stroke: var(--oc); stroke-width: 2; opacity: .7; }
.tl-wrap.hl-mode .tl-bar:not(.hl), .tl-wrap.hl-mode .tl-mark:not(.hl) { opacity: .25; }
.tl-wrap.hl-mode .tl-links path:not(.hl), .tl-wrap.hl-mode .tl-links circle:not(.hl) { opacity: .08; }
.tl-links path.hl { opacity: 1; stroke-width: 3; animation: flow 1s linear infinite; }
.tl-links circle.hl { opacity: 1; }
.tl-bar.hl { box-shadow: 0 0 0 2px var(--c), var(--shadow); }
.tl-mark.hl { box-shadow: 0 0 0 2px var(--oc), var(--shadow); }
.tl-empty { position: absolute; top: 40%; right: 0; text-align: center; color: var(--muted); font-size: 13px; z-index: 3; }
/* ---------- KPIs dentro do quadro (alinhados às colunas) ---------- */
.kpi-slot { padding-top: 10px; min-width: 0; }
.kpi-slot .kpi { height: 100%; }
.corner-kpi { position: sticky; left: 0; z-index: 4; background: var(--surface-2); box-shadow: 10px 0 0 var(--surface-2); }
.kpi-sub .late { color: var(--urgente); }
.kpi-total .ring text { font: 800 11px "Inter", sans-serif; fill: var(--text); text-anchor: middle; dominant-baseline: central; }
#kpis { grid-template-columns: repeat(6, minmax(150px, 1fr)); }

/* ---------- Coluna expandida ---------- */
.bh .expand { opacity: .55; }
.bh:hover .expand, .bh .expand:focus-visible { opacity: 1; }
.bh.focused .expand { opacity: 1; background: var(--c); color: #fff; }
.bh.mini, .kpi-slot.mini { cursor: pointer; }
.bh.mini { justify-content: center; padding: 0; }
.bh.mini:hover { background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.kpi-slot.mini .kpi { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 4px; }
.kpi-slot.mini .kpi-ic { width: 26px; height: 26px; }
.kpi-slot.mini .kpi-ic .i { width: 14px; height: 14px; }
.kpi-slot.mini .kpi-label, .kpi-slot.mini .kpi-sub { display: none; }
.kpi-slot.mini .kpi-value { font-size: 17px; }
.kpi-slot.mini:hover .kpi { box-shadow: var(--shadow); }
.cell.mini { position: relative; padding: 4px; align-items: stretch; }
.cell.mini .card, .cell.mini .links, .cell.mini .cell-add { display: none; }
.cell.mini .list { min-height: 100%; }
.cell.mini .list::before { content: none !important; }
.mini-count {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 1; cursor: pointer;
  min-width: 30px; height: 26px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 800; color: #fff; background: var(--c); box-shadow: var(--shadow-sm);
}
.mini-count.zero { background: var(--surface-3); color: var(--muted); }
.cell.focused .list:not(.compact), .cell.focused .links {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); align-items: start; gap: 10px;
}
.cell.focused .list:empty { display: flex; }
/* ---------- Linhas com altura fixa ---------- */
.board { --row-h: 292px; }
.person:not(.row-collapsed), .cell:not(.row-collapsed) { height: var(--row-h); }
.row-collapsed.person, .cell.row-collapsed { height: 132px; }
.board.focus-mode .cell.focused, .board.focus-mode .person, .board.focus-mode .cell.mini { height: auto; min-height: var(--row-h); }
.cell { position: relative; min-height: 0; }
.cell-body { position: relative; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.board.focus-mode .cell.focused .cell-body { overflow: visible; }
.cell-body .list { flex: 0 0 auto; min-height: 48px; }
.cell-body .list:only-child { flex: 1; }
.cell-body.clipped::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--c) 4%, var(--surface-2)) 85%);
}
.cell-foot { flex: none; display: flex; align-items: center; gap: 6px; height: 30px; margin-top: 6px; }
.cell-foot .cell-add { margin: 0; flex: 1; height: 28px; justify-content: flex-start; padding: 0 8px; }
.cell-more {
  flex: none; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--c); font-size: 11.5px; font-weight: 800; white-space: nowrap;
}
.cell-more:hover { background: var(--c); color: #fff; }
.cell-open {
  position: absolute; top: 4px; right: 4px; z-index: 2; width: 24px; height: 24px; border-radius: 7px; border: 0;
  display: grid; place-items: center; background: var(--surface); color: var(--c); box-shadow: var(--shadow-sm);
  opacity: 0; transition: opacity .15s;
}
.cell-open .i { width: 13px; height: 13px; }
.cell:hover .cell-open, .cell-open:focus-visible { opacity: 1; }
.cell-open:hover { background: var(--c); color: #fff; }
.is-dragging .cell-open { display: none; }
.cell.row-collapsed .cell-foot { display: none; }

/* ---------- Painel da célula aberta ---------- */
.cell-dialog { width: min(1180px, calc(100vw - 32px)); height: min(820px, calc(100vh - 40px)); display: none; flex-direction: column; background: var(--surface-2); }
.cell-dialog[open] { display: flex; }
.cd-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.cd-head .avatar { --s: 42px; }
.cd-title { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.cd-title b { font-size: 17px; font-weight: 800; }
.cd-title .badge { gap: 5px; height: 22px; }
.cd-title .badge .i { width: 12px; height: 12px; }
.cd-meta { font-size: 13px; color: var(--text-2); font-weight: 600; }
.cd-meta .late { color: var(--urgente); }
.cd-head .btn-sm { height: 34px; }
.cd-body { flex: 1; overflow: auto; padding: 16px 20px 24px; }
.cd-list, .cd-links { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; min-height: 80px; }
.cd-list:empty { min-height: 80px; border: 1.5px dashed var(--border-2); border-radius: 12px; }
.cd-list:empty::before { content: none; }
.cd-sub { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.cd-sub .i { width: 16px; height: 16px; color: var(--dev); }
/* ---------- Responsivo ---------- */
@media (max-width: 1700px) {
  .view-seg button span { display: none; }
}
@media (max-width: 1500px) {
  .brand-text { display: none; }
  .header-actions .btn-primary span { display: none; }
  .header-actions .btn-primary { padding: 0 11px; }
  .toggle .lbl-long { display: none; }
}
@media (min-width: 1501px) { .toggle .lbl-short { display: none; } }
@media (max-width: 900px) {
  .app-header { padding: 10px 16px; flex-wrap: wrap; }
  .hfilters { order: 5; flex-basis: 100%; }
  .search { order: 4; flex-basis: 100%; max-width: none; }
  .brand-text { display: flex; }
  .hfilters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
  .hfilters::-webkit-scrollbar { display: none; }
  .hfilters > * { flex: none; }
  .layout { padding: 12px 16px 16px; }
  .dlg-body { grid-template-columns: 1fr; }
  .dlg-side { border-left: 0; border-top: 1px solid var(--border); }
  .search kbd { display: none; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(6, 150px); gap: 8px; margin: 0 -16px; padding: 0 16px; }
  .btn-primary span { display: none; }
  .btn-primary { padding: 0 12px; }
  .board { --pcol: 170px; grid-template-columns: var(--pcol) repeat(5, 240px); }
  .person { padding: 12px 10px 12px 14px; }
  .person .avatar { --s: 42px; }
  .step-add { flex-wrap: wrap; }
  .step-add #stepText { flex-basis: 100%; }
  .step-date { width: 112px; }
}
