/* Painel Jira — visual limpo: fundo claro, linhas finas, cantos arredondados, Inter. */
:root {
  --page: #f6f7f9;
  --surface: #ffffff;
  --ink: #0f1729;
  --ink-2: #4b5468;
  --muted: #8a92a3;
  --hairline: #e6e8ee;
  --grid: #eceef2;
  --navy: #10203f;

  /* séries dos gráficos (paleta validada: azul/laranja) */
  --s-done: #2a78d6;
  --s-open: #eb6834;
  --s-wash: rgba(42, 120, 214, .10);

  /* status (sempre com ícone + texto) */
  --good: #0a7d0a;
  --good-bg: #e9f6e9;
  --warn: #9a6200;
  --warn-bg: #fff5de;
  --bad: #c03131;
  --bad-bg: #fdecec;
  --info: #2b5797;
  --info-bg: #eaf1fb;

  /* identidade de cada quadro */
  --codad: #4a3aa7;
  --codad-soft: #efedfb;
  --cosin: #0f7c74;
  --cosin-soft: #e3f4f2;
  --accent: var(--navy);
  --accent-soft: #eef1f7;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 63, .04), 0 4px 16px rgba(16, 32, 63, .04);
}
body[data-board="codad"] { --accent: var(--codad); --accent-soft: var(--codad-soft); }
body[data-board="cosin"] { --accent: var(--cosin); --accent-soft: var(--cosin-soft); }

html, body { background: var(--page); }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }

/* ---------- topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1020;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner {
  max-width: 1400px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-size: 16px;
}
.brand-name { font-weight: 500; }
.board-switch {
  display: flex; padding: 4px; gap: 4px; margin: 0 auto;
  background: #eef0f4; border-radius: 12px;
}
.board-switch a {
  min-width: 132px; text-align: center; padding: 9px 22px; border-radius: 9px;
  font-weight: 800; letter-spacing: .06em; font-size: 15px;
  color: var(--ink-2); text-decoration: none; transition: background .15s, color .15s;
}
.board-switch a:hover { background: #fff; color: var(--ink); }
.board-switch a.active { color: #fff; box-shadow: 0 2px 8px rgba(16, 32, 63, .18); }
.board-switch a.bs-codad.active { background: var(--codad); }
.board-switch a.bs-cosin.active { background: var(--cosin); }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.year-form select { width: 170px; border-radius: 9px; }
.user-btn { border: 0; background: none; padding: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none;
  display: inline-grid; place-items: center; font-weight: 600; font-size: 13px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--hairline);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 48px; height: 48px; font-size: 17px; }

/* ---------- cartões ---------- */
.card-soft {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px;
}
.card-title-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.card-title-row h3, .section-title { font-size: 15px; font-weight: 700; margin: 0; }
.section-title { margin-bottom: 10px; }
.section-title span { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 6px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- cabeçalho do painel ---------- */
.dash { padding-top: 22px; padding-bottom: 24px; }
.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.dash-head h1 { font-size: 34px; font-weight: 800; margin: 2px 0 2px; color: var(--accent); letter-spacing: -.01em; }
.dash-head h1 span { color: var(--ink); font-weight: 600; }
.dash-head .sub { color: var(--ink-2); margin: 0; }
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink-2);
}
.sync-pill.ok i { color: var(--good); }
.sync-pill.stale i { color: var(--warn); }

/* ---------- sprint atual ---------- */
.current { border-top: 4px solid var(--accent); }
.current-name { font-size: 22px; font-weight: 800; margin: 2px 0 2px; }
.days-left { text-align: center; background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 8px 12px; line-height: 1.1; }
.days-left b { display: block; font-size: 30px; font-weight: 800; }
.days-left span { font-size: 11px; font-weight: 600; }
.progress-block { margin: 18px 0 14px; }
.pbar { position: relative; height: 12px; border-radius: 6px; background: #e9eef8; }
.pbar-fill { height: 100%; width: var(--w); background: var(--s-done); border-radius: 6px; }
.pbar-time {
  position: absolute; top: -4px; bottom: -4px; left: var(--x); width: 2px; background: var(--ink);
  border-radius: 1px;
}
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; border-top: 1px solid var(--hairline); padding-top: 12px; }
.mini-stats b { display: block; font-size: 19px; font-weight: 700; }
.mini-stats span { font-size: 12px; color: var(--ink-2); line-height: 1.2; display: block; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.kpi-label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; margin: 4px 0 4px; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-foot { font-size: 12px; color: var(--ink-2); }
.delta { font-size: 12px; font-weight: 600; display: inline-flex; gap: 3px; align-items: center; white-space: nowrap; }
.delta span { font-weight: 400; color: var(--ink-2); }
.delta.good { color: var(--good); }
.delta.bad { color: var(--bad); }
.delta.flat { color: var(--ink-2); }

/* ---------- gráficos ---------- */
.chart-box { position: relative; height: 240px; }
.chart-box.tall { height: 300px; }
.chart-note { font-size: 12px; color: var(--ink-2); background: var(--info-bg); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }

/* ---------- insights ---------- */
.insights { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.insights li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.35; padding: 9px 11px; border-radius: 10px; }
.insights li i { font-size: 16px; line-height: 1.2; }
.ins-bad { background: var(--bad-bg); } .ins-bad i { color: var(--bad); }
.ins-warn { background: var(--warn-bg); } .ins-warn i { color: var(--warn); }
.ins-info { background: var(--info-bg); } .ins-info i { color: var(--info); }
.ins-good { background: var(--good-bg); } .ins-good i { color: var(--good); }

/* ---------- comparação ---------- */
.compare th, .compare td { padding: 7px 4px; border-color: var(--hairline); font-size: 14px; }
.compare thead th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.compare tbody th { font-weight: 500; color: var(--ink-2); }
.compare .arrow { color: var(--muted); }
.prev-year { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }

/* ---------- quadro de honra ---------- */
.ranks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.rank { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); border-top: 3px solid; }
.rank.good { border-top-color: var(--good); }
.rank.bad { border-top-color: var(--bad); }
.rank-title { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.rank.good .rank-title i { color: var(--good); }
.rank.bad .rank-title i { color: var(--bad); }
.rank-name { font-size: 16px; font-weight: 700; margin: 6px 0 2px; }
.rank-val { font-size: 13px; color: var(--ink-2); }

/* ---------- histórias longas ---------- */
.long-list { list-style: none; padding: 0; margin: 0; }
.long-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--hairline); align-items: center; }
.long-main { min-width: 0; display: flex; gap: 8px; align-items: baseline; }
.long-main .key { font-weight: 700; font-size: 13px; white-space: nowrap; text-decoration: none; }
.long-sum { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.long-meta { display: flex; gap: 10px; align-items: center; white-space: nowrap; font-size: 13px; }
.trail { display: inline-flex; gap: 3px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grid); display: inline-block; }
.dot.on { background: var(--s-open); }
.dot.done { background: var(--good); }
.trail-legend { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }

/* ---------- barras horizontais ---------- */
.hbars { display: grid; gap: 6px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 44px; gap: 8px; align-items: center; font-size: 13px; }
.hb-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.hb-track { height: 10px; background: #f0f2f6; border-radius: 5px; }
.hb-fill { display: block; height: 100%; width: var(--w); background: var(--s-done); border-radius: 5px; }
.hbar.over .hb-fill { background: var(--s-open); }
.hbar.over b i { color: var(--bad); }
.quality { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.q-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.q-grid b { display: block; font-size: 18px; }
.q-grid span { font-size: 12px; color: var(--ink-2); line-height: 1.2; display: block; }

/* ---------- metas ---------- */
.targets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.target { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.target-row { display: flex; align-items: center; gap: 14px; margin: 6px 0; }
.target-row span { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.target-row b { font-size: 24px; font-weight: 700; }
.target-row i { color: var(--muted); }
.target-now { font-size: 13px; margin-bottom: 4px; }
.target.hit .target-now i { color: var(--good); }
.target.miss .target-now i { color: var(--bad); }

/* ---------- tabela ---------- */
.table-details summary { cursor: pointer; list-style: none; }
.table-details summary h3 { font-size: 15px; font-weight: 700; }
.sprint-table { font-size: 13px; font-variant-numeric: tabular-nums; }
.sprint-table th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.sprint-table tr.is-active td { background: var(--accent-soft); }
.dash-foot { font-size: 12px; color: var(--muted); border-top: 1px solid var(--hairline); padding-top: 12px; }

/* ---------- landing / acesso / docs ---------- */
.page-landing { background: radial-gradient(1200px 500px at 50% -10%, #e4e9f5 0%, var(--page) 60%); }
.landing { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 24px; }
.landing-card {
  width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 18px; box-shadow: 0 10px 40px rgba(16, 32, 63, .08); padding: 32px; text-align: center;
}
.landing-mark { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 14px; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 26px; }
.landing h1 { font-size: 30px; font-weight: 500; }
.landing .lead { font-size: 16px; color: var(--ink-2); }
.login-box { margin: 22px 0; display: flex; flex-direction: column; align-items: center; min-height: 44px; }
.login-box .d-grid { width: 100%; }
.steps { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-2); }
.steps span { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--navy); font-weight: 700; font-size: 12px; display: grid; place-items: center; flex: none; }
.state-box { text-align: center; padding: 8px 0; }
.state-box > i { font-size: 34px; color: var(--navy); }
.site-footer { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 16px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.doc { max-width: 760px; margin: 0 auto; padding: 32px 16px; }
.doc h1 { font-weight: 800; }
.doc h2 { font-size: 18px; font-weight: 700; margin-top: 24px; }
.doc-back { text-decoration: none; display: inline-block; margin-bottom: 16px; color: var(--ink-2); }
.empty { text-align: center; padding: 48px 16px; color: var(--ink-2); }
.empty i { font-size: 36px; color: var(--muted); }

/* ---------- admin ---------- */
.table-users th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.table-users td { border-color: var(--hairline); }
.sync-list li { padding: 3px 0; }

/* ---------- responsivo ---------- */
@media (max-width: 1199px) {
  .kpis, .ranks { grid-template-columns: repeat(3, 1fr); }
  .targets { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px; }
  .brand-name { display: none; }
  .board-switch { order: 3; width: 100%; }
  .board-switch a { flex: 1; min-width: 0; padding: 8px 6px; }
  .topbar-right { margin-left: auto; }
  .year-form select { width: 150px; }
  .dash-head h1 { font-size: 26px; }
  .kpis, .ranks, .targets { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 24px; }
  .mini-stats, .q-grid { grid-template-columns: repeat(2, 1fr); }
  .long-list li { flex-direction: column; align-items: flex-start; gap: 4px; }
  .long-main { width: 100%; }
  .hbar { grid-template-columns: 100px 1fr 40px; }
  .chart-box.tall { height: 260px; }
  .table-users thead { display: none; }
  .table-users tr { display: block; border-bottom: 1px solid var(--hairline); padding: 8px 0; }
  .table-users td { display: flex; gap: 8px; justify-content: space-between; border: 0; padding: 4px 0; text-align: left !important; }
  .table-users td::before { content: attr(data-label); font-size: 12px; color: var(--muted); }
  .landing-card { padding: 24px 20px; }
}
