/* ─── Tokens ─────────────────────────────────────────────────────────────── */

:root {
  --bg: #f4f3ee;
  --ink: #141920;
  --muted: #68737c;
  --line: #e3e6e4;
  --panel: #ffffff;
  --brand: #f5cf3e;
  --brand-dark: #141920;
  --accent: #0d9488;

  /* Semantic status */
  --red:   #be123c;
  --amber: #eab308;
  --green: #047857;

  /* Status badge tokens */
  --green-bg:  #ecfdf5;  --green-fg:  #047857;
  --amber-bg:  #fefce8;  --amber-fg:  #854d0e;
  --red-bg:    #fff1f2;  --red-fg:    #be123c;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ─── Entry screen ───────────────────────────────────────────────────────── */

.entry-view {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding: 40px clamp(28px, 6vw, 80px);
  background:
    radial-gradient(circle, rgba(20, 25, 32, 0.9) 1.3px, transparent 1.7px) 0 0 / 80px 72px,
    var(--brand);
  overflow: hidden;
}

.entry-top,
.entry-foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: rgba(20, 25, 32, 0.65);
}

.entry-content {
  position: relative;
  z-index: 1;
  align-self: center;
  max-width: 820px;
  padding: 60px 0;
}

.entry-kicker {
  margin: 0 0 20px;
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(20, 25, 32, 0.6);
}

.entry-content h1 {
  margin: 0;
  font-size: clamp(64px, 13vw, 160px);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.02em;
}

.entry-copy {
  max-width: 480px;
  margin: 32px 0 40px;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.4;
  color: rgba(20, 25, 32, 0.7);
}

.dashboard-view[hidden],
.entry-view[hidden] {
  display: none;
}

/* ─── Topbar ─────────────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 3px 0 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-identity {
  min-width: 160px;
  max-width: 240px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  text-align: right;
}

.user-identity strong,
.user-identity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-identity strong { font-size: 13px; font-weight: 600; }
.user-identity span   { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 80px;
  gap: 6px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  background: var(--brand-dark);
  color: white;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}

button:hover { background: #232c38; }

button.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

button.secondary:hover { background: var(--bg); }

/* ─── Layout ─────────────────────────────────────────────────────────────── */

main {
  padding: 24px 32px 48px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 16px;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */

.screen-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.primary-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.primary-filter label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 760px) {
  .screen-controls { flex-direction: column; align-items: stretch; gap: 12px; }
  .primary-filter { justify-content: flex-end; }
  .primary-client { max-width: none; flex: 1 1 auto; }
}

.tab {
  min-width: auto;
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 0 13px;
  transition: all 0.1s;
}

.tab:hover {
  border-color: color-mix(in srgb, var(--brand) 80%, transparent);
  background: color-mix(in srgb, var(--brand) 15%, white);
  color: var(--ink);
}

.tab.active {
  border-color: color-mix(in srgb, var(--brand) 60%, transparent);
  background: var(--brand);
  color: var(--ink);
  font-weight: 600;
}

.tab-view { display: none; }
.tab-view.active { display: block; }

/* ─── Status message ─────────────────────────────────────────────────────── */

.status-message {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--panel);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.status-message.success {
  background: var(--green-bg);
  border-color: color-mix(in srgb, var(--green) 25%, transparent);
  color: var(--green-fg);
}

.status-message.error {
  background: var(--red-bg);
  border-color: color-mix(in srgb, var(--red) 25%, transparent);
  color: var(--red-fg);
}

.status-message.loading {
  background: var(--amber-bg);
  border-color: color-mix(in srgb, var(--amber) 30%, transparent);
  color: var(--amber-fg);
}

/* ─── Empty state ────────────────────────────────────────────────────────── */

.empty-state {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 20px;
}

td.empty-state { text-align: center; }

/* ─── Status strip (KPI bar) ─────────────────────────────────────────────── */

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.status-strip div {
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.status-strip span {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-strip strong {
  display: block;
  margin-top: 10px;
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* ─── Mini metrics ───────────────────────────────────────────────────────── */

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.mini-metrics article {
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.mini-metrics span {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.mini-metrics strong {
  display: block;
  margin-top: 10px;
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* ─── Panels ─────────────────────────────────────────────────────────────── */

.panel {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.panel.wide {
  grid-row: span 2;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head span {
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 11px;
  color: var(--muted);
}

.panel-head-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ─── Filtros dinâmicos ──────────────────────────────────────────────────── */

.filter-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.primary-client {
  height: 32px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 30px 0 12px;
  cursor: pointer;
  max-width: 210px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23141920' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.primary-client:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line)); }

.primary-client:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--brand) 75%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

/* ─── Filter toggle ──────────────────────────────────────────────────────── */

.filter-control { display: inline-flex; align-items: stretch; }

.filter-toggle {
  height: 32px;
  min-width: auto;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.filter-toggle svg { opacity: 0.7; transition: opacity 0.12s; }
.filter-toggle:hover { background: var(--bg); color: var(--ink); }
.filter-toggle:hover svg { opacity: 1; }

.filter-toggle.has-filters {
  border-color: color-mix(in srgb, var(--brand) 65%, transparent);
  background: color-mix(in srgb, var(--brand) 20%, white);
  color: var(--ink);
}

.filter-toggle.has-filters svg { opacity: 1; color: var(--brand-dark); }

/* X que limpa o filtro sem abrir o popover; encostado no botão Filtrar */
.filter-control:has(.filter-clear-btn:not([hidden])) .filter-toggle {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
}

.filter-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 32px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--brand) 65%, transparent);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--brand) 20%, white);
  color: var(--brand-dark);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.filter-clear-btn:hover {
  background: var(--red-bg);
  border-color: color-mix(in srgb, var(--red) 35%, transparent);
  color: var(--red-fg);
}

.filter-clear-btn[hidden] { display: none; }

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--brand-dark);
  color: #fff;
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 10px;
  line-height: 1;
}

/* ─── Filter popover ─────────────────────────────────────────────────────── */

.filter-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  z-index: 30;
  width: min(460px, 88vw);
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(20, 25, 32, 0.06),
    0 18px 44px -10px rgba(20, 25, 32, 0.24);
  transform-origin: top right;
}

.filter-popover[hidden] { display: none; }
.filter-popover:not([hidden]) { animation: filterPop 0.16s cubic-bezier(0.2, 0.7, 0.3, 1); }

@keyframes filterPop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.filter-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.filter-pop-head > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-pop-head > span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

.conj-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
}

.conj-toggle button {
  min-width: auto;
  min-height: 22px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 11px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.conj-toggle button.active {
  background: var(--brand-dark);
  color: #fff;
}

.filter-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-rule {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) 32px;
  align-items: center;
  gap: 7px;
}

.rule-prefix {
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-align: right;
  text-transform: lowercase;
}

.filter-rule select,
.filter-rule input {
  width: 100%;
  min-width: 0;
  height: 34px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.filter-rule select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2368737c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}

.rule-op {
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 12px;
  color: var(--muted);
}

.filter-rule select:hover,
.filter-rule input:hover { border-color: color-mix(in srgb, var(--ink) 20%, var(--line)); }

.filter-rule select:focus-visible,
.filter-rule input:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--brand) 75%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}

.filter-rule input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }

.rule-value-spacer { display: block; }

.rule-remove {
  width: 32px;
  height: 34px;
  min-width: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.rule-remove:hover {
  background: var(--red-bg);
  border-color: color-mix(in srgb, var(--red) 28%, transparent);
  color: var(--red-fg);
}

.filter-empty {
  padding: 4px 2px 14px;
  font-size: 13px;
  color: var(--muted);
}

.filter-pop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.filter-add,
.filter-clear {
  height: 30px;
  min-width: auto;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.filter-add:hover { background: var(--bg); transform: translateY(-1px); }
.filter-add:active { transform: translateY(0); }

.filter-clear {
  color: var(--red-fg);
  border-color: color-mix(in srgb, var(--red) 22%, transparent);
}

.filter-clear:hover { background: var(--red-bg); }

@media (prefers-reduced-motion: reduce) {
  .filter-popover:not([hidden]) { animation: none; }
}

/* ─── Table ──────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th, td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

/* Projeto column wraps and constrains width */
.col-projeto {
  white-space: normal;
  min-width: 140px;
  max-width: 220px;
}

th {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 40%, white);
}

tbody tr { transition: background 0.08s; }
tbody tr:hover { background: color-mix(in srgb, var(--bg) 50%, white); }

/* RAG row left-border indicator */
tbody tr.rag-green td:first-child { box-shadow: inset 3px 0 0 var(--green); }
tbody tr.rag-amber td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
tbody tr.rag-red   td:first-child { box-shadow: inset 3px 0 0 var(--red);   }

/* ─── Semantic color base (for track bars, intel-card tops) ──────────────── */

.red   { background: var(--red);   }
.amber { background: var(--amber); }
.green { background: var(--green); }

/* ─── Pills ──────────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 5px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.pill::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.65;
  flex-shrink: 0;
}

.pill.red   { background: var(--red-bg);   color: var(--red-fg);   }
.pill.amber { background: var(--amber-bg); color: var(--amber-fg); }
.pill.green { background: var(--green-bg); color: var(--green-fg); }

/* ─── Soft pill / project tag ────────────────────────────────────────────── */

.soft-pill,
.project-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: 3px 8px;
  background: #fdf5d0;
  color: #6b4d00;
  font-size: 11px;
  font-weight: 600;
}

.tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

/* ─── Inline progress (Avanço column) ───────────────────────────────────── */

.progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 12px;
  color: var(--muted);
}

.progress-cell .mini-bar {
  width: 52px;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  flex-shrink: 0;
}

.progress-cell .mini-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
}

/* ─── Go-live dates ──────────────────────────────────────────────────────── */

.golive-val {
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 12.5px;
}

.golive-days {
  font-size: 10.5px;
  display: block;
  margin-top: 1px;
}

.golive-days.ok     { color: var(--muted); }
.golive-days.soon   { color: var(--amber); font-weight: 600; }
.golive-days.urgent { color: var(--red);   font-weight: 700; }

/* ─── Misc text ──────────────────────────────────────────────────────────── */

.subtext {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

/* ─── Lists ──────────────────────────────────────────────────────────────── */

.list {
  margin: 0;
  padding: 6px 20px 16px;
  list-style: none;
}

.list li {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.list li:last-child { border-bottom: 0; }

.risk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.risk-id { min-width: 0; }

.list .risk-client {
  display: block;
  margin-top: 1px;
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.list strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.list span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* ─── Capacity bars ──────────────────────────────────────────────────────── */

.bars { padding: 16px 20px 20px; }

.bar-row { margin-bottom: 14px; }

.bar-row:last-child { margin-bottom: 0; }

.bar-row header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12.5px;
}

.bar-row header span {
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 12px;
  color: var(--muted);
}

.bar-row.healthy header span    { color: var(--green); }
.bar-row.caution header span    { color: #eab308;      font-weight: 600; }
.bar-row.near-limit header span { color: #ea580c;      font-weight: 600; }
.bar-row.overload header span   { color: var(--red);   font-weight: 700; }

.track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.bar-row.healthy .track span    { background: var(--green); }
.bar-row.caution .track span    { background: #eab308; }
.bar-row.near-limit .track span { background: #ea580c; }
.bar-row.overload .track span   { background: var(--red);   }

/* ─── Timeline ───────────────────────────────────────────────────────────── */

.timeline-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.timeline-track span {
  display: block;
  height: 100%;
}

.timeline-track .green, .track .green { background: var(--green); }
.timeline-track .amber, .track .amber { background: var(--amber); }
.timeline-track .red,   .track .red   { background: var(--red);   }

/* ─── Row lists (people, timeline, compact, history) ─────────────────────── */

.people-list,
.timeline-list,
.compact-list,
.history-list,
.alert-list,
.health-list {
  padding: 12px 20px 16px;
}

.person-row,
.timeline-row,
.compact-row,
.history-row {
  display: grid;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.person-row { grid-template-columns: minmax(180px, 1fr) 60px minmax(200px, 1fr); }
.person-row > span {
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.person-row small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.person-row.healthy .track span    { background: var(--green); }
.person-row.caution .track span    { background: #eab308; }
.person-row.near-limit .track span { background: #ea580c; }
.person-row.overload .track span   { background: var(--red);   }

.person-row.healthy > span         { color: var(--green); }
.person-row.caution > span         { color: #eab308;      }
.person-row.near-limit > span      { color: #ea580c;      }
.person-row.overload > span,
.person-row.overload small         { color: var(--red);   }

.timeline-row { grid-template-columns: minmax(180px, 1fr) minmax(220px, 2fr) 100px; }

.timeline-row span,
.history-row span,
.compact-row span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.compact-row,
.history-row { grid-template-columns: minmax(0, 1fr) auto; }

.compact-row > span,
.history-row > strong { font-weight: 700; }

/* ─── Score colors (text, not bg) ────────────────────────────────────────── */

.score.green,
.compact-row .green,
.history-row .green { color: var(--green); background: none; }

.score.amber,
.compact-row .amber { color: var(--amber); background: none; }

.score.red,
.compact-row .red,
.history-row .red   { color: var(--red);   background: none; }

/* ─── Alert chips ────────────────────────────────────────────────────────── */

.alert-chip {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 12px 14px;
  background: var(--panel);
}

.alert-chip.red   { border-color: color-mix(in srgb, var(--red)   25%, transparent); background: var(--red-bg);   }
.alert-chip.amber { border-color: color-mix(in srgb, var(--amber) 25%, transparent); background: var(--amber-bg); }

.alert-chip span {
  font-size: 12.5px;
  color: var(--muted);
}

/* ─── Health rows ────────────────────────────────────────────────────────── */

.health-row { margin-bottom: 14px; }

.health-row:last-child { margin-bottom: 0; }

.health-row header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12.5px;
}

/* ─── Intel cards ────────────────────────────────────────────────────────── */

.intel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.intel-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: var(--panel);
}

.intel-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
}

.intel-card.green::before { background: var(--green); }
.intel-card.amber::before { background: var(--amber); }
.intel-card.red::before   { background: var(--red);   }

.intel-card > span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.intel-card .score {
  margin: 14px 0 6px;
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

.intel-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* ─── Spillover tag ──────────────────────────────────────────────────────── */

.compact-list .amber {
  background: none;
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  .topbar { align-items: flex-start; }
  .actions { flex-wrap: wrap; justify-content: flex-end; }
  .status-strip,
  .mini-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .intel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel.wide { grid-row: auto; }
}

@media (max-width: 700px) {
  .entry-view {
    padding: 28px 20px;
    background:
      radial-gradient(circle, rgba(20, 25, 32, 0.9) 1.1px, transparent 1.5px) 0 0 / 48px 44px,
      var(--brand);
  }

  .entry-top,
  .entry-foot { flex-direction: column; gap: 4px; }

  .topbar,
  .actions { align-items: stretch; flex-direction: column; }

  .topbar { padding: 18px 20px; }

  .subtitle { font-size: 12px; }

  .user-identity {
    max-width: none;
    min-width: 0;
    padding-right: 0;
    border-right: 0;
    text-align: left;
  }

  main { padding: 14px 16px 40px; }

  .status-strip,
  .mini-metrics,
  .intel-grid { grid-template-columns: 1fr; }

  .tabs {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .panel-head { align-items: flex-start; flex-direction: column; gap: 4px; }

  button { width: 100%; }
  .tab { width: auto; }

  .person-row,
  .timeline-row,
  .compact-row,
  .history-row { grid-template-columns: 1fr; }

  .person-row > span { text-align: left; }
}

/* ─── Lançamentos (entrada de dados) ─────────────────────────────────────── */

.tab-entry {
  border-style: dashed;
  font-weight: 600;
}

.setup-panel { max-width: 720px; }
.setup-panel p { color: var(--muted); }
.setup-panel code {
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 12px;
  background: var(--bg);
  border-radius: 4px;
  padding: 1px 5px;
}
.setup-steps { margin: 0 0 20px; padding-left: 20px; color: var(--ink); }
.setup-steps li { margin-bottom: 6px; }

/* Margem interna do painel de lançamentos (toolbar, grade e rodapé). */
#entryPanel { padding: 18px 20px; }

.entry-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.entry-toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Linha 1: navegação entre entidades + ação primária à direita. */
.entry-toolbar-nav { justify-content: space-between; }

/* Linha 2: busca cresce; filtro de semana e ação em lote à direita. */
.entry-toolbar-tools { padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.entry-subtabs { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 1 auto; min-width: 0; }

.entry-primary { flex: 0 0 auto; }

.entry-subtab {
  min-width: auto;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 0 12px;
}

.entry-subtab:hover {
  background: color-mix(in srgb, var(--brand) 15%, white);
  color: var(--ink);
}

.entry-subtab.active {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: white;
  font-weight: 600;
}

.entry-subtab .count {
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 10.5px;
  opacity: 0.7;
}

/* Busca com ícone, ocupa o espaço disponível da linha. */
.entry-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 160px;
}

.entry-search svg {
  position: absolute;
  left: 11px;
  color: var(--muted);
  pointer-events: none;
}

.entry-search input[type="search"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px 0 34px;
  background: white;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}

.entry-toolbar-tools select {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}

.entry-search input[type="search"]:focus-visible,
.entry-toolbar-tools select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Ação em lote (contextual): destaca com a cor de acento ao surgir. */
.entry-bulk {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, white);
  color: var(--accent);
}

.entry-bulk:hover { background: color-mix(in srgb, var(--accent) 18%, white); }

.entry-grid-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.entry-grid th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--bg) 60%, white);
}

.entry-grid td { padding: 8px 10px; }

.row-clickable { cursor: pointer; }

.entry-grid .num {
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-size: 12px;
}

.entry-grid .num.overload { color: var(--red); font-weight: 600; }

.entry-grid .week-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
  font-weight: 600;
}

/* Semana anterior à última preenchida do projeto: tom de cinza. */
.entry-grid .week-num.past {
  background: color-mix(in srgb, var(--muted) 14%, white);
  color: var(--muted);
}

.cell-empty { color: color-mix(in srgb, var(--muted) 45%, transparent); }

/* Ações não reservam coluna: a célula tem largura zero, fica colada (sticky)
   na borda direita da área visível e os ícones flutuam sobre o conteúdo. */
.entry-grid th.row-actions,
.entry-grid td.row-actions {
  position: sticky;
  right: 0;
  width: 0;
  padding: 0;
  border: 0;
  overflow: visible;
}

.entry-grid td.row-actions { z-index: 1; }
.entry-grid th.row-actions { z-index: 3; top: 0; }

.actions-wrap {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
  padding-left: 28px;
  /* leve fade para destacar os ícones do conteúdo por baixo */
  background: linear-gradient(to right, transparent, var(--panel) 24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.13s ease;
}

.entry-grid tbody tr:hover .actions-wrap,
.entry-grid tbody tr:focus-within .actions-wrap {
  opacity: 1;
  pointer-events: auto;
}

.entry-grid tbody tr.selected .actions-wrap {
  background: linear-gradient(to right, transparent, color-mix(in srgb, var(--accent) 7%, white) 24px);
}

.entry-grid td.row-actions .icon-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 9px;
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
  box-shadow: 0 1px 2px rgba(20, 25, 32, 0.08);
  transition: box-shadow 0.13s ease, transform 0.13s ease, color 0.13s, border-color 0.13s;
}

.entry-grid td.row-actions .icon-btn svg { display: block; }

.entry-grid td.row-actions .icon-btn:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 6px 14px rgba(20, 25, 32, 0.18);
  transform: translateY(-2px);
}

.entry-grid td.row-actions .icon-btn.danger:hover {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
}

.icon-btn {
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 12px;
}

.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn.danger:hover { background: var(--red-bg); color: var(--red); }

.entry-foot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.entry-foot-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .entry-toolbar-nav { flex-wrap: wrap; }
  .entry-primary { width: 100%; }
  .entry-bulk { width: 100%; }
}

/* ─── Formulário de lançamento (drawer) ──────────────────────────────────── */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 25, 32, 0.45);
  display: flex;
  justify-content: flex-end;
}

.drawer-overlay[hidden] { display: none; }

.drawer {
  width: min(616px, 100vw);
  height: 100%;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(20, 25, 32, 0.18);
  animation: drawer-in 0.18s ease-out;
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer { animation: none; }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.drawer-head h2 { margin: 0; font-size: 16px; }

.drawer form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.form-fields {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field { display: flex; flex-direction: column; gap: 5px; }

.form-field label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.form-field .req { color: var(--red); }

.form-field input,
.form-field select,
.form-field textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}

.form-field textarea { resize: vertical; min-height: 64px; }

.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.field-row { display: flex; align-items: center; gap: 8px; }
.field-row input { flex: 1; }
.field-suffix { color: var(--muted); font-size: 13px; }

.week-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.drawer-foot {
  display: flex;
  gap: 8px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 40%, white);
}

body.drawer-open { overflow: hidden; }

/* ─── Seleção de linhas (Lançamentos) ────────────────────────────────────── */

.entry-grid .row-select {
  width: 34px;
  text-align: center;
}

.entry-grid .row-select input {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--accent);
}

.entry-grid tr.selected td {
  background: color-mix(in srgb, var(--accent) 7%, white);
}

/* ─── Grade: quebra de linha e larguras por coluna ───────────────────────── */

/* Larguras fixas: a tabela soma exatamente a largura das colunas (width:auto)
   em vez de esticá-las para 100%; o scroll horizontal fica no wrapper. */
.entry-grid {
  table-layout: fixed;
  width: auto;
  min-width: 100%;
}

.entry-grid th,
.entry-grid td {
  white-space: normal;
  vertical-align: middle;
}

/* A largura fica na coluna (no <th>); o conteúdo preenche a célula e quebra,
   sem min-width próprio (que somado ao padding vazaria e seria cortado). */
.entry-grid .cell-content {
  width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.45;
}

.entry-grid .row-select,
.entry-grid .row-actions { vertical-align: middle; }

/* ─── Cabeçalhos ordenáveis (semana, cliente, pm) ────────────────────────── */

.entry-grid th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.1s, background 0.1s;
}

.entry-grid th.sortable:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 8%, white);
}

.entry-grid th.sortable .th-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.entry-grid .sort-icon {
  flex: 0 0 auto;
  opacity: 0.35;
  transition: opacity 0.1s;
}

.entry-grid th.sortable:hover .sort-icon { opacity: 0.7; }

.entry-grid .sort-icon.active {
  opacity: 1;
  color: var(--accent);
}

.entry-grid th.sorted {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, white);
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* ─── Editor de texto rico (Resumo executivo) ────────────────────────────── */

.rich-editor {
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: white;
}

.rich-editor:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 45%, white);
}

.rich-btn {
  min-width: 30px;
  min-height: 28px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
}

.rich-btn b, .rich-btn i, .rich-btn u { font-style: normal; font-weight: 400; }
.rich-btn b { font-weight: 700; }
.rich-btn i { font-style: italic; }
.rich-btn u { text-decoration: underline; }
.rich-btn svg { display: block; }

.rich-btn:hover { background: white; border-color: var(--line); }

.rich-btn.active {
  background: color-mix(in srgb, var(--accent) 14%, white);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent);
}

.rich-sep {
  width: 1px;
  align-self: stretch;
  margin: 2px 4px;
  background: var(--line);
}

/* Dobro da altura do antigo textarea (≈64px → ≈150px) */
.rich-area {
  min-height: 150px;
  max-height: 320px;
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  outline: none;
}

.rich-area:empty::before {
  content: "Escreva o resumo executivo...";
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.rich-area ul, .rich-area ol { margin: 4px 0; padding-left: 22px; }
.rich-area p { margin: 0 0 6px; }
.rich-area:focus { outline: none; }

/* Render do texto rico na grade (somente leitura) */
.rich-view ul, .rich-view ol { margin: 2px 0; padding-left: 18px; }
.rich-view p { margin: 0 0 4px; }
.rich-view p:last-child { margin-bottom: 0; }

/* ─── Seção de time no formulário de projeto ─────────────────────────────── */

.form-section {
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-section-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.ghost-btn {
  min-height: 30px;
  min-width: auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.ghost-btn:hover { background: color-mix(in srgb, var(--accent) 10%, white); }

.team-head,
.team-row {
  display: grid;
  grid-template-columns: 1fr 110px 34px;
  gap: 8px;
  align-items: center;
}

.team-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 2px 2px;
}

.team-row { margin-bottom: 7px; }

.team-row .team-person,
.team-row .team-pct {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}

.team-row .team-person:focus-visible,
.team-row .team-pct:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.team-row .team-remove { justify-self: center; }

/* ─── Combobox de colaborador (busca dinâmica) ───────────────────────────── */

.combo { position: relative; }

.combo-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
}

.combo-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent);
}

.combo-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 220px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 25, 32, 0.12);
  padding: 4px;
}

.combo-option {
  display: block;
  width: 100%;
  min-height: 32px;
  text-align: left;
  justify-content: flex-start;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

.combo-option:hover,
.combo-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent);
}

.combo-empty {
  padding: 10px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

/* Botão "Adicionar pessoa" abaixo da última linha */
.team-add {
  margin-top: 2px;
  width: 100%;
  justify-content: center;
  border-style: dashed;
}

/* ─── Resultados Trimestrais ──────────────────────────────────────────────── */

/* Margem interna do painel de resultados (controles e relatório). */
#resultadosControls { padding: 16px 20px 0; }
.resultados-body { padding: 6px 20px 20px; }

.muted { color: var(--muted); }
.error-text { color: var(--red, #c0392b); }

.resultados-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.resultados-quarter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.resultados-quarter select {
  min-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
}

.resultados-actions { display: flex; gap: 8px; }

.resultados-status {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  background: color-mix(in srgb, var(--accent) 10%, white);
  color: var(--ink);
}
.resultados-status.error { background: var(--red-bg, #fdecea); color: var(--red-fg, #c0392b); }
.resultados-status.success { background: var(--green-bg, #e7f6ee); color: var(--green-fg, #1e7d52); }
.resultados-status.loading { background: color-mix(in srgb, var(--accent) 12%, white); }

.resultados-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.resultados-report {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  line-height: 1.6;
  color: var(--ink);
  max-width: 820px;
}

.markdown-body h2 {
  font-size: 17px;
  margin: 22px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.markdown-body h3 { font-size: 15px; margin: 16px 0 6px; }
.markdown-body h2:first-child { margin-top: 0; }
.markdown-body p { margin: 8px 0; }
.markdown-body ul, .markdown-body ol { margin: 8px 0 8px 22px; }
.markdown-body li { margin: 3px 0; }
.markdown-body strong { font-weight: 600; }
.markdown-body table { border-collapse: collapse; margin: 12px 0; width: 100%; }
.markdown-body th, .markdown-body td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  font-size: 13px;
}
.markdown-body th { background: color-mix(in srgb, var(--bg) 60%, white); }

/* ─── Portfolio: linha clicável + resumo do cliente ───────────────────────── */

#portfolioRows tr.row-clickable { cursor: pointer; }
#portfolioRows tr.row-clickable:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
#portfolioRows tr.row-active { background: color-mix(in srgb, var(--accent) 11%, transparent); }

.client-summary {
  padding: 14px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 520px;
  overflow: auto;
}
.client-summary-item h4 {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.client-summary-item .rich-view {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}
.client-summary-item + .client-summary-item {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.client-summary .empty-state { padding: 14px 0; }

/* Detalhamento das alocações por pessoa (Capacidade). */
.alloc-breakdown {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.alloc-breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
}
.alloc-breakdown .alloc-proj {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alloc-breakdown .alloc-pct {
  flex: 0 0 auto;
  font-family: 'DM Mono', ui-monospace, Menlo, Monaco, monospace;
  font-weight: 600;
  color: var(--ink);
}
