:root {
  --bg: #ffffff;
  --subtle: #f7f7f6;
  --hover: #f2f2f0;
  --line: #e8e8e5;
  --line-strong: #d6d6d2;
  --text: #191918;
  --muted: #6f6f6b;
  --faint: #a3a39f;
  --accent: #191918;
  --accent-text: #ffffff;
  --green: #17864b;
  --green-bg: #eaf6ef;
  --amber: #b26a00;
  --amber-bg: #fdf3e2;
  --red: #c23a2b;
  --red-bg: #fbecea;
  --blue: #2c63c9;
  --blue-bg: #ebf1fc;
  --radius: 6px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  color-scheme: light;

  /* cores dos estados (texto / fundo) */
  --t-gray: #5f5f5b;   --t-gray-bg: #f0f0ee;
  --t-purple: #7e3fb8; --t-purple-bg: #f4ecfb;
  --t-indigo: #4b4fc4; --t-indigo-bg: #eeeefc;
  --t-blue: #2c63c9;   --t-blue-bg: #ebf1fc;
  --t-yellow: #876700; --t-yellow-bg: #fbf3d2;
  --t-orange: #a94806; --t-orange-bg: #fdede1;
  --t-pink: #b3307a;   --t-pink-bg: #fbeaf3;
  --t-cyan: #0b7893;   --t-cyan-bg: #e3f4f8;
  --t-teal: #0d7a69;   --t-teal-bg: #e1f3ef;
  --t-green: #127640;  --t-green-bg: #e7f5ec;
  --t-red: #c23a2b;    --t-red-bg: #fbecea;

  --chart-bar: #2c63c9; /* validado: faixa de luminosidade, croma e contraste no fundo claro */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414;
    --subtle: #1a1a1a;
    --hover: #202020;
    --line: #2a2a2a;
    --line-strong: #3a3a3a;
    --text: #ececea;
    --muted: #9d9d98;
    --faint: #6a6a66;
    --accent: #ececea;
    --accent-text: #141414;
    --green: #4cc38a;
    --green-bg: #15261d;
    --amber: #e3a33b;
    --amber-bg: #2a2012;
    --red: #ec6a5c;
    --red-bg: #2c1714;
    --blue: #6d9cf0;
    --blue-bg: #151f31;
    color-scheme: dark;

    --t-gray: #a3a39f;   --t-gray-bg: #242424;
    --t-purple: #c29af0; --t-purple-bg: #2a1f36;
    --t-indigo: #a3a6f5; --t-indigo-bg: #22233a;
    --t-blue: #6d9cf0;   --t-blue-bg: #151f31;
    --t-yellow: #e6c65a; --t-yellow-bg: #2b2612;
    --t-orange: #f0985a; --t-orange-bg: #2e1f14;
    --t-pink: #ee8fc0;   --t-pink-bg: #321a27;
    --t-cyan: #5cc8e0;   --t-cyan-bg: #122a30;
    --t-teal: #4fcab5;   --t-teal-bg: #112a26;
    --t-green: #4cc38a;  --t-green-bg: #15261d;
    --t-red: #ec6a5c;    --t-red-bg: #2c1714;

    --chart-bar: #5a8ae6; /* validado contra o fundo escuro #141414 */
  }
}

* { box-sizing: border-box; box-shadow: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }

/* ---------------------------------------------------------------- layout */

.shell { display: grid; grid-template-columns: auto 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; width: 232px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--subtle);
  transition: width .15s ease;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 10px 0 18px; }
.brand { font-weight: 650; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-mark { width: 18px; height: 18px; color: var(--text); flex: none; display: block; }

.nav { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 16px 10px 6px; white-space: nowrap; }
.nav-group:first-child { padding-top: 4px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px;
  border-radius: var(--radius); text-decoration: none; color: var(--muted); white-space: nowrap;
}
.nav a svg { flex: none; }
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a.active { color: var(--text); background: var(--bg); font-weight: 550; outline: 1px solid var(--line); }
.nav a .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav kbd {
  font: 11px var(--mono); color: var(--faint); opacity: 0; transition: opacity .1s;
}
.nav a:hover kbd { opacity: 1; }
.nav .count {
  font-size: 11px; min-width: 20px; height: 18px; line-height: 18px; padding: 0 6px; border-radius: 9px; text-align: center;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-weight: 500;
}
.nav .count.warn { background: var(--amber-bg); border-color: transparent; color: var(--amber); }
.nav .count.danger { background: var(--red-bg); border-color: transparent; color: var(--red); }

.sidebar-foot { border-top: 1px solid var(--line); padding: 12px 10px; display: grid; gap: 4px; font-size: 12px; }
.foot-row { display: flex; align-items: center; gap: 10px; padding: 5px 10px; color: var(--muted); white-space: nowrap; border-radius: var(--radius); }
.foot-row .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
button.foot-row { border: 0; background: transparent; cursor: pointer; text-align: left; font-size: 12px; width: 100%; }
button.foot-row:hover { background: var(--hover); color: var(--text); }
button.foot-row:disabled { opacity: .6; cursor: default; }
.foot-row .dot-wrap { width: 16px; display: grid; place-items: center; flex: none; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* recolhido: só ícones */
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .label, .sidebar.collapsed kbd, .sidebar.collapsed .nav-group { display: none; }
.sidebar.collapsed .sidebar-head { flex-direction: column; justify-content: center; gap: 6px; height: 84px; padding: 0; }
.sidebar.collapsed .nav a, .sidebar.collapsed .foot-row { justify-content: center; padding: 0; }
.sidebar.collapsed .foot-row { height: 30px; }
.sidebar.collapsed .nav .count {
  position: absolute; top: 3px; right: 3px; min-width: 0; width: 8px; height: 8px; padding: 0; font-size: 0; border: 0;
}
.sidebar.collapsed .nav .count:not(.warn):not(.danger) { display: none; }
.sidebar.collapsed .nav .count.warn { background: var(--amber); }
.sidebar.collapsed .nav .count.danger { background: var(--red); }

main { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 32px 80px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; gap: 12px; }
.section-head .hint { color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------------- controles */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--bg); cursor: pointer; white-space: nowrap;
  font-size: 13px;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.primary:hover { opacity: .88; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--hover); }
.btn.danger { color: var(--red); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.icon { width: 28px; padding: 0; height: 28px; }

.input, .select, textarea.input {
  height: 32px; padding: 0 10px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--bg); outline: none; min-width: 0;
}
textarea.input { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--text); }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input.search { width: 260px; }
.spacer { flex: 1; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 0 10px; height: 30px; cursor: pointer; color: var(--muted); font-size: 13px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--subtle); color: var(--text); font-weight: 550; }

/* ---------------------------------------------------------------- blocos */

.kpis { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi { padding: 14px 16px; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi .label { font-size: 12px; color: var(--muted); }
.kpi .value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .sub { font-size: 12px; color: var(--faint); }

.list { border: 1px solid var(--line); border-radius: var(--radius); }
.list > .row + .row { border-top: 1px solid var(--line); }

.dev-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 16px; padding: 14px 16px; align-items: start; }
.dev-name { font-weight: 550; display: flex; align-items: center; gap: 8px; }
.dev-now { min-width: 0; }
.dev-now .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-now .idle { color: var(--faint); }
.dev-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.paused-line {
  margin-top: 8px; padding: 6px 10px; border-radius: var(--radius); background: var(--amber-bg);
  color: var(--text); font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.paused-line .tag { color: var(--amber); font-weight: 550; }
.paused-line .muted { color: var(--muted); }

.avatar {
  width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font-size: 11px; font-weight: 600; background: var(--subtle); border: 1px solid var(--line); color: var(--muted);
}

.clock { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); }
.dot.run { background: var(--green); animation: pulse 1.6s ease-in-out infinite; }
.dot.paused { background: var(--amber); }
.dot.blocked { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 4px;
  font-size: 11.5px; font-weight: 500; background: var(--subtle); color: var(--muted); border: 1px solid var(--line); white-space: nowrap;
}
.badge.green { background: var(--green-bg); color: var(--green); border-color: transparent; }
.badge.amber { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.badge.red { background: var(--red-bg); color: var(--red); border-color: transparent; }
.badge.blue { background: var(--blue-bg); color: var(--blue); border-color: transparent; }

/* estados do card: cada um com sua cor (tokens em :root, abaixo) */
.badge.st { border-color: transparent; color: var(--st-fg); background: var(--st-bg); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.badge.st i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.st-gray   { --st-fg: var(--t-gray);   --st-bg: var(--t-gray-bg); }
.st-purple { --st-fg: var(--t-purple); --st-bg: var(--t-purple-bg); }
.st-indigo { --st-fg: var(--t-indigo); --st-bg: var(--t-indigo-bg); }
.st-blue   { --st-fg: var(--t-blue);   --st-bg: var(--t-blue-bg); }
.st-yellow { --st-fg: var(--t-yellow); --st-bg: var(--t-yellow-bg); }
.st-orange { --st-fg: var(--t-orange); --st-bg: var(--t-orange-bg); }
.st-pink   { --st-fg: var(--t-pink);   --st-bg: var(--t-pink-bg); }
.st-cyan   { --st-fg: var(--t-cyan);   --st-bg: var(--t-cyan-bg); }
.st-teal   { --st-fg: var(--t-teal);   --st-bg: var(--t-teal-bg); }
.st-green  { --st-fg: var(--t-green);  --st-bg: var(--t-green-bg); }
.st-red    { --st-fg: var(--t-red);    --st-bg: var(--t-red-bg); }

.type { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.type i { width: 3px; height: 12px; border-radius: 2px; background: var(--faint); display: inline-block; }
.type[data-t="epic"] i { background: #d97706; }
.type[data-t="feature"] i { background: #7c3aed; }
.type[data-t="user story"] i, .type[data-t="product backlog item"] i, .type[data-t="requirement"] i { background: #2563eb; }
.type[data-t="task"] i { background: #ca8a04; }
.type[data-t="bug"] i { background: #dc2626; }
.type[data-t="avulsa"] i { background: var(--text); }

/* ---------------------------------------------------------------- tabelas */

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--subtle); white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.done td { color: var(--faint); }
tr.parent td { font-weight: 550; }
tr.parent td .type, tr.parent td .muted { font-weight: 400; }

.item-title + a.badge, a.badge + a.badge { margin-left: 2px; }
a.badge { text-decoration: none; font-family: var(--mono); font-size: 11px; }
a.badge:hover { outline: 1px solid currentColor; }

/* deploys */
.deploy-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.list-group { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 18px 2px 6px; }
.list-group:first-child { padding-top: 0; }
.deploy-row { display: block; padding: 10px 14px; text-decoration: none; color: inherit; }
.deploy-row + .deploy-row { border-top: 1px solid var(--line); }
.deploy-row:hover { background: var(--hover); }
.deploy-row.active { background: var(--subtle); box-shadow: inset 2px 0 0 var(--text) !important; }
.check-list, .radio-list { border: 1px solid var(--line); border-radius: var(--radius); }
.check-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer; font-size: 13px; min-width: 0; }
.check-row + .check-row { border-top: 1px solid var(--line); }
.check-row:hover { background: var(--hover); }
.check-row input[type=checkbox], .check-row input[type=radio] { margin: 0; accent-color: var(--text); flex: none; }
.sm-input { height: 28px; width: 110px; font-size: 12px; }
@media (max-width: 900px) { .deploy-layout { grid-template-columns: 1fr; } }

/* linhas-guia da árvore */
td.tree-td { position: relative; }
.tree-td .tree-cell { position: relative; }
.tg { position: absolute; pointer-events: none; border: 0 solid var(--line-strong); }
.tg.v { top: 0; bottom: 0; border-left-width: 1px; }
.tg.tee { top: 0; bottom: 0; border-left-width: 1px; }
.tg.tee::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line-strong); }
.tg.elbow { top: 0; height: 50%; border-left-width: 1px; border-bottom-width: 1px; border-bottom-left-radius: 6px; }
.tg.down { top: calc(50% + 9px); bottom: 0; border-left-width: 1px; }
tbody tr.clickable:hover .tg, tbody tr.clickable:hover .tg::after { border-color: var(--faint); }

.tree-cell { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }

/* tabelas de largura fixa: nunca rolam para o lado, o texto é cortado com reticências */
table.t { table-layout: fixed; width: 100%; }
.t th, .t td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t td.wrap { white-space: normal; overflow-wrap: anywhere; }
.t td .btn.icon { vertical-align: middle; }
.t td.num .btn + .btn { margin-left: 2px; }

/* paginação */
.pager { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pages, .page-nums { display: flex; align-items: center; gap: 2px; }
.pages .btn { min-width: 26px; padding: 0 6px; }
.btn.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.page-now { display: none; padding: 0 6px; }
.sm-select { height: 26px; font-size: 12px; padding: 0 6px; }
.page-context {
  padding: 6px 12px; font-size: 12px; color: var(--muted); background: var(--subtle); border-bottom: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.page-context a { text-decoration: none; }
.page-context a:hover { text-decoration: underline; }

.split-2 { grid-template-columns: 1fr 1fr; }
.split-config { grid-template-columns: 1.4fr 1fr; align-items: start; }
.kpis.kpis-4 { grid-template-columns: repeat(4, 1fr); }
.drawer-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* colunas que somem conforme a largura da tela */
@media (max-width: 1100px) { .hide-md { display: none !important; } }
@media (max-width: 800px) { .hide-sm { display: none !important; } }
@media (max-width: 560px) {
  .hide-xs { display: none !important; }
  .page-nums { display: none; }
  .page-now { display: inline; }
}
.tree-toggle {
  width: 18px; height: 18px; border: 0; background: transparent; cursor: pointer; color: var(--muted);
  display: inline-grid; place-items: center; border-radius: 4px; flex: none; padding: 0;
}
.tree-toggle:hover { background: var(--line); }
.tree-toggle svg { transition: transform .12s; }
.tree-toggle.closed svg { transform: rotate(-90deg); }
.tree-pad { width: 18px; flex: none; }
.item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }

.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; font-weight: 550; }

/* ---------------------------------------------------------------- barras de resumo */

.split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.card h3 { margin-bottom: 10px; color: var(--muted); font-weight: 500; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13px; }
.bar-row .ellipsis { min-width: 0; }
.bar-track { grid-column: 1 / -1; height: 4px; background: var(--subtle); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--amber); border-radius: 2px; }
.bar-fill.red { background: var(--red); }

/* ---------------------------------------------------------------- drawer */

.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.18); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); z-index: 21;
  background: var(--bg); border-left: 1px solid var(--line); overflow-y: auto;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { padding: 18px 24px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.drawer-head .top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.drawer-head h2 { font-size: 17px; line-height: 1.35; }
.drawer-body { padding: 20px 24px 40px; }
.meta { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); margin: 20px 0; }
.stats > div { padding: 10px 12px; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats .label { font-size: 11.5px; color: var(--muted); }
.stats .value { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.drawer .section { margin-top: 24px; }
.mini { font-size: 13px; }
.mini td, .mini th { padding: 7px 10px; }

/* ---------------------------------------------------------------- modal */

dialog {
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--bg); color: var(--text);
}
dialog::backdrop { background: rgba(0,0,0,.25); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 18px 20px; display: grid; gap: 14px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.field { display: grid; gap: 5px; }
.field > label { font-size: 12px; color: var(--muted); font-weight: 500; }
.field .input, .field .select { width: 100%; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.context-box { padding: 10px 12px; border-radius: var(--radius); background: var(--subtle); border: 1px solid var(--line); font-size: 13px; }

.picker { position: relative; }
.picker-list {
  margin-top: 4px; border: 1px solid var(--line); border-radius: var(--radius);
}
.picker-list:empty { display: none; }
.picker-opt { padding: 7px 10px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.picker-opt + .picker-opt { border-top: 1px solid var(--line); }
.picker-opt:hover, .picker-opt.sel { background: var(--hover); }
.picker-opt .ellipsis { flex: 1; min-width: 0; }
.picker-opt.new { color: var(--blue); }
.picker-chosen { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--text); border-radius: var(--radius); font-size: 13px; }
.picker-chosen .ellipsis { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- toast */

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; }
.toast {
  padding: 9px 14px; border-radius: var(--radius); background: var(--text); color: var(--bg); font-size: 13px;
  animation: rise .16s ease-out; max-width: 520px;
}
.toast.error { background: var(--red); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- responsivo */

html, body { overflow-x: clip; }

@media (max-width: 900px) {
  .kpis, .kpis.kpis-4 { grid-template-columns: repeat(2, 1fr); }
  .kpi + .kpi { border-left: 0; }
  .kpi { border-bottom: 1px solid var(--line); }
  .split { grid-template-columns: 1fr; }
  .dev-row { grid-template-columns: 1fr; }
  .dev-actions { justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  main { padding: 20px 16px 60px; }

  /* menu vira barra no topo */
  .shell { grid-template-columns: 1fr; }
  .sidebar, .sidebar.collapsed {
    width: auto; height: auto; flex-direction: row; align-items: center; z-index: 10;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .sidebar-head, .sidebar.collapsed .sidebar-head { flex-direction: row; height: 52px; padding: 0 8px 0 16px; }
  .sidebar .brand .label { display: none; }
  .collapse-btn, .nav-group, .nav kbd { display: none !important; }
  .nav { flex-direction: row; padding: 0 4px; gap: 2px; overflow: visible; justify-content: center; }
  .nav a, .sidebar.collapsed .nav a { padding: 0 10px; flex: none; }
  .sidebar-foot { border-top: 0; padding: 0 8px; }
  .sidebar-foot .foot-row:not(button) { display: none; }
  .sidebar-foot .label { display: none; }
}

/* telas estreitas: menu só com ícones, formulários em uma coluna */
@media (max-width: 900px) {
  .nav a .label { display: none; }
  .nav a { height: 36px; }
  .nav .count { position: absolute; top: 2px; right: 2px; min-width: 0; width: 8px; height: 8px; padding: 0; font-size: 0; border: 0; }
  .nav .count:not(.warn):not(.danger) { display: none; }
  .nav .count.warn { background: var(--amber); }
  .nav .count.danger { background: var(--red); }
}
@media (max-width: 640px) {
  .field-row, .split-config { grid-template-columns: 1fr !important; }
  .toolbar .input.search { width: 100%; }
  .toolbar .select { flex: 1 1 140px; }
  .page-head .btn { width: 100%; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  .meta { grid-template-columns: 100px 1fr; }
}

/* ---------------------------------------------------------------- prazos e entregas */

/* cor de cada fase: back-end azul, front-end roxo, QA laranja (mesmos tons dos estados) */
.ph-backend, .mk-backend  { --ph: var(--t-blue);   --ph-bg: var(--t-blue-bg); }
.ph-frontend, .mk-frontend { --ph: var(--t-purple); --ph-bg: var(--t-purple-bg); }
.ph-qa, .mk-qa            { --ph: var(--t-orange); --ph-bg: var(--t-orange-bg); }

.ph { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.ph i { width: 8px; height: 8px; border-radius: 2px; background: var(--ph); flex: none; }
.ph-qa i { width: 7px; height: 7px; transform: rotate(45deg); }

.dl-status { font-size: 12px; color: var(--muted); }
.dl-status.s-overdue { color: var(--red); font-weight: 500; }
.dl-status.s-ontime { color: var(--t-green); }
.dl-status.s-late-done { color: var(--t-orange); }
.dl-status.s-none { color: var(--faint); }

.deadlines { border: 1px solid var(--line); border-radius: var(--radius); }
.dl-row { display: grid; grid-template-columns: 104px 148px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; min-width: 0; }
.dl-row + .dl-row { border-top: 1px solid var(--line); }
.dl-date { height: 30px; width: 100%; font-size: 13px; }

/* marcadores: círculo = back/front, losango = QA (entrega) */
.mk {
  position: absolute; top: 50%; z-index: 2; width: 12px; height: 12px; border-radius: 50%;
  transform: translate(-50%, -50%); border: 2px solid var(--ph); background: var(--bg);
}
.mk-qa { width: 11px; height: 11px; border-radius: 2px; transform: translate(-50%, -50%) rotate(45deg); }
.mk.s-ontime { background: var(--ph); }
.mk.s-late-done { background: var(--ph); border-color: var(--red); }
.mk.s-overdue { border-color: var(--red); background: var(--red-bg); }
.mk.clamp-l, .mk.clamp-r { opacity: .5; border-style: dashed; }
.mk.static { position: relative; display: inline-block; top: auto; transform: none; margin-right: 6px; vertical-align: -2px; }
.mk-qa.static { transform: rotate(45deg); }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; }
.legend .sep { width: 1px; height: 14px; background: var(--line); }

.nav-seg button { min-width: 34px; }
.nav-label { font-size: 13px; font-weight: 550; white-space: nowrap; }
.metric-value { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bar-fill[class*="ph-fill-"] { background: var(--ph); }
.ph-fill-backend { --ph: var(--t-blue); }
.ph-fill-frontend { --ph: var(--t-purple); }
.ph-fill-qa { --ph: var(--t-orange); }

/* linha do tempo */
.tl { --lw: 300px; }
.tl-head { display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); background: var(--subtle); border-bottom: 1px solid var(--line); }
.tl-label-h { align-self: end; padding: 0 12px 7px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); }
.tl-weeks, .tl-days { display: grid; }
.tl-weeks span { padding: 7px 6px 1px; font-size: 12px; font-weight: 550; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.tl-days span { padding: 1px 0 6px; font-size: 11px; line-height: 1.25; text-align: center; color: var(--muted); overflow: hidden; font-variant-numeric: tabular-nums; }
.tl-days span small { display: block; font-size: 9.5px; text-transform: uppercase; color: var(--faint); }
.tl-days span.we { color: var(--faint); }
.tl-days span.today { color: var(--text); font-weight: 650; }
.tl-days span.wk { border-left: 1px solid var(--line); }

.tl-body { position: relative; }
.tl-grid { position: absolute; top: 0; bottom: 0; left: var(--lw); right: 0; display: grid; pointer-events: none; }
.tl-grid span.we { background: var(--subtle); }
.tl-grid span.wk { border-left: 1px solid var(--line); }
.tl-grid span.today { background: linear-gradient(var(--text), var(--text)) center / 1.5px 100% no-repeat; }

.tl-row { position: relative; display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); min-height: 50px; }
.tl-row + .tl-row { border-top: 1px solid var(--line); }
.tl-label {
  position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 1px;
  padding: 6px 12px; min-width: 0; text-decoration: none; background: var(--bg); border-right: 1px solid var(--line);
}
.tl-row:hover .tl-label { background: var(--hover); }
.tl-track { position: relative; }
.tl-bar { position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--line-strong); z-index: 1; }
.tl-bar.late { background: var(--red); opacity: .35; }
.tl-bar.done { background: var(--t-green); opacity: .35; }
.tl-empty { position: relative; z-index: 1; background: var(--bg); }

/* calendário */
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--subtle); border-bottom: 1px solid var(--line); }
.cal-head span { padding: 7px 10px; font-size: 12px; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-day {
  position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 108px;
  padding: 6px 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-grid .cal-day:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-day.we { background: var(--subtle); }
.cal-day:hover { background: var(--hover); }
.cal-day.out .cal-num { color: var(--faint); }
.cal-day.out .cal-events { opacity: .55; }
.cal-day.sel { outline: 1.5px solid var(--text); outline-offset: -1.5px; }
.cal-num { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day.today .cal-num { background: var(--text); color: var(--bg); font-weight: 650; }
.cal-events { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-ev {
  display: block; min-width: 0; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; line-height: 1.6;
  background: var(--ph-bg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-ev i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--ph); vertical-align: 1px; }
.cal-ev.ph-qa i { border-radius: 1px; transform: rotate(45deg); }
.cal-ev b { font-weight: 650; color: var(--ph); }
.cal-ev.s-overdue { background: var(--red-bg); }
.cal-ev.s-overdue b { color: var(--red); }
.cal-ev.s-ontime, .cal-ev.s-late-done { opacity: .55; }
.cal-ev:hover { outline: 1px solid var(--ph); }
.cal-more { padding-left: 6px; font-size: 11px; color: var(--muted); }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ph); }
.cal-dots i.ph-backend { --ph: var(--t-blue); }
.cal-dots i.ph-frontend { --ph: var(--t-purple); }
.cal-dots i.ph-qa { --ph: var(--t-orange); }
.cal-dots i.s-overdue { background: var(--red); }

/* replanejamento por impedimento: duas faixas (previsto × atual) */
.tl-label { flex-direction: row; align-items: center; gap: 8px; }
.tl-label-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.tl-row.two { min-height: 72px; }
.lane-caps {
  align-self: stretch; display: flex; flex-direction: column; justify-content: space-around; padding: 6px 0;
  font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; text-align: right; flex: none;
}
.tl-row.two .tl-label { padding-right: 8px; }

.tl-bar.base {
  height: 2px; margin-top: -1px; opacity: 1;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 5px, transparent 5px 9px);
}
.mk.ghost { border-style: dashed; opacity: .55; background: var(--bg); }
.mk.proj { border-style: dashed; border-color: var(--red); background: var(--red-bg); }

.tl-imp {
  position: absolute; top: 3px; bottom: 3px; z-index: 0; border-radius: 3px;
  background: repeating-linear-gradient(135deg, var(--red-bg) 0 5px, transparent 5px 10px);
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
}
.tl-imp.open { border-right-style: dashed; }
.tl-imp i {
  position: absolute; top: -1px; left: 3px; font: 700 10px/1 var(--font); font-style: normal; color: var(--red);
}
.tl-delay {
  position: absolute; top: 72%; height: 2px; margin-top: -1px; z-index: 1; background: var(--red);
}
.tl-delay b {
  position: absolute; right: -2px; bottom: 5px; transform: translateX(50%);
  font-size: 10.5px; font-weight: 650; color: var(--red); white-space: nowrap; background: var(--bg); padding: 0 3px; border-radius: 3px;
}
.late-tag { color: var(--red); font-weight: 550; }

.legend-imp, .legend-delay { display: inline-block; margin-right: 6px; vertical-align: -2px; }
.legend-imp { width: 18px; height: 12px; border-radius: 2px; border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  background: repeating-linear-gradient(135deg, var(--red-bg) 0 4px, transparent 4px 8px); }
.legend-delay { width: 18px; height: 2px; background: var(--red); vertical-align: 3px; }

/* prazos no card: replanejamento */
.imp-note { margin-bottom: 10px; padding: 9px 12px; border-radius: var(--radius); background: var(--red-bg); font-size: 13px; }
.dl-status { display: flex; flex-direction: column; min-width: 0; }
.dl-sub { font-size: 11px; color: var(--faint); }
.dl-sub.red { color: var(--red); }
.dl-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.shift-log { margin-top: 10px; display: grid; gap: 4px; padding-left: 10px; border-left: 2px solid var(--red-bg); }
.shift-log > div { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.shift-log .small:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) { .tl { --lw: 220px; } }
@media (max-width: 640px) { .lane-caps { display: none; } }
@media (max-width: 800px) {
  .cal-day { min-height: 64px; }
  .cal-events { display: none; }
  .cal-dots { display: flex; }
}
@media (max-width: 640px) {
  .tl { --lw: 118px; }
  .tl-label .small { display: none; }
  .tl-label { padding: 6px 8px; font-size: 12px; }
  .dl-row { grid-template-columns: 1fr 1fr; }
  .cal-head span { padding: 6px 4px; text-align: center; }
  .cal-day { padding: 4px; align-items: center; }
  .nav-label { order: 3; width: 100%; }
}

/* ---------------------------------------------------------------- jornada de trabalho */

.work-form { display: grid; gap: 12px; }
.day-toggles { display: flex; gap: 4px; flex-wrap: wrap; }
.day-toggle { position: relative; cursor: pointer; }
.day-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.day-toggle span {
  display: inline-grid; place-items: center; min-width: 42px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 12.5px; color: var(--muted); user-select: none;
}
.day-toggle input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 550; }
.day-toggle input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }

.day-prog { display: inline-flex; align-items: center; gap: 8px; }
.day-bar { display: inline-block; width: 64px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.day-bar i { display: block; height: 100%; background: var(--t-blue); border-radius: 2px; }
.day-bar i.full { background: var(--t-green); }

.rem-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--subtle); border: 1px solid var(--line); font-size: 12.5px;
}

/* ---------------------------------------------------------------- fase Lojas (aprovação App Store / Google Play) */

.ph-store, .mk-store { --ph: var(--t-teal); --ph-bg: var(--t-teal-bg); }
.ph-fill-store { --ph: var(--t-teal); }
.cal-dots i.ph-store { --ph: var(--t-teal); }
.ph-store i { border-radius: 2px; width: 9px; height: 7px; }
.mk-store { border-radius: 3px; width: 13px; height: 11px; }
.cal-ev.ph-store i { border-radius: 1px; width: 7px; }

.dl-auto { display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; padding-left: 2px; }
.dl-auto small { font-size: 11px; color: var(--faint); }
.store-row { background: var(--subtle); }
.store-row.off .ph, .store-row.off .dl-auto { opacity: .5; }
.store-toggle { margin-top: 3px; font-size: 11.5px; }
.store-toggle input { margin: 0; accent-color: var(--text); }
.split.split-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .split.split-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .split.split-4 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- ícone de fase (legenda = linha do tempo = card = calendário) */

.mk { display: inline-block; width: 14px; height: 14px; border-width: 2px; }
.mk-qa { width: 12px; height: 12px; border-radius: 2px; }
.mk-store { width: 15px; height: 12px; border-radius: 3px; }

.mk.sm { width: 12px; height: 12px; }
.mk-qa.sm { width: 10px; height: 10px; }
.mk-store.sm { width: 13px; height: 10px; }

.mk.xs { width: 9px; height: 9px; border-width: 1.5px; }
.mk-qa.xs { width: 7px; height: 7px; border-radius: 1.5px; }
.mk-store.xs { width: 10px; height: 8px; border-radius: 2px; }

.mk.static { display: inline-block; margin-right: 7px; vertical-align: middle; flex: none; }
.ph .mk.static { margin-right: 0; }
.ph { gap: 8px; }
.cal-ev .mk.xs { margin-right: 5px; vertical-align: -1px; }
.cal-dots { gap: 4px; align-items: center; }
.cal-dots .mk.static { margin: 0; }

/* marcadores na linha do tempo */

.tl-track .mk:hover { outline: 2px solid var(--ph); outline-offset: 2px; z-index: 4; }
.tl-track .mk.s-overdue:hover, .tl-track .mk.proj:hover { outline-color: var(--red); }

/* segmentos entre as fases, na cor da fase de destino */
.tl-seg { position: absolute; z-index: 1; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--ph); opacity: .35; }
.seg-backend { --ph: var(--t-blue); }
.seg-frontend { --ph: var(--t-purple); }
.seg-qa { --ph: var(--t-orange); }
.seg-store { --ph: var(--t-teal); background: repeating-linear-gradient(90deg, var(--ph) 0 5px, transparent 5px 9px); opacity: .75; }
.tl-seg.done { opacity: .85; }
.tl-seg.late { background: var(--red); opacity: .5; }
.tl-seg.base { height: 2px; margin-top: -1px; opacity: 1; background: repeating-linear-gradient(90deg, var(--line-strong) 0 5px, transparent 5px 9px); }

/* hoje em destaque no cabeçalho e realce da linha */
.tl-days span.today { color: var(--bg); background: var(--text); border-radius: 4px; margin: 0 1px; }
.tl-days span.today small { color: inherit; opacity: .75; }
.tl-days span.today:empty::after { content: "hoje"; font-size: 9px; }
.tl-row:hover .tl-track { background: color-mix(in srgb, var(--hover) 70%, transparent); }
.tl-row.two .tl-track .mk { box-sizing: border-box; }

/* ---------------------------------------------------------------- animações (sutis; desligam com "reduzir movimento") */

:root { --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1); }

@keyframes enter-up { from { opacity: 0; translate: 0 6px; } }
@keyframes enter-fade { from { opacity: 0; } }
@keyframes enter-pop { from { opacity: 0; scale: .4; } }
@keyframes grow-x { from { scale: 0 1; } }
@keyframes drawer-in { from { opacity: 0; translate: 28px 0; } }
@keyframes modal-in { from { opacity: 0; scale: .97; translate: 0 8px; } }
@keyframes toast-out { to { opacity: 0; translate: 0 6px; } }

/* transições de interação */
.btn, .nav a, .seg button, .input, .select, .deploy-row, .cal-day, .tl-label, .check-row, .picker-opt, .day-toggle span,
tbody tr td, .tl-track, button.foot-row, .tree-toggle, a.badge {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease, outline-color .15s ease;
}
.btn { transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease, scale .08s ease; }
.btn:active:not(:disabled) { scale: .97; }
.tree-toggle svg { transition: transform .18s var(--ease-out); }
.sidebar { transition: width .2s var(--ease-out); }

/* entrada de tela / página: blocos sobem com fade, linhas em cascata curta */
.anim-in > * { animation: enter-up .32s var(--ease-out) both; }
.anim-in > *:nth-child(2) { animation-delay: 30ms; }
.anim-in > *:nth-child(3) { animation-delay: 60ms; }
.anim-in > *:nth-child(4) { animation-delay: 90ms; }
.anim-in > *:nth-child(n + 5) { animation-delay: 120ms; }
.anim-in tbody tr, .anim-in .tl-row, .anim-in .list > .row, .anim-in .deploy-row, tr.row-in {
  animation: enter-fade .28s var(--ease-out) both;
  animation-delay: calc(80ms + var(--i, 0) * 18ms);
}
.table-wrap.anim-in > * { animation: none; }

/* linha do tempo: segmentos crescem da esquerda, marcadores surgem */
.anim-in .tl-seg { transform-origin: left center; animation: grow-x .5s var(--ease-out) both; animation-delay: calc(160ms + var(--i, 0) * 18ms); }
.anim-in .tl-track .mk { animation: enter-pop .35s var(--ease-spring) both; animation-delay: calc(260ms + var(--i, 0) * 18ms); }
.anim-in .tl-imp, .anim-in .tl-delay { animation: enter-fade .4s ease both; animation-delay: 300ms; }
.tl-seg { transform-origin: left center; }

/* barras de progresso se preenchem */
.anim-in .bar-fill, .anim-in .day-bar i { transform-origin: left center; animation: grow-x .6s var(--ease-out) both; animation-delay: 150ms; }

/* painel lateral e modal */
.drawer.enter { animation: drawer-in .24s var(--ease-out); }
.drawer.swap .drawer-head, .drawer.swap .drawer-body { animation: enter-fade .2s ease; }
.drawer-backdrop.enter { animation: enter-fade .2s ease; }
dialog[open] { animation: modal-in .2s var(--ease-out); }
dialog[open]::backdrop { animation: enter-fade .2s ease; }

/* avisos */
.toast { animation: enter-up .2s var(--ease-out); }
.toast.out { animation: toast-out .2s ease forwards; }

/* ponto "em andamento" mais suave */
.dot.run { animation: pulse 2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- legenda = mesmos elementos da linha do tempo */

.legend { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 14px; }
.legend-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.legend-group > b { min-width: 64px; font-size: 10.5px; font-weight: 550; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.legend-group > span { display: inline-flex; align-items: center; }
.lg-swatch { position: relative; display: inline-block; flex: none; width: 30px; height: 18px; margin-right: 7px; }
.lg-swatch.icon { width: 18px; }
.lg-swatch .tl-imp { top: 1px; bottom: 1px; }
.lg-swatch .tl-delay b { display: none; }
.metric-empty { font-size: 14px; font-weight: 400; color: var(--faint); }
@media (max-width: 640px) { .legend-group > b { width: 100%; } }

/* ---------------------------------------------------------------- linha única com impedimentos em evidência */

.tl-imp {
  top: 4px; bottom: 4px; z-index: 0; border-radius: 4px;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--red) 22%, transparent) 0 4px, transparent 4px 9px);
  border: 1px solid color-mix(in srgb, var(--red) 60%, transparent);
}
.tl-imp.open { border-right: 2px dashed var(--red); }
.tl-imp-label {
  position: absolute; top: -1px; left: -1px; z-index: 3; padding: 1px 6px; border-radius: 4px 0 4px 0;
  font-size: 10px; font-weight: 600; line-height: 1.5; white-space: nowrap; color: #fff; background: var(--red);
}
.tl-row.blocked .tl-label { box-shadow: inset 3px 0 0 var(--red) !important; }
.tl-delay { top: calc(50% + 11px); height: 2px; }
.tl-delay b { bottom: auto; top: -7px; right: -4px; transform: translateX(100%); }

/* ---------------------------------------------------------------- linha do tempo limpa: cor só nos ícones */

.tl-seg, .tl-seg.late { height: 2px; margin-top: -1px; opacity: 1; background: var(--line-strong); }
.tl-seg.done { background: var(--faint); }
.tl-seg.seg-store { background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px); }
.mk.proj { border-style: solid; border-color: var(--ph); background: var(--bg); }
.tl-delay { display: none; }

.tl-chip {
  position: absolute; top: 50%; z-index: 3; margin-left: 14px; translate: 0 -50%;
  padding: 0 6px; border-radius: 4px; font-size: 10.5px; font-weight: 600; line-height: 17px; white-space: nowrap;
  color: var(--red); background: var(--red-bg);
}
.tl-chip.left { margin-left: -14px; translate: -100% -50%; }

.tl-imp {
  top: 5px; bottom: 5px; border-radius: 4px;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--red) 14%, transparent) 0 3px, transparent 3px 7px);
  border: 1px solid color-mix(in srgb, var(--red) 40%, transparent);
}
.tl-imp.open { border-right: 1px dashed var(--red); }
.tl-imp-label {
  top: -8px; left: -1px; padding: 0 6px; border-radius: 4px; line-height: 16px; font-weight: 600;
  color: var(--red); background: var(--red-bg); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent);
}
.tl-imp { top: 4px; bottom: 4px; }
.tl-imp-label { top: 3px; left: 3px; padding: 0 5px; line-height: 15px; font-size: 10px; }

/* trecho entre duas fases já entregues fica verde */
.tl-seg.done { height: 3px; margin-top: -1.5px; background: var(--t-green); }

/* ---------------------------------------------------------------- ordenação por coluna */

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); background: var(--hover); }
th.sorted { color: var(--text); }
.sort-ind { display: inline-block; margin-left: 5px; font-size: 9px; opacity: 0; transition: opacity .15s; vertical-align: 1px; }
th.sortable:hover .sort-ind { opacity: .5; }
th.sorted .sort-ind { opacity: 1; }
th.num.sortable .sort-ind { margin-left: 3px; }

/* horários do deploy */
.deploy-times { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; }
.deploy-times b { font-weight: 600; }
.deploy-times .badge .dot { margin-right: 2px; }

/* rótulo de tipo cortado com reticências quando a coluna é estreita */
.type { max-width: 100%; min-width: 0; }
.type i { flex: none; }
.type-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------------------------------------------------------------- filtros da tela Itens */

.toolbar + .toolbar { margin-top: -6px; }
.count-pill {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 2px;
  border-radius: 9px; font-size: 10.5px; font-weight: 600; background: var(--text); color: var(--bg);
}
.btn-active { border-color: var(--text); }
.caret { font-size: 9px; color: var(--muted); }
.seg-off { opacity: .45; }
.seg-sm button { height: 30px; padding: 0 9px; font-size: 12px; }

.pop-wrap { position: relative; }
.popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 280px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px;
  animation: enter-up .16s var(--ease-out);
}
.popover-list { padding: 4px 0; }
.popover-list .check-row { padding: 6px 12px; border: 0; }
.popover-foot { display: flex; justify-content: space-between; padding: 8px 10px; border-top: 1px solid var(--line); }

.date-filter { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.date-filter .input[type=date] { width: 138px; }

@media (max-width: 640px) {
  .date-filter { width: 100%; }
  .date-filter .input[type=date] { flex: 1 1 120px; width: auto; }
  .popover { width: min(280px, calc(100vw - 32px)); }
}

/* barra de filtros: seletores com largura limitada e ações sempre juntas */
.toolbar .select { max-width: 210px; text-overflow: ellipsis; }
.tb-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
@media (max-width: 640px) { .toolbar .select { max-width: none; } }

/* celular: campos da barra de filtros encolhem para caber na largura */
@media (max-width: 640px) {
  .toolbar .select, .toolbar .input { min-width: 0; flex: 1 1 140px; }
  .toolbar .input.search { flex-basis: 100%; }
  .date-filter .select { flex-basis: 100%; }
  .date-filter .input[type=date] { min-width: 0; flex: 1 1 0; }
  .date-filter .seg { width: 100%; }
  .date-filter .seg button { flex: 1; }
  .tb-actions { width: 100%; justify-content: flex-end; }
  .toolbar > .seg:not(.seg-sm) { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------- Painel: atividades de cada dev */

.dev-tasks { grid-column: 2 / -1; margin-top: 2px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dev-tasks.empty-tasks { border-style: dashed; padding: 8px 12px; }
.dt-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px;
  padding: 2px 6px 2px 12px; background: var(--subtle); font-size: 12px; color: var(--muted); font-weight: 500;
}
.dev-task {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) 74px 92px; align-items: center; gap: 10px;
  padding: 6px 8px 6px 12px; border-top: 1px solid var(--line); font-size: 13px;
}
.dev-task:hover { background: var(--hover); }
.dev-task.now { background: color-mix(in srgb, var(--green-bg) 70%, transparent); }
.dev-task.paused { background: color-mix(in srgb, var(--amber-bg) 70%, transparent); }
.dt-state { min-width: 0; }
.dt-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.dt-main a { text-decoration: none; }
.dt-main a:hover { text-decoration: underline; }
.dt-hours { text-align: right; font-variant-numeric: tabular-nums; }
.dt-act { display: flex; justify-content: flex-end; }
.dt-tag { color: var(--amber); font-weight: 600; }

@media (max-width: 900px) {
  .dev-tasks { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .dev-task { grid-template-columns: minmax(0, 1fr) auto; }
  .dt-state, .dt-hours { display: none; }
}
/* atividades já em QA/deploy: fora da mão do dev, ficam no fim e esmaecidas */
.dev-task.later { opacity: .6; }
.dev-task.later:hover { opacity: 1; }
.dev-task.paused .dt-main .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- aba Time */

.team-dev { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.team-dev a { text-decoration: none; min-width: 0; }
.team-dev a:hover { text-decoration: underline; }
.team-dev .avatar { flex: none; }

.util { display: inline-flex; align-items: center; gap: 8px; width: 100%; }
.util-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.util-bar i { display: block; height: 100%; border-radius: 3px; background: var(--chart-bar); }
.util-bar i.full { background: var(--t-green); }
.util-pct { width: 38px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }

/* gráfico de barras: horas do time por dia */
.team-chart { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 16px 16px 10px; }
.bc-y { display: flex; flex-direction: column; justify-content: space-between; height: 180px; font-size: 11px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.bc-area { position: relative; min-width: 0; }
.bc-cols { display: grid; gap: 2px; height: 180px; align-items: end; border-bottom: 1px solid var(--line-strong); }
.bc { position: relative; display: flex; flex-direction: column; height: 100%; outline: none; }
.bc-plot { position: relative; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.bc.off .bc-plot { background: var(--subtle); }
.bc-bar {
  width: min(70%, 26px); min-height: 2px; background: var(--chart-bar); border-radius: 4px 4px 0 0;
}
.anim-in .bc-bar { transform-origin: bottom; animation: grow-y .5s var(--ease-out) both; animation-delay: calc(120ms + var(--i, 0) * 12ms); }
@keyframes grow-y { from { scale: 1 0; } }
.bc:hover .bc-plot, .bc:focus .bc-plot { background: var(--hover); }
.bc:hover .bc-bar, .bc:focus .bc-bar { filter: brightness(1.12); }
.bc-x { position: absolute; top: calc(100% + 4px); left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.bc.today .bc-x { color: var(--text); font-weight: 650; }
.bc-tip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; translate: -50% 0; z-index: 5;
  padding: 5px 8px; border-radius: 6px; font-size: 11.5px; white-space: nowrap;
  background: var(--text); color: var(--bg); pointer-events: none;
}
.bc:hover .bc-tip, .bc:focus .bc-tip { display: block; }
.bc:first-child .bc-tip, .bc:nth-child(2) .bc-tip { left: 0; translate: 0 0; }
.bc:last-child .bc-tip, .bc:nth-last-child(2) .bc-tip { left: auto; right: 0; translate: 0 0; }
.bc-cap { position: absolute; left: 0; right: 0; z-index: 2; border-top: 1.5px dashed var(--muted); pointer-events: none; }
.bc-cap span { position: absolute; right: 0; bottom: 2px; font-size: 10.5px; color: var(--muted); background: var(--bg); padding: 0 4px; border-radius: 3px; }
.team-chart { padding-bottom: 28px; }
.bc-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 13px; pointer-events: none; }

/* ---------------------------------------------------------------- escritas no Azure */

.write-note { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: var(--radius); background: var(--blue-bg); font-size: 12.5px; }
.write-note svg { flex: none; margin-top: 3px; color: var(--blue); }
.state-list .check-row { padding: 7px 12px; }
.state-btn { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 4px; max-width: 100%; }
.state-btn:hover .badge { outline: 1px solid currentColor; }

/* casos de teste */
.test-count { font-size: 11px; background: var(--t-purple-bg); color: var(--t-purple); border-color: transparent; }
.test-link { text-decoration: none; }
.test-link:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- aba Testes */

.case-pill { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; font-size: 11.5px; line-height: 18px; white-space: nowrap; }
.case-design { background: var(--t-purple-bg); color: var(--t-purple); }
.case-ready { background: var(--t-indigo-bg); color: var(--t-indigo); }
.case-closed { background: var(--t-green-bg); color: var(--t-green); }
.bar-fill.case-fill-design { background: var(--t-purple); }
.bar-fill.case-fill-ready { background: var(--t-indigo); }
.bar-fill.case-fill-closed { background: var(--t-green); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; gap: 6px; align-items: center; max-width: 100%; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--amber-bg); font-size: 12.5px; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip:hover { border-color: var(--amber); }
.split.split-qa { grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 900px) { .split.split-qa { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- login e usuários */
.foot-user { display: flex; align-items: center; gap: 8px; padding: 8px 4px 0 10px; margin-top: 4px; border-top: 1px solid var(--line); min-width: 0; }
.foot-me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font-size: 12.5px; }
.foot-me .label { min-width: 0; line-height: 1.25; }
.foot-user-actions { display: flex; gap: 2px; flex: none; }
.sidebar.collapsed .foot-user { flex-direction: column; padding: 8px 0 0; }
.sidebar.collapsed .foot-me { flex: none; }

.row-actions { display: inline-flex; gap: 2px; justify-content: flex-end; flex-wrap: wrap; }
.secret-box { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--subtle); }
.secret-box .mono { font-size: 15px; margin-top: 2px; word-break: break-all; }
.secret-box .secret { font-weight: 600; letter-spacing: .02em; }

/* leitor: nada que altere dados aparece */
body[data-role="leitor"] :is([data-act="work"], [data-act="dev-start"], [data-act="stop"], [data-act="resume"], [data-act="close-int"],
  [data-act="edit-int"], [data-act="del-int"], [data-act="new-imp"], [data-act="resolve-imp"], [data-act="del-imp"], [data-act="new-local"],
  [data-act="new-entry"], [data-act="edit-entry"], [data-act="del-entry"], [data-act="new-deploy"], [data-act="edit-deploy"], [data-act="del-deploy"],
  [data-act="deploy-status"], [data-act="deploy-add"], [data-act="deploy-remove"], [data-act="phase-done"], [data-act="shift-deadlines"],
  [data-act="rebase-deadlines"], [data-act="item-deploy"], [data-act="change-state"], [data-act="new-task"]) { display: none !important; }
body[data-role="leitor"] .dl-date { pointer-events: none; background: transparent; border-color: transparent; }
/* sem permissão de escrever no Azure */
body.no-azure-write :is([data-act="change-state"], [data-act="new-task"]) { display: none !important; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth-card { width: 100%; max-width: 360px; display: grid; gap: 28px; animation: auth-in .35s ease both; }
.auth-card .brand { font-size: 17px; }
.auth-form { display: grid; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, var(--bg)); }
.auth-form[hidden] { display: none; }
.auth-form h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -0.02em; }
.auth-form p { margin: 0; }
.auth-form .btn.primary { justify-content: center; height: 36px; }
.auth-form .field[hidden] { display: none; }
.auth-error { color: var(--red); background: var(--red-bg); padding: 8px 12px; border-radius: var(--radius); font-size: 13px; }
.auth-error[hidden] { display: none; }
@keyframes auth-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .auth-card { animation: none; } }
body[data-role="leitor"] .drawer :is(input, select, textarea) { pointer-events: none; opacity: .7; }

/* ---------------------------------------------------------------- avisos */
.head-actions { display: flex; align-items: center; gap: 2px; }
.bell { position: relative; }
.bell.on { background: var(--hover); }
.bell-count { position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 9.5px; font-weight: 650; line-height: 15px; text-align: center; animation: pop-in .25s ease; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } }
.sidebar.collapsed .sidebar-head { height: auto; padding: 12px 0; }
.sidebar.collapsed .head-actions { flex-direction: column; }

.notif-panel { position: fixed; z-index: 60; width: 380px; max-width: calc(100vw - 16px); max-height: min(560px, calc(100vh - 16px)); display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; animation: rise .18s ease; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.notif-enable { display: flex; align-items: center; gap: 10px; margin: 10px 12px 0; padding: 8px 12px; border-radius: var(--radius); background: var(--blue-bg); color: var(--blue); font-size: 12.5px; text-align: left; border: 0; cursor: pointer; }
.notif-enable svg { flex: none; }
.notif-list { overflow-y: auto; padding: 6px; display: grid; gap: 2px; }
.notif { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: var(--radius); color: inherit; text-decoration: none; font-size: 13px; line-height: 1.4; position: relative; }
.notif:hover { background: var(--hover); }
.notif.unread { background: var(--blue-bg); }
.notif.unread::after { content: ""; position: absolute; top: 14px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.notif-body { display: grid; gap: 2px; min-width: 0; padding-right: 12px; overflow-wrap: anywhere; }
.notif .avatar { flex: none; }
.notif-empty { padding: 24px 12px; text-align: center; }
.notif-foot { padding: 10px 16px; border-top: 1px solid var(--line); }
.toast.notice { max-width: 420px; }
@media (prefers-reduced-motion: reduce) { .notif-panel, .bell-count { animation: none; } }
