/* ═══════════════════════════════════════════════
   BASE.CSS — variáveis, reset, layout, login, nav
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Variáveis ──────────────────────────────── */
:root {
  --bg:       #fff7ef;
  --surface:  #ffffff;
  --surface2: #fff7f0;
  --surface3: #fff1e3;
  --border:   #f2dcc7;
  --border2:  #e8c8a4;

  --orange:     #ff8a1f;
  --orange-d:   #f36b12;
  --orange-dim: rgba(255,138,31,.12);
  --orange-glow:rgba(255,138,31,.24);

  --green:  #34d399;
  --red:    #f87171;
  --blue:   #60a5fa;
  --yellow: #eab308;
  --danger: #f87171;  /* alias de --red para compatibilidade */

  --t1: #23140b;
  --t2: #7b5f4c;
  --t3: #a17d62;

  --sans: 'Sora', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --r:  8px;
  --r2: 12px;
  --r3: 16px;

  --sidebar-w: 220px;
  --topbar-h:  56px;
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: linear-gradient(180deg, #fff9f4 0%, #fff3e8 100%);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font-family: var(--sans); cursor: pointer; }
input, select, textarea { font-family: var(--sans); }
a { color: inherit; text-decoration: none; }

/* ── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d9b390; border-radius: 2px; }

/* ── Login ──────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(245,166,35,.06) 0%, transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r3);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.login-header {
  padding: 32px 36px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(160deg, #1a1a1a 0%, #161616 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.login-logo { display: flex; align-items: center; gap: 10px; }
.login-logo svg { width: 40px; height: 40px; }
.login-wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: .04em;
}
.login-wordmark .bit { color: var(--t1); }
.login-wordmark .way { color: var(--orange); }
.login-sub {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--t3);
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}
.login-tagline { font-size: 12px; color: var(--t3); letter-spacing: .02em; }
.login-body { padding: 28px 36px 32px; }
.login-body h2 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.login-body p  { font-size: 12px; color: var(--t2); margin-bottom: 22px; }
.login-error {
  display: none;
  color: var(--red);
  font-size: 12px;
  margin-top: 10px;
  padding: 9px 14px;
  background: rgba(248,113,113,.07);
  border: 1px solid rgba(248,113,113,.18);
  border-radius: var(--r);
}

/* ── Field ──────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label {
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.field input {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 10px 13px;
  font-size: 13px;
  color: var(--t1);
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--orange); }
.field-hint  { font-size: 11px; color: var(--t3); }
.field-error { font-size: 11px; color: var(--red); display: none; margin-top: 2px; }

/* ── Botões ─────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-d) 100%);
  color: #111;
  border: none;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  box-shadow: 0 4px 20px var(--orange-glow);
}
.btn-primary:hover  { opacity: .9; }
.btn-primary:active { transform: scale(.98); }

.btn-orange {
  background: var(--orange);
  color: #111;
  border: none;
  border-radius: var(--r);
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  transition: opacity .15s;
}
.btn-orange:hover { opacity: .85; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--t2);
  border-radius: var(--r);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--t3); color: var(--t1); }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--t2);
  width: 32px;
  height: 32px;
  border-radius: var(--r);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: border-color .15s, color .15s;
}
.btn-icon:hover       { border-color: var(--orange); color: var(--orange); }
.btn-icon.danger:hover{ border-color: var(--red);    color: var(--red); }

.btn-nav {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--t2);
  width: 30px;
  height: 30px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, color .15s;
}
.btn-nav:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); }
.btn-nav:disabled { opacity: .3; cursor: default; }

/* ── App layout ─────────────────────────────── */
#app {
  display: none;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 200;
  box-shadow: 0 1px 0 var(--border);
}
.topbar-logo { display: flex; align-items: center; gap: 9px; }
.topbar-logo svg { width: 28px; height: 28px; }
.topbar-wordmark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
  line-height: 1;
}
.topbar-wordmark .bit { color: var(--t1); }
.topbar-wordmark .way { color: var(--orange); }
.topbar-sub {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--t3);
  text-transform: uppercase;
  display: block;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-user {
  font-size: 11px;
  color: var(--t2);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 20px;
  font-weight: 500;
}
.topbar-role {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--orange);
  text-transform: uppercase;
  padding: 2px 8px;
  background: var(--orange-dim);
  border: 1px solid rgba(245,166,35,.2);
  border-radius: 20px;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 0 20px;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-section {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--t3);
  text-transform: uppercase;
  padding: 0 16px;
  margin: 16px 0 6px;
}
.sidebar-section:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--t2);
  cursor: pointer;
  border-radius: 0;
  transition: background .12s, color .12s;
  position: relative;
  margin: 1px 8px;
  border-radius: var(--r);
}
.nav-item:hover { background: var(--surface2); color: var(--t1); }
.nav-item.active {
  background: var(--orange-dim);
  color: var(--orange);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--orange);
  border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 12px 16px 0;
  border-top: 1px solid var(--border);
}
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
}
.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--orange-dim);
  border: 1.5px solid var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  flex-shrink: 0;
  font-family: var(--mono);
}
.sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--t1); }
.sidebar-user-role { font-size: 10px; color: var(--t3); font-weight: 500; }

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px 32px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Controles ──────────────────────────────── */
.date-input, .squad-filter {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--t1);
  border-radius: var(--r);
  padding: 7px 11px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
}
.date-input:focus, .squad-filter:focus { border-color: var(--orange); }
.squad-filter option { background: var(--surface2); }

/* ── Animações ──────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse-risk {
  0%, 100% { opacity: 1; }
  50%       { opacity: .6; }
}
@keyframes drawerSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel { animation: fadeUp .2s ease; }

/* ── Loading / Empty ────────────────────────── */
.state-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 64px;
  color: var(--t3);
  font-size: 13px;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.state-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 24px;
  color: var(--t3);
  gap: 10px;
  text-align: center;
}
.state-empty .icon { font-size: 36px; opacity: .3; }
.state-empty p { font-size: 13px; }

/* ── Page layout ────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--t1);
}
.page-title em { font-style: normal; color: var(--t3); font-weight: 400; font-size: 14px; }
.page-sub { font-size: 12px; color: var(--t3); margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section-bar:first-child { margin-top: 0; }
.section-bar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--t2);
}
.section-bar-meta { font-size: 11px; color: var(--t3); }

/* ── Alert banner ───────────────────────────── */
.alert-banner {
  background: rgba(248,113,113,.06);
  border: 1px solid rgba(248,113,113,.15);
  border-left: 3px solid var(--red);
  border-radius: var(--r);
  padding: 11px 16px;
  margin-bottom: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.alert-banner em { font-style: normal; font-weight: 600; }

/* ── Modal ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 24px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  animation: drawerSlide .18s ease;
}
.modal-header {
  background: var(--surface2);
  border-bottom: 2px solid var(--orange);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.modal-body   { padding: 22px; }
.modal-footer {
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-danger:hover { opacity: .85; }
.btn-confirm {
  background: linear-gradient(135deg, var(--orange), var(--orange-d));
  color: #111;
  border: none;
  border-radius: var(--r);
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.btn-confirm:hover { opacity: .88; }

/* ── Misc ───────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.env-box {
  background: var(--surface3);
  border: 1px solid rgba(245,166,35,.15);
  border-radius: var(--r);
  padding: 14px;
  margin-top: 12px;
}
.env-box code {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
  word-break: break-all;
  margin: 8px 0;
  line-height: 1.6;
}
.btn-copy {
  background: var(--orange);
  border: none;
  color: #111;
  padding: 4px 12px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Responsivo ─────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main-content { padding: 20px 16px; }
}

/* ── Complementos de layout (v8) ────────────── */

/* Layout raiz */
.main-area {
  flex: 1;
  overflow-y: auto;
  min-height: 100vh;
}
.main-content {
  padding: 28px 32px;
  max-width: 1280px;
  margin: 0 auto;
}

/* Sidebar extras */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sidebar-brand {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .02em;
}
.sidebar-brand-sub {
  font-size: 9px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-top: 1px;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px;
}
.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 8px 8px 4px;
  margin-top: 4px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.sidebar-user-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-d), var(--orange));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #111;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10px;
  color: var(--orange);
  font-weight: 500;
}

/* Login extras */
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-brand {
  display: flex;
  flex-direction: column;
}
.login-brand-name {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1;
}
.login-brand-sub {
  font-size: 9px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-top: 2px;
}

/* Botão ícone pequeno */
.btn-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--t3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.btn-icon-sm:hover { border-color: var(--red); color: var(--red); }


/* v9 internal polish */
.btn-orange, .btn-confirm {
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(255,138,31,.18);
}
.btn-ghost, .btn-nav, .btn-icon {
  border-radius: 14px;
  background: rgba(255,255,255,.86);
}
.date-input, .squad-filter, .field input, textarea, select {
  border-radius: 14px;
}
.alert-banner {
  background: linear-gradient(180deg, rgba(255,245,241,.95) 0%, rgba(255,250,247,.95) 100%);
  border-radius: 18px;
}
.state-empty {
  background: linear-gradient(180deg, rgba(255,250,245,.9) 0%, rgba(255,245,236,.9) 100%);
  border: 1px dashed rgba(255,145,45,.20);
  border-radius: 22px;
}
.state-empty .icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: rgba(255,145,45,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  opacity: 1;
  color: #cb6e12;
}

/* ═══════════════════════════════════════════════
   METRICS — Estilos segmentados por role
   role-context-bar, executive, client, contributor
═══════════════════════════════════════════════ */

/* ── Role context bar ─────────────────────────────────────────────────────── */
.role-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #fff8f1;
  border: 1px solid rgba(232,200,164,.6);
  border-radius: var(--r1);
  margin-bottom: 18px;
  font-size: 11px;
}
.rcb-left     { display: flex; align-items: center; gap: 8px; }
.rcb-badge    { font-weight: 800; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.rcb-label    { color: var(--t2); font-weight: 600; }
.rcb-scope    { color: var(--orange); font-weight: 700; }
.rcb-user     { color: var(--t2); font-weight: 600; }
.rcb-squad-name { color: var(--orange); font-weight: 700; }

/* ── Trend chips ──────────────────────────────────────────────────────────── */
.trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  font-family: var(--mono);
}
.trend-up     { background: rgba(80,185,120,.12); color: var(--green); }
.trend-down   { background: rgba(220,80,60,.10);  color: var(--red); }
.trend-stable { background: rgba(150,140,130,.10); color: var(--t2); }

/* ── Risk pills e risk bar ────────────────────────────────────────────────── */
.risk-pill {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  white-space: nowrap;
}
.risk-bar-wrap {
  flex: 1;
  height: 4px;
  background: rgba(232,200,164,.4);
  border-radius: 2px;
  overflow: hidden;
  min-width: 60px;
  max-width: 120px;
}
.risk-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .4s ease;
}

/* ── Executive squad list ─────────────────────────────────────────────────── */
.exec-squad-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}
.exec-squad-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid rgba(232,200,164,.7);
  border-radius: var(--r1);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.exec-squad-row:hover,
.exec-squad-row.esr--active {
  border-color: var(--orange);
  box-shadow: 0 1px 6px rgba(200,120,40,.12);
}
.esr-name   { font-weight: 700; font-size: 13px; color: var(--t1); min-width: 140px; flex-shrink: 0; }
.esr-stats  { display: flex; align-items: center; gap: 12px; flex: 1; font-size: 11px; color: var(--t2); flex-wrap: wrap; }
.esr-risk   { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ── Metric card variants ─────────────────────────────────────────────────── */
.metric-card--exec::before   { background: var(--orange); }
.metric-card--pending        { opacity: .7; }
.metric-card--pending::before { background: var(--border2); }
.pending-sub { color: var(--t3) !important; font-style: italic; }

/* ── Client health banner ─────────────────────────────────────────────────── */
.client-health-banner {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #fff;
  border: 1px solid rgba(232,200,164,.8);
  border-radius: var(--r2);
  padding: 0;
  margin-bottom: 22px;
  overflow: hidden;
}
.chb-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 28px;
  background: #fff8f1;
  border-right: 1px solid rgba(232,200,164,.6);
  min-width: 130px;
  flex-shrink: 0;
}
.chb-score       { font-family: var(--mono); font-size: 52px; font-weight: 800; line-height: 1; }
.chb-score-label { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--t3); margin-top: 4px; font-weight: 700; }
.chb-status      { font-size: 12px; font-weight: 700; margin-top: 4px; }
.chb-details     { padding: 20px 24px; display: flex; flex-direction: column; justify-content: center; gap: 10px; flex: 1; }
.chb-row         { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.chb-key         { color: var(--t2); font-weight: 600; min-width: 170px; }
.chb-val         { color: var(--t1); font-weight: 700; }
.health-pill     { font-weight: 700; font-size: 12px; }

/* ── Contributor — week compare ───────────────────────────────────────────── */
.week-compare-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.week-card {
  background: #fff;
  border: 1px solid rgba(232,200,164,.7);
  border-radius: var(--r2);
  padding: 18px 28px;
  text-align: center;
  min-width: 120px;
}
.wc-current {
  border-color: var(--orange);
}
.wc-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--t2); margin-bottom: 6px; }
.wc-val   { font-family: var(--mono); font-size: 36px; font-weight: 800; color: var(--t1); line-height: 1; }
.wc-sub   { font-size: 10px; color: var(--t3); margin-top: 4px; }
.week-arrow {
  font-size: 28px;
  font-weight: 900;
  font-family: var(--mono);
  padding: 8px;
}
.week-arrow.up     { color: var(--green); }
.week-arrow.down   { color: var(--red); }
.week-arrow.stable { color: var(--t3); }

/* ── Contributor — activity timeline ─────────────────────────────────────── */
.contrib-timeline {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.ct-col     { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.ct-dot     { width: 18px; height: 18px; border-radius: 50%; cursor: default; }
.ct-dot--ok      { background: var(--green); }
.ct-dot--blocker { background: var(--red); }
.ct-dot--help    { background: var(--orange); }
.ct-dot--absent  { background: rgba(200,180,160,.25); border: 1px solid rgba(200,180,160,.4); }
.ct-label   { font-size: 8px; font-family: var(--mono); color: var(--t3); }
.ct-legend  { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.ct-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--t2); }

/* ── Insight & fallback notices ───────────────────────────────────────────── */
.insight-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,235,200,.25);
  border: 1px solid rgba(232,200,164,.6);
  border-left: 3px solid var(--orange);
  border-radius: var(--r1);
  margin-bottom: 20px;
  font-size: 12px;
}
.insight-notice-icon  { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.insight-notice-title { font-weight: 700; color: var(--t1); margin-bottom: 3px; }
.insight-notice-body  { color: var(--t2); line-height: 1.5; }

.fallback-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(240,240,240,.4);
  border: 1px solid rgba(200,190,180,.5);
  border-left: 3px solid var(--t3);
  border-radius: var(--r1);
  margin-bottom: 20px;
  font-size: 12px;
}
.fallback-notice.fn-small { padding: 10px 14px; font-size: 11px; margin-top: 8px; }
.fn-icon  { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.fn-title { font-weight: 700; color: var(--t1); margin-bottom: 3px; font-size: 13px; }
.fn-body  { color: var(--t2); line-height: 1.5; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .client-health-banner { flex-direction: column; }
  .chb-score-wrap       { border-right: none; border-bottom: 1px solid rgba(232,200,164,.6); flex-direction: row; gap: 16px; justify-content: flex-start; }
  .chb-score            { font-size: 38px; }
  .exec-squad-row       { flex-direction: column; align-items: flex-start; gap: 8px; }
  .esr-risk             { width: 100%; }
  .week-compare-wrap    { flex-direction: column; align-items: flex-start; }
}

/* ── Modal de trigger daily ──────────────────────────────────────────────── */
.trigger-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; opacity: 0; transition: opacity .2s;
}
.trigger-overlay.open { opacity: 1; }
.trigger-modal {
  background: var(--surface); border-radius: 16px;
  padding: 32px 28px 24px; width: 340px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  transform: translateY(8px); transition: transform .2s;
}
.trigger-overlay.open .trigger-modal { transform: translateY(0); }
.trigger-modal-icon  { font-size: 28px; color: var(--orange); margin-bottom: 12px; line-height: 1; }
.trigger-modal-title { font-size: 17px; font-weight: 800; color: var(--t1); margin-bottom: 8px; }
.trigger-modal-desc  { font-size: 13px; color: var(--t2); line-height: 1.6; margin-bottom: 24px; }
.trigger-modal-actions { display: flex; gap: 10px; justify-content: center; }
.trigger-btn-cancel {
  padding: 9px 20px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--t2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.trigger-btn-cancel:hover { background: var(--surface2); }
.trigger-btn-confirm {
  padding: 9px 22px; border-radius: 8px; border: none;
  background: var(--orange); color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 7px; transition: opacity .15s;
}
.trigger-btn-confirm:disabled          { opacity: .65; cursor: not-allowed; }
.trigger-btn-confirm:hover:not(:disabled) { opacity: .88; }
.trigger-spinner {
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; display: inline-block; animation: spin .7s linear infinite;
}

/* ── People — card expansível + timesheet visual ─────────────────────────── */
.ppl-expandable {
  flex-direction: column; align-items: stretch; gap: 0; padding: 0;
  cursor: pointer; transition: box-shadow .15s;
}
.ppl-expandable:hover      { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.ppl-expandable.ppl-open   { box-shadow: 0 4px 20px rgba(0,0,0,.12); }
.ppl-row { display: flex; align-items: center; gap: 10px; padding: 12px; }
.ppl-dot { font-size: 10px; flex-shrink: 0; }
.ppl-mini-bar  { height: 3px; background: var(--surface2); margin: 0 12px; border-radius: 99px; overflow: hidden; }
.ppl-mini-fill { height: 100%; border-radius: 99px; transition: width .4s; }
.ppl-mini-label { display: flex; justify-content: space-between; font-size: 10px; padding: 4px 12px 10px; }
.ppl-detail       { border-top: 1px solid var(--border); }
.ppl-loading      { padding: 16px; text-align: center; color: var(--t3); font-size: 12px; }
.ppl-detail-inner { padding: 14px; }
.ppl-detail-cols  { display: flex; flex-direction: column; gap: 14px; }
.ppl-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--t3); margin-bottom: 8px;
}
.ppl-cal-wrap { width: 100%; }
.ppl-cal-header {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 4px;
}
.ppl-cal-header div {
  text-align: center; font-size: 10px; font-weight: 700;
  color: var(--t3); text-transform: uppercase;
}
.ppl-cal-grid    { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.ppl-cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 5px; font-size: 11px; font-weight: 600; cursor: default;
}
.ppl-cal-empty   { background: transparent; }
.ppl-cal-weekend { background: var(--surface2); color: var(--t3); }
.ppl-cal-future  { background: var(--surface2); color: var(--t3); opacity: .5; }
.ppl-cal-filled  { background: #10b98122; color: #10b981; }
.ppl-cal-missing { background: #ef444418; color: #ef4444; }
.ppl-cal-filled:hover { background: #10b98133; }
.ppl-cal-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 10px; color: var(--t3); }
.ppl-cal-legend span { display: flex; align-items: center; gap: 4px; }
.ppl-leg { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.ppl-entries-wrap { width: 100%; }
.ppl-no-entries   { text-align: center; color: var(--t3); font-size: 12px; padding: 20px 0; }
.ppl-entries-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.ppl-entry-row    { display: flex; gap: 10px; background: var(--surface2); border-radius: 6px; padding: 8px 10px; font-size: 11px; }
.ppl-entry-date   { display: flex; flex-direction: column; align-items: center; min-width: 28px; }
.ppl-entry-dd     { font-size: 14px; font-weight: 800; color: var(--t1); line-height: 1; }
.ppl-entry-wd     { font-size: 9px; color: var(--t3); text-transform: uppercase; }
.ppl-entry-body   { flex: 1; min-width: 0; }
.ppl-entry-time    { color: var(--t2); margin-bottom: 3px; }
.ppl-entry-text    { color: var(--t1); line-height: 1.4; }
.ppl-entry-blocker { color: #f59e0b; margin-top: 3px; font-size: 10px; }
.ppl-detail-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.ppl-total-pill   { font-size: 12px; color: var(--t2); display: flex; gap: 4px; align-items: center; }
.ppl-xlsx-btn     { font-size: 12px; padding: 5px 12px; }
/* ── Users page ──────────────────────────────────────────────────────────── */
.role-badge-ui { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 10px; white-space: nowrap; }
.users-table-wrap { margin-bottom: 8px; border-radius: var(--r2); overflow: hidden; border: 1px solid rgba(232,200,164,.7); }
.users-table { width: 100%; }
.users-table th { white-space: nowrap; }
.users-table td { vertical-align: middle; }
.add-user-form { max-width: 680px; }
.auf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.auf-grid .field { grid-column: span 1; }
.field-req { color: var(--orange); font-size: 11px; }
.feedback-bar { padding: 10px 16px; border-radius: var(--r1); font-size: 12px; font-weight: 600; margin-bottom: 16px; animation: fadeIn .2s ease; }
.feedback-ok  { background: rgba(80,185,120,.12); color: #1a7a40; border: 1px solid rgba(80,185,120,.3); }
.feedback-err { background: rgba(220,60,60,.09);  color: #b02020; border: 1px solid rgba(220,60,60,.25); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .client-health-banner { flex-direction: column; }
  .chb-score-wrap { border-right: none; border-bottom: 1px solid rgba(232,200,164,.6); flex-direction: row; gap: 16px; justify-content: flex-start; }
  .chb-score { font-size: 38px; }
  .exec-squad-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .esr-risk { width: 100%; }
  .week-compare-wrap { flex-direction: column; align-items: flex-start; }
  .auf-grid { grid-template-columns: 1fr; }
}