/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #191919;
  --surface:    #222222;
  --surface2:   #2a2a2a;
  --border:     #2e2e2e;
  --border-h:   #3a3a3a;
  --accent:     #4a9eff;
  --accent-h:   #6fb2ff;
  --green:      #4caf7d;
  --red:        #e05c5c;
  --yellow:     #c49a3c;
  --text:       #dddddd;
  --text-muted: #888888;
  --text-dim:   #555555;
  --text-secondary: #888888;
  --radius:     8px;
  --shadow:     none;
  --sidebar-w:  220px;

  /* Escala tipografica — Compact */
  --fs-h1: 22px;
  --fs-h2: 18px;
  --fs-h3: 15px;
  --fs-body: 13px;
  --fs-body-strong: 13px;
  --fs-label: 11px;
  --fs-caption: 12px;

  /* Escala de espacamento — base 4px */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-2xl: 32px;
  --sp-3xl: 48px;
}

/* ── Tema claro (opcional — dark é o padrão) ──────────────────────────────── */
[data-theme="light"] {
  --bg:             #f4f4f4;
  --surface:        #ffffff;
  --surface2:       #eeeeee;
  --border:         #e0e0e0;
  --border-h:       #cccccc;
  --accent:         #2878d6;
  --accent-h:       #1a60be;
  --green:          #2d7a4f;
  --red:            #bf3030;
  --yellow:         #8a6820;
  --text:           #1a1a1a;
  --text-muted:     #555555;
  --text-dim:       #888888;
  --text-secondary: #555555;
}

/* Toggle de tema — botão no topo da sidebar e no sheet "Mais" */
.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: .25rem .35rem;
  border-radius: var(--radius);
  transition: color .12s, background .12s;
  line-height: 1;
  display: flex;
  align-items: center;
}
.theme-toggle-btn:hover { color: var(--text); background: var(--surface2); }

html { font-size: 15px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  min-height: 100dvh;
}

/* ── Layout raiz ──────────────────────────────────────────────────────────── */
#app {
  display: flex;
  min-height: 100dvh;
}

/* ── Sidebar (desktop) ────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 1.1rem 1.25rem .9rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--accent-h);
  border-bottom: 1px solid var(--border);
}

.nav-list { list-style: none; padding: .5rem 0; }
.nav-list li { }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: .4rem .75rem;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  padding: .55rem 1.25rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  border-radius: 0;
  transition: color .12s, background .12s;
}
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-link.active { color: var(--accent-h); background: rgba(74,158,255,.12); }
/* Botão de atualização do app no nav */
button.nav-update-btn {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text-muted);
  font-size: .8rem;
  opacity: 0.7;
}
button.nav-update-btn:hover { opacity: 1; background: var(--surface2); }
button.nav-update-btn:disabled { cursor: default; opacity: 0.5; }


.nav-badge {
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: .1em .45em;
  border-radius: 99px;
  min-width: 1.3em;
  text-align: center;
  line-height: 1.4;
}
.nav-badge.hidden { display: none; }

/* ── Área de conteúdo ─────────────────────────────────────────────────────── */
#content-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

#content {
  flex: 1;
  padding: 1.5rem 1.5rem 3rem;
  max-width: 1100px;
  width: 100%;
}

/* ── Seções ───────────────────────────────────────────────────────────────── */
.section { display: none; }
.section.active { display: block; }

/* ── Offline banner ──────────────────────────────────────────────────────── */
#offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 400;
}

/* ── Bottom nav (mobile) ──────────────────────────────────────────────────── */
#bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
}

.bnav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  padding: .5rem .3rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .62rem;
  text-align: center;
  transition: color .12s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.bnav-link .bnav-icon { font-size: 1.1rem; line-height: 1; }
.bnav-link:hover, .bnav-link.active { color: var(--accent-h); }
.bnav-mais { color: var(--text-muted); }
.bnav-mais.open { color: var(--accent-h); }

/* ── Sheet "Mais" (mobile) ────────────────────────────────────────────────── */
.mais-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 210;
}
.mais-backdrop.hidden { display: none; }

.mais-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 220;
  padding-bottom: env(safe-area-inset-bottom, 0);
  transform: translateY(0);
  animation: sheetUp .22s ease;
}
.mais-sheet.hidden { display: none; }
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.mais-sheet-handle {
  width: 2.5rem;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin: .6rem auto .2rem;
}

.mais-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem 1rem .5rem;
  border-bottom: 1px solid var(--border);
}
.mais-sheet-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.mais-sheet-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .25rem;
  padding: .75rem .75rem 1rem;
}

.mais-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  padding: .7rem .4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .72rem;
  text-align: center;
  border-radius: var(--radius);
  transition: color .12s, background .12s;
}
.mais-item:hover, .mais-item.active { color: var(--accent-h); background: var(--surface2); }
.mais-item span:first-child { font-size: 1.4rem; line-height: 1; }
.mais-item i.ti { font-size: 1.4rem; line-height: 1; }

/* ── Icones na navegacao (Tabler) ─────────────────────────────────────────── */
.nav-link { justify-content: flex-start; }
.nav-link i.ti { font-size: 18px; width: 20px; text-align: center; flex: 0 0 auto; }
.nav-link .nav-badge { margin-left: auto; }
.bnav-link i.ti { font-size: 1.15rem; line-height: 1; }

/* ── Grupo colapsavel "Mais" na sidebar ───────────────────────────────────── */
.nav-mais-toggle {
  display: flex; align-items: center; gap: .4rem;
  width: 100%; padding: .55rem 1.25rem;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: .875rem; font-weight: 500; text-align: left;
  transition: color .12s, background .12s;
}
.nav-mais-toggle:hover { color: var(--text); background: var(--surface2); }
.nav-mais-toggle i.ti { font-size: 18px; width: 20px; text-align: center; flex: 0 0 auto; }
.nav-mais-chev { margin-left: auto; font-size: 16px; transition: transform .15s; }
.nav-mais-toggle.open .nav-mais-chev { transform: rotate(180deg); }
.nav-mais-list { padding-top: 0; }
.nav-mais-list.hidden { display: none; }

/* ── Seção — cabeçalho ────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Filtros ──────────────────────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  margin-bottom: 1rem;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filter-field { display: flex; flex-direction: column; gap: .2rem; min-width: 130px; }
.filter-field label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.filter-field select,
.filter-field input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .83rem;
  padding: .32rem .5rem;
  width: 100%;
}
.filter-field select:focus,
.filter-field input:focus { outline: none; border-color: var(--accent); }

/* ── Tabela ───────────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.data-table .list-row { cursor: pointer; transition: background .1s; }
.data-table .list-row:hover td { background: var(--surface2); }
.data-table .row-today td { border-left: 3px solid var(--accent); }
.data-table .row-alert td { color: var(--yellow); }
.data-table .row-bloqueado td { color: var(--text-muted); font-style: italic; }
.data-table .row-bloqueado td:first-child { border-left: 3px solid var(--yellow); }

/* Botão concluir com 1 clique */
.td-check { width: 52px; text-align: center; padding: 4px !important; }
.btn-concluir {
  background: none;
  border: 2px solid var(--green);
  color: var(--green);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  touch-action: manipulation;
}
.btn-concluir:hover, .btn-concluir:active {
  background: var(--green);
  color: #fff;
}
.check-done {
  color: var(--green);
  opacity: .4;
  font-size: 1.1rem;
  font-weight: bold;
}
.data-table .row-projeto td { border-left: 3px solid var(--accent); background: rgba(74,158,255,.07); }
.data-table .row-projeto:hover td { background: rgba(74,158,255,.13); }
.data-table .row-subtarefa td { background: rgba(74,158,255,.03); }
.data-table .row-subtarefa:hover td { background: var(--surface2); }
.data-table .indent { padding-left: 2rem; }
.col-desc { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-valor { font-weight: 600; white-space: nowrap; }
.col-valor.receita { color: var(--green); }
.col-valor.despesa { color: var(--red); }

/* ── Paginação ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 0 0;
  justify-content: center;
}
.page-info { font-size: .82rem; color: var(--text-muted); }

/* ── Botões ───────────────────────────────────────────────────────────────── */
.btn {
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  padding: .45rem 1rem;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-approve  { background: var(--green); color: #fff; }
.btn-approve:hover { opacity: .85; }
.btn-reject   { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-reject:hover  { background: var(--red); color: #fff; }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-sm       { padding: .3rem .7rem; font-size: .8rem; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }

.icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: .25rem .4rem;
  border-radius: 5px;
}
.icon-btn:hover { color: var(--text); background: var(--surface2); }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 680px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--border);
}
.modal-title-text { font-size: 1rem; font-weight: 700; }
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}
.modal-footer {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Formulários ──────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: .65rem 1rem;
}
.form-field { display: flex; flex-direction: column; gap: .25rem; }
.form-field--full { grid-column: 1 / -1; }
.form-field--check { flex-direction: row; align-items: center; padding-top: 1.2rem; }
.form-field label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.form-field input,
.form-field select,
.form-field textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .875rem;
  padding: .4rem .6rem;
  width: 100%;
  font-family: inherit;
  transition: border-color .15s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { outline: none; border-color: var(--accent); }
.form-field input.invalid,
.form-field select.invalid { border-color: var(--red); }
.form-field textarea { resize: vertical; min-height: 72px; }
.req { color: var(--red); margin-left: .2rem; }

/* ── Painel de detalhe ────────────────────────────────────────────────────── */
.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
}
.panel-backdrop.hidden { display: none; }

.detail-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 400;
  display: flex;
  flex-direction: column;
  border-left: 0.5px solid var(--border);
  animation: slideInRight .2s ease;
}
.detail-panel.hidden { display: none; }
@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--border);
}
.panel-title-text { font-size: .95rem; font-weight: 700; }
.panel-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.panel-actions { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Linhas de detalhe */
.detail-obs {
  padding: .6rem 0 .8rem;
  border-bottom: 1px solid rgba(46,46,46,.5);
  margin-bottom: .25rem;
}
.detail-obs-text {
  margin-top: .35rem;
  font-size: .82rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  line-height: 1.6;
  background: var(--surface2);
  border-radius: var(--radius);
  padding: .6rem .75rem;
}
.detail-row {
  display: flex;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid rgba(46,46,46,.5);
  align-items: flex-start;
}
.detail-label {
  flex-shrink: 0;
  width: 130px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding-top: .1rem;
}
.detail-value {
  font-size: .875rem;
  color: var(--text);
  word-break: break-word;
}

/* ── Entrada rápida ───────────────────────────────────────────────────────── */
.quick-entry {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
}

.quick-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;         /* ≥16px evita zoom automático no iOS */
  line-height: 1.6;
  padding: .25rem 0 .6rem;
  resize: none;
  overflow: hidden;
  min-height: 3.5rem;
  transition: border-color .15s;
}
.quick-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.quick-input::placeholder {
  color: var(--text-muted);
  font-size: .9rem;
}

.quick-entry-footer {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: flex-end;
}

.quick-btn {
  white-space: nowrap;
  padding: .55rem 1.4rem;
}

/* ── Botão de microfone ────────────────────────────────────────────────────── */
.mic-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 50%;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: transparent;
  flex-shrink: 0;
  transition: color .15s, border-color .15s, background .15s;
}
.mic-btn:hover { color: var(--text); border-color: var(--text-muted); }

.mic-btn.recording {
  color: var(--red);
  border-color: var(--red);
  background: rgba(239, 68, 68, .1);
  animation: mic-pulse 1.2s ease-in-out infinite;
}
.mic-btn.processing {
  color: var(--accent);
  border-color: var(--accent);
  cursor: default;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .4); }
  50%       { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.mic-timer {
  font-size: .78rem;
  color: var(--text-muted);
  min-width: 4rem;
  font-variant-numeric: tabular-nums;
}
.mic-btn.recording ~ .mic-timer { color: var(--red); }

/* Spinner SVG animado */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Chat CTA (Início) ───────────────────────────────────────────────────── */
.dash-chat-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(74,158,255,.1);
  border: 1px solid rgba(74,158,255,.35);
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: background .15s, border-color .15s;
  outline: none;
}
.dash-chat-cta:hover { background: rgba(74,158,255,.18); border-color: var(--accent); }
.dash-chat-cta:focus { border-color: var(--accent-h); }
.dash-chat-icon  { font-size: 1.5rem; flex-shrink: 0; }
.dash-chat-text  { flex: 1; }
.dash-chat-label { font-size: .95rem; font-weight: 700; color: var(--accent-h); }
.dash-chat-sub   { font-size: .8rem; color: var(--text-muted); margin-top: .1rem; }
.dash-chat-arrow { font-size: 1.2rem; color: var(--accent); flex-shrink: 0; }
.dash-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-start;
  gap: .5rem;
}
.dash-copy-btn { font-size: .85rem; padding: .55rem 1rem; opacity: .7; }
.dash-copy-btn:hover { opacity: 1; }

/* ── Dashboard ────────────────────────────────────────────────────────────── */
.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: .25rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: .25rem;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  outline: none;
}
.dash-card:hover { border-color: var(--accent); background: var(--surface2); }
.dash-card:focus { border-color: var(--accent-h); }
.dash-card.accent { border-color: var(--accent); }
.dash-card-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.dash-card-count { font-size: 2.5rem; font-weight: 800; color: var(--text); line-height: 1; }
.dash-card-link { font-size: .8rem; color: var(--accent-h); margin-top: .25rem; }
.dash-card--list .dash-card-count { font-size: inherit; }
.dash-list { list-style: none; font-size: .85rem; color: var(--text); margin: .25rem 0; }
.dash-list li { padding: .25rem 0; border-bottom: 1px solid rgba(46,46,46,.4); }
.dash-list li b { color: var(--text-muted); font-weight: 400; margin-right: .4rem; }

/* ── Projetos próximos no dashboard ──────────────────────────────────────── */
.dash-projetos { grid-column: 1 / -1; display: flex; flex-direction: column; gap: .6rem; }
.dash-proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  outline: none;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.dash-proj-card:hover  { background: var(--surface2); border-left-color: var(--accent-h); }
.dash-proj-card:focus  { border-color: var(--accent-h); }
.dash-proj-card.urgente { border-left-color: var(--yellow); }
.dash-proj-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.dash-proj-title  { font-size: .95rem; font-weight: 600; color: var(--text); flex: 1; }
.dash-proj-prazo  { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.dash-proj-prazo.urgente { color: var(--yellow); font-weight: 600; }
.dash-proj-bar-wrap { display: flex; align-items: center; gap: .6rem; }
.dash-proj-bar  { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.dash-proj-fill { height: 100%; background: var(--accent-h); border-radius: 3px; transition: width .3s; }
.dash-proj-pct  { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.dash-proj-link { font-size: .8rem; color: var(--accent-h); }
.dash-addr-row { display: flex; align-items: center; gap: .5rem; background: var(--bg); border-radius: var(--radius); padding: .35rem .6rem; }
.dash-addr-text { font-size: .75rem; color: var(--text-muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-addr-btn { font-size: .72rem; color: var(--accent-h); background: none; border: 0.5px solid var(--border); border-radius: var(--radius); padding: .2rem .5rem; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: background .15s; }
.dash-addr-btn:hover { background: var(--surface2); }
.dash-empty { font-size: .85rem; color: var(--text-muted); padding: .5rem 0; }

/* ── Status pills ─────────────────────────────────────────────────────────── */
.status-pill {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .15em .55em;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--text-muted);
  white-space: nowrap;
}
.status-confirmado, .status-ativo, .status-realizado, .status-entregue, .status-concluido {
  background: rgba(76,175,125,.15); color: var(--green);
}
.status-pendente, .status-agendado, .status-pedido {
  background: rgba(196,154,60,.12); color: var(--yellow);
}
.status-cancelado, .status-rejeitado {
  background: rgba(224,92,92,.12); color: var(--red);
}

/* ── Estoque chips ────────────────────────────────────────────────────────── */
.stock-chip {
  display: inline-block;
  font-weight: 700;
  font-size: .8rem;
  padding: .1em .45em;
  border-radius: 5px;
  margin-right: .4rem;
}
.stock-low  { background: rgba(196,154,60,.2); color: var(--yellow); }
.stock-zero { background: rgba(224,92,92,.2); color: var(--red); }

/* ── Orçamento ─────────────────────────────────────────────────────────────── */
.ocard-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.osum-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.osum-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.osum-value { font-size: 1.35rem; font-weight: 700; color: var(--text); }
.ocard-list { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.ocard-section-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin: .75rem 0 .35rem;
}
.ocard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
}
.ocard-paused { opacity: .55; }
.ocard-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.ocard-nome { font-weight: 600; font-size: .9rem; }
.ocard-saldo { font-size: 1rem; font-weight: 700; white-space: nowrap; }
.ocard-meta { display: flex; gap: 1rem; font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.otag-paused {
  font-size: .65rem; font-weight: 500; text-transform: uppercase;
  background: var(--border); color: var(--text-muted);
  padding: .1rem .4rem; border-radius: 999px; margin-left: .25rem;
}
.oprogress-wrap {
  height: 4px; background: var(--border); border-radius: 999px;
  margin: .4rem 0 .2rem; overflow: hidden;
}
.oprogress-bar { height: 100%; border-radius: 999px; transition: width .3s; }
/* Projeção */
.oproj-section { margin-bottom: 1.25rem; }
.oproj-title {
  display: flex; justify-content: space-between;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); padding-bottom: .35rem;
  border-bottom: 1px solid var(--border); margin-bottom: .4rem;
}
.oproj-total { font-weight: 700; color: var(--text); }
.oproj-item {
  display: flex; justify-content: space-between;
  font-size: .875rem; padding: .3rem 0;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.oproj-summary { margin-bottom: 1.5rem; }

/* ── Orçamento — Pirâmide de Maslow ──────────────────────────────────────── */
.pyr-stack {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.pyr-nivel {
  border-radius: 8px;
  padding: .75rem 1rem;
}

.pyr-nivel-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .75rem;
}

.pyr-nivel-icon { font-size: 1.1rem; flex-shrink: 0; }

.pyr-nivel-label {
  font-weight: 600;
  font-size: .9rem;
}

.pyr-nivel-sub {
  font-size: .72rem;
  opacity: .55;
  margin-top: 1px;
}

.pyr-nivel-total {
  margin-left: auto;
  font-size: .875rem;
  font-weight: 700;
  opacity: .8;
  white-space: nowrap;
}

/* Área de barras — scroll horizontal se overflow */
.pyr-bars {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pyr-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 52px;
  max-width: 80px;
  flex: 1;
  cursor: pointer;
}

.pyr-bar-item:hover .pyr-bar-fill {
  filter: brightness(1.15);
}

.pyr-bar-pct {
  font-size: .72rem;
  font-weight: 600;
  min-height: 16px;
}

.pyr-bar-outer {
  width: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  background: rgba(128,128,128,.1);
  border-radius: 4px 4px 0 0;
  overflow: visible;
}

.pyr-bar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height .4s ease;
  border: 1.5px solid transparent;
}

/* Barras sem limite: pontilhadas, mais transparentes */
.pyr-bar-nolimit {
  opacity: .55;
  border-style: dashed !important;
  background: transparent !important;
  border-width: 2px !important;
}

/* Indicador de estouro */
.pyr-bar-over {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
}

.pyr-bar-gasto {
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.pyr-bar-nome {
  font-size: .68rem;
  text-align: center;
  opacity: .7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.pyr-bar-sub {
  font-size: .62rem;
  text-align: center;
  opacity: .45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Pirâmide — layout principal (pirâmide + sidebar coletivo) ─────────────── */
.pyr-main-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.pyr-main-row .pyr-stack {
  flex: 1;
  min-width: 0;
}
.pyr-fundos-sidebar {
  flex-shrink: 0;
  width: 110px;
  background: rgba(255,200,80,.06);
  border: 1px solid rgba(255,200,80,.2);
  border-radius: 10px;
  padding: .75rem .5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  position: sticky;
  top: 1rem;
}
.pyr-fundos-sidebar-label {
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  opacity: .5;
  text-align: center;
}

/* ── Pirâmide — sidebar sem-limite dentro do nível ─────────────────────────── */
.pyr-nivel-body {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
}
.pyr-nivel-body .pyr-bars {
  flex: 1;
  min-width: 0;
}
.pyr-nivel-sl-sidebar {
  flex-shrink: 0;
  border-left: 1px dashed rgba(128,128,128,.2);
  padding-left: .5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Pirâmide — seção sem caixinha ─────────────────────────────────────────── */
.pyr-sem-caixinha {
  margin-top: 1rem;
  border: 1px solid rgba(196,154,60,.35);
  border-radius: 10px;
  background: rgba(196,154,60,.05);
  overflow: hidden;
}
.pyr-sc-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  color: rgba(196,154,60,.9);
  list-style: none;
  user-select: none;
}
.pyr-sc-header::-webkit-details-marker { display: none; }
.pyr-sc-total {
  margin-left: auto;
  font-size: 1rem;
  font-weight: 700;
}
.pyr-sc-count {
  font-size: .75rem;
  font-weight: 400;
  opacity: .6;
}
.pyr-sc-list {
  border-top: 1px solid rgba(196,154,60,.2);
  padding: .25rem 0;
}
.pyr-sc-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 6rem 5.5rem;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  font-size: .8rem;
  border-bottom: 1px solid rgba(128,128,128,.06);
}
.pyr-sc-row:last-child { border-bottom: none; }
.pyr-sc-data  { color: var(--text-secondary, rgba(128,128,128,.7)); white-space: nowrap; }
.pyr-sc-desc  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pyr-sc-cat   { font-size: .72rem; opacity: .55; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pyr-sc-valor { text-align: right; font-weight: 600; color: rgba(196,154,60,.85); white-space: nowrap; }

/* ── Financeiro — totalizadores ────────────────────────────────────────────── */
.fin-totais {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: .75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .875rem;
}
.totais-item { color: var(--text-muted); }
.totais-item b { color: var(--text); }
.totais-item.receita b { color: var(--green); }
.totais-item.despesa b { color: var(--red); }
.totais-item.saldo.positivo b { color: var(--green); }
.totais-item.saldo.negativo b { color: var(--red); }

/* ── Financeiro — gráfico por categoria ──────────────────────────────────── */
.fin-grafico-toggle {
  margin-bottom: .75rem;
  font-size: .8rem;
}
.fin-grafico {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.fin-grafico.hidden { display: none; }
.fin-grafico-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .9rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.fin-grafico-titulo { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.fin-grafico-total  { font-size: .9rem; color: var(--text); }
.fin-cat-list { display: flex; flex-direction: column; gap: .45rem; }
.fin-cat-row  { display: grid; grid-template-columns: 9rem 1fr 6rem 3.5rem; align-items: center; gap: .5rem; cursor: pointer; border-radius: .3rem; padding: .15rem .25rem; transition: background .12s; }
.fin-cat-row:hover { background: var(--surface2); }
.fin-cat-row.ativa { background: var(--surface2); outline: 1px solid var(--accent); }
.fin-cat-label{ font-size: .82rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Banner de filtro ativo */
.fin-cat-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .5rem .75rem; margin-bottom: .5rem;
  background: var(--accent)18; border: 1px solid var(--accent)40;
  border-radius: var(--radius); font-size: .85rem; flex-wrap: wrap;
}
.fin-cat-bar-wrap { background: var(--surface2); border-radius: 99px; height: 8px; overflow: hidden; }
.fin-cat-bar  { height: 100%; border-radius: 99px; transition: width .3s ease; }
.fin-cat-val  { font-size: .8rem; font-weight: 600; color: var(--text); text-align: right; white-space: nowrap; }
.fin-cat-pct  { font-size: .75rem; color: var(--text-muted); text-align: right; }
@media (max-width: 600px) {
  .fin-cat-row { grid-template-columns: 7rem 1fr 5rem; }
  .fin-cat-pct { display: none; }
}

/* ── Financeiro Fase 4 — abas de visualização ─────────────────────────────── */
.fin-mes-bar { display: flex; align-items: center; gap: var(--sp-md); margin-bottom: var(--sp-lg); }
.fin-mes-bar.hidden { display: none; }
.fin-mes-label { font-size: var(--fs-label); color: var(--text-muted); display: flex; align-items: center; gap: var(--sp-sm); text-transform: uppercase; letter-spacing: .05em; }
.fin-mes-label input[type="month"] {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); padding: 4px 8px; font-size: var(--fs-body);
}

/* drill-down de subcategorias */
.fin-cat-group { border-radius: var(--radius); }
.fin-sub-list { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-xs) 0 var(--sp-sm) var(--sp-lg); }
.fin-sub-list.hidden { display: none; }
.fin-sub-row { display: flex; justify-content: space-between; font-size: var(--fs-caption); color: var(--text-muted); padding: 2px var(--sp-sm); }
.fin-sub-row span:last-child { color: var(--text); font-weight: 500; }

/* cards por conta */
.fin-conta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-md); }
.fin-conta-card, .fin-benef-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-lg);
}
.fin-benef-card { margin-bottom: var(--sp-lg); }
.fin-conta-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-md); }
.fin-conta-nome { font-size: var(--fs-h3); font-weight: 600; color: var(--text); }
.fin-conta-saldo { font-weight: 700; }
.fin-conta-saldo.positivo { color: var(--green); }
.fin-conta-saldo.negativo { color: var(--red); }
.fin-conta-linhas { display: flex; flex-direction: column; gap: var(--sp-xs); }
.fin-conta-linhas > div { display: flex; justify-content: space-between; font-size: var(--fs-body); }
.fin-conta-linhas .receita { color: var(--green); }
.fin-conta-linhas .despesa { color: var(--red); }
.fin-benef-nota { font-size: var(--fs-caption); margin-top: var(--sp-sm); }

/* modal de conciliação */
.fin-conc-list { display: flex; flex-direction: column; gap: var(--sp-xs); max-height: 320px; overflow-y: auto; }
.fin-conc-opt {
  display: flex; align-items: center; gap: var(--sp-sm); padding: var(--sp-sm) var(--sp-md);
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
}
.fin-conc-opt:hover { border-color: var(--border-h); background: var(--surface2); }
.fin-conc-info { display: flex; flex-direction: column; }
.fin-conc-info small { color: var(--text-muted); font-size: var(--fs-caption); }
.panel-conc { margin: var(--sp-md) 0; padding-top: var(--sp-md); border-top: 1px solid var(--border); }

/* ── Prazo compacto (atividades) ──────────────────────────────────────────── */
.col-prazo { white-space: nowrap; }
.prazo-atrasado { color: var(--red); font-weight: 600; }
.prazo-urgente  { color: var(--yellow); font-weight: 600; }

/* ── Cards mobile (atividades) ────────────────────────────────────────────── */
.atv-card {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .5rem;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.atv-card:active { background: var(--surface2); }
.atv-card.row-bloqueado { opacity: .6; }
.atv-card-body { flex: 1; min-width: 0; }
.atv-card-title {
  font-size: .92rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: break-word;
}
.atv-card-meta {
  font-size: .74rem;
  color: var(--text-muted);
  margin-top: .2rem;
}
.atv-card-footer {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-top: .55rem;
  flex-wrap: wrap;
}
.atv-card-prazo-chip {
  font-size: .74rem;
  padding: .22em .6em;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}
.atv-card-prazo-chip.prazo-atrasado { background: rgba(224,92,92,.15); color: var(--red); font-weight: 700; }
.atv-card-prazo-chip.prazo-urgente  { background: rgba(196,154,60,.15);  color: var(--yellow); font-weight: 700; }
.atv-card-plus {
  font-size: .8rem;
  padding: .38em .75em;
  border-radius: .45em;
  border: 1.5px solid var(--green);
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font-weight: 700;
  min-height: 34px;
  min-width: 42px;
  touch-action: manipulation;
}
.atv-card-plus:active { background: rgba(76,175,125,.15); }
.atv-card-check {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 50%;
  border: 2.5px solid #555;
  background: transparent;
  color: transparent;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  transition: all .15s;
  touch-action: manipulation;
}
.atv-card-check.is-done {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.atv-card-check:active:not(.is-done) { border-color: var(--green); background: rgba(76,175,125,.12); }
.atv-card-check-placeholder { width: 46px; min-width: 46px; flex-shrink: 0; }
.atv-card-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
}
.atv-card-cancel-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #555;
  background: transparent;
  color: #777;
  cursor: pointer;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: all .15s;
}
.atv-card-cancel-btn:active { border-color: var(--red); color: var(--red); background: rgba(224,92,92,.1); }
.atv-group-header {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent-h, var(--accent));
  background: var(--surface2, #1a1a1a);
  border-top: 2px solid var(--border, #333);
  border-bottom: 1px solid var(--border, #333);
  padding: .55rem 1rem .45rem;
  margin: .75rem -.25rem 0;
}
.atv-cards-group, .atv-cards-list { padding-top: .5rem; }

/* ── Inline select (atividades) ───────────────────────────────────────────── */
.inline-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: .82rem;
  padding: .2rem .4rem;
}
.inline-select:focus { outline: none; border-color: var(--accent); }

/* ── Hoje chip ────────────────────────────────────────────────────────────── */
.hoje-chip {
  display: inline-block;
  font-size: .68rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  padding: .05em .4em;
  border-radius: 4px;
  margin-left: .3rem;
  vertical-align: middle;
}

/* ── Sigiloso ─────────────────────────────────────────────────────────────── */
.sigiloso-label { color: var(--text-muted); font-size: .85rem; }
.lock-icon { margin-right: .25rem; }

/* ── Grade de contatos ────────────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .6rem;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  transition: border-color .12s, background .12s;
}
.contact-card:hover { border-color: var(--accent); background: var(--surface2); }
.contact-name { font-weight: 600; font-size: .9rem; }
.contact-meta { display: flex; gap: .5rem; align-items: center; margin-top: .2rem; font-size: .8rem; color: var(--text-muted); }
.contact-tel { color: var(--accent-h); font-size: .82rem; text-decoration: none; flex-shrink: 0; }
.contact-tel:hover { text-decoration: underline; }

/* ── Pills ────────────────────────────────────────────────────────────────── */
.pill {
  font-size: .68rem;
  padding: .15em .5em;
  border-radius: 99px;
  background: var(--surface2);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.pill-warn { background: rgba(196,154,60,.15); color: var(--yellow); }

/* ── Erros ────────────────────────────────────────────────────────────────── */
.error-msg {
  color: var(--red);
  padding: 1rem;
  font-size: .875rem;
}

/* ── ── CURADORIA (preservado) ────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  /* Mobile: scroll horizontal quando as abas não cabem na tela */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: .6rem .9rem;
  font-size: .875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .45rem;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
  border-radius: var(--radius) var(--radius) 0 0;
  flex-shrink: 0; /* impede compressão — permite scroll horizontal */
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent-h); border-bottom-color: var(--accent); }

/* Filtros de período na busca de itens */
.btn-periodo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .78rem;
  padding: 3px 10px;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-periodo:hover { color: var(--text); border-color: var(--accent); }
.btn-periodo.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.badge {
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .1em .45em;
  border-radius: 99px;
  min-width: 1.3em;
  text-align: center;
  line-height: 1.4;
}
.badge.zero { background: var(--surface2); color: var(--text-muted); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card-list { display: flex; flex-direction: column; gap: .75rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: opacity .25s, transform .25s;
}
.card.removing { opacity: 0; transform: translateX(32px); pointer-events: none; }
.card-head {
  padding: .75rem 1rem .5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}
.card-title { font-weight: 600; font-size: .95rem; }
.card-meta { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.card-meta span { margin-right: .6rem; }
.card-meta .valor { color: var(--text); font-weight: 600; font-size: .9rem; }
.card-fields {
  padding: .5rem 1rem .75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .5rem .75rem;
}
.field-group { display: flex; flex-direction: column; gap: .25rem; }
.field-group-wide { grid-column: 1 / -1; }
.field-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.field-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .85rem;
  padding: .35rem .55rem;
  width: 100%;
  transition: border-color .15s;
}
.field-input:focus { outline: none; border-color: var(--accent); }
.split-resumo {
  margin: 0 1rem .75rem;
  padding: .55rem .7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  font-size: .82rem;
}
.split-resumo.ok { border-color: color-mix(in srgb, var(--green) 55%, var(--border)); }
.split-resumo.erro { border-color: color-mix(in srgb, var(--red) 60%, var(--border)); color: var(--red); }
.split-resumo-linhas { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin-top: .35rem; color: var(--text-muted); }
.card-actions {
  padding: .5rem 1rem .75rem;
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.btn-approve { background: var(--green); color: #fff; }
.btn-approve:hover { opacity: .85; }
.btn-reject  { background: transparent; color: var(--red); border: 1px solid var(--red); }
.btn-reject:hover { background: var(--red); color: #fff; }

/* ── Estado vazio ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: .75rem;
  color: var(--green);
  display: block;
}
.empty-state p { font-size: .95rem; color: var(--text-muted); }
.empty-state small { font-size: .8rem; opacity: .6; display: block; margin-top: .3rem; }
.empty-state-icon { font-size: 26px; color: var(--border-h); display: block; margin-bottom: .5rem; }
.empty-state-msg { font-size: 13px; color: var(--text-muted); }
.empty-state-sub { font-size: 11px; color: var(--text-dim); margin-top: .25rem; }
.empty-state-action { margin-top: 1rem; }

/* ── Carregar mais (substitui paginacao numerada) ─────────────────────────── */
.load-more { display: flex; justify-content: center; padding: 1rem 0; }
.load-more-count { color: var(--text-dim); font-weight: 400; margin-left: .3rem; }
.btn-ghost { background: transparent; border: .5px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); border-color: var(--border-h); }

/* ── Toast ────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 999;
  pointer-events: none;
}
.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .85rem;
  padding: .6rem 1rem;
  box-shadow: var(--shadow);
  animation: slideIn .2s ease;
  pointer-events: auto;
}
.toast { display: flex; align-items: center; gap: 12px; }
.toast.ok   { border-left: 3px solid var(--green); }
.toast.err  { border-left: 3px solid var(--red); }
.toast.warn { border-left: 3px solid var(--yellow); }
.toast-msg { flex: 1; }
.toast-action { background: none; border: none; color: var(--accent); font-weight: 500; cursor: pointer; font-size: .85rem; padding: 0; font-family: inherit; pointer-events: auto; }
.toast-action:hover { color: var(--accent-h); }
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Loading spinner ──────────────────────────────────────────────────────── */
.spinner {
  width: 1.5rem; height: 1.5rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin: 3rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Wrapper de scroll horizontal para tabelas ────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* ── Responsivo ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  #sidebar { display: none; }
  /* Padding-bottom considera altura da bottom-nav (~56px) + safe area do iPhone */
  #content-wrap {
    margin-left: 0;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 12px));
    overflow-x: hidden;
  }
  #content { padding: 1rem 1rem 2rem; max-width: 100%; }
  #bottom-nav {
    display: flex;
    /* Safe area para iPhone X+ (evita que os ícones fiquem sob o indicador home) */
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  #offline-banner { top: auto; bottom: 60px; }
  .section-title { font-size: 1.1rem; }
  .modal-box { max-height: 85dvh; }
  .detail-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 80dvh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    animation: slideInUp .2s ease;
  }
  @keyframes slideInUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid  { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .filters-bar { max-width: 100%; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: .45rem .5rem; }
  .col-hide-mobile { display: none; }
  .fin-totais { max-width: 100%; overflow-x: auto; flex-wrap: wrap; }
  .nf-itens-inline { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── Previne zoom automático do iOS em inputs/selects (<16px → zoom) ──── */
  .form-field input,
  .form-field select,
  .form-field textarea,
  .filter-field select,
  .filter-field input,
  .field-input,
  .inline-select,
  .chat-textarea,
  #ideia-input { font-size: 16px; }

  /* ── Toast acima da bottom nav ────────────────────────────────────────── */
  #toast-container {
    bottom: calc(56px + env(safe-area-inset-bottom, 12px) + .75rem);
    right: .75rem;
  }

  /* ── Indicador de conexão acima da bottom nav ─────────────────────────── */
  .connection-status {
    bottom: calc(56px + env(safe-area-inset-bottom, 12px) + .5rem);
  }
}

@media (max-width: 420px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .filters-bar { flex-direction: column; }
}


/* ── Indicador de conexão ────────────────────────────────────────────────── */
.connection-status {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  cursor: default;
  transition: color .3s;
}
.connection-status.online  { color: var(--green); }
.connection-status.offline { color: var(--red); animation: pulse-red 1.5s infinite; }
@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

/* ── NF inline (itens + sugestões de atividade) ───────────────────────────── */
/* ── Valor destaque no card financeiro ───────────────────────────────────── */
.card-valor-destaque {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.1;
}
.card-valor-destaque.receita { color: var(--green); }
.card-valor-destaque.despesa { color: var(--red);   }
.card-valor-destaque.neutro  { color: var(--text-muted); }

/* ── NF / imagem ─────────────────────────────────────────────────────────── */
.nf-badge-row { display: flex; align-items: center; gap: .5rem; margin-top: .4rem; flex-wrap: wrap; }
.pill-nf      { background: #1d4ed820; color: #60a5fa; border: 1px solid #1d4ed840; }
.nf-itens-link { font-size: .8rem; color: var(--accent); text-decoration: underline; cursor: pointer; }
.nf-img-link  { font-size: .8rem; color: var(--text-muted); text-decoration: underline; cursor: pointer; }
.nf-img-link:hover { color: var(--text); }
.nf-itens-inline { margin-top: .5rem; overflow-x: auto; }
.nf-itens-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.nf-itens-table th,
.nf-itens-table td { padding: .3rem .5rem; border-bottom: 1px solid var(--border); text-align: left; }
.nf-itens-table th  { opacity: .6; font-weight: 600; }

.nf-sugestoes        { margin-top: .6rem; border-top: 1px solid var(--border); padding-top: .5rem; }
.nf-sugestoes-titulo { font-size: .75rem; font-weight: 600; opacity: .6; text-transform: uppercase;
                        letter-spacing: .05em; margin-bottom: .4rem; }
.nf-sugestao-row     { display: flex; align-items: center; justify-content: space-between;
                        gap: .5rem; padding: .3rem 0; font-size: .85rem; flex-wrap: wrap; }
.nf-sugestao-texto   { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-match           { background: #16a34a20; color: #4ade80; border: 1px solid #16a34a50;
                        white-space: nowrap; flex-shrink: 0; }
.btn-match:hover     { background: #16a34a40; }

/* ── Chat ──────────────────────────────────────────────────────────────── */
.chat-wrap         { display: flex; flex-direction: column; height: calc(100vh - 120px); }
.chat-messages     { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }

/* Início: stats/ideias em cima, chat por último (DOM order — evita iOS Safari flex-order hit-testing bug) */
#inicio-chat-wrap                  { height: auto; border: 1px solid var(--border); border-radius: var(--radius); overflow: visible; margin-top: 1rem; }
#inicio-chat-wrap .chat-messages   { flex: none; height: auto; max-height: none; overflow-y: visible; min-height: 90px; }
#inicio-chat-wrap .inicio-chat-head { display: flex; justify-content: flex-end; padding: .4rem .5rem; border-bottom: 1px solid var(--border); }

/* Caixa "Pro Claude" — ideias temporárias salvas localmente */
.ideias-claude     { margin-top: 1rem; padding: .75rem; border: 1px dashed var(--border); border-radius: var(--radius); }
.ideias-head       { font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.ideias-sub        { font-weight: 400; font-size: .78rem; color: var(--text-muted); margin-left: .4rem; }
.ideias-input-row  { display: flex; gap: .5rem; align-items: flex-end; }
#ideia-input       { flex: 1; resize: none; height: 2.4rem; max-height: 8rem; padding: .5rem; background: var(--surface2); color: var(--text); border: 1px solid #444; border-radius: .35rem; font-family: inherit; font-size: .9rem; }
.ideias-list       { margin-top: .5rem; display: flex; flex-direction: column; gap: .35rem; }
.ideias-vazio      { font-size: .8rem; color: var(--text-muted); }
.ideia-item        { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; background: var(--surface2); border-radius: .35rem; }
.ideia-texto       { flex: 1; font-size: .85rem; white-space: pre-wrap; word-break: break-word; }
.ideia-btn         { background: none; border: none; cursor: pointer; font-size: .95rem; padding: 0 .2rem; opacity: .7; }
.ideia-btn:hover   { opacity: 1; }
.chat-bubble       { max-width: 75%; padding: .75rem 1rem; border-radius: .5rem; line-height: 1.5; }
.chat-bubble-wrap  { display: flex; align-items: flex-end; gap: .5rem; }
.chat-bubble-wrap.jupiter  { align-self: flex-start; }
.chat-bubble-wrap.usuario  { align-self: flex-end; flex-direction: row-reverse; }
.bubble-jupiter    { background: var(--surface2); border-left: 3px solid var(--accent); }
.bubble-usuario    { background: rgba(74,158,255,.15); border-right: 3px solid var(--accent-h); }
.bubble-meta       { font-size: .75rem; opacity: .55; margin-bottom: .25rem; }
.bubble-ctx-card   { background: var(--surface); border: 1px solid var(--border, #333); border-radius: .4rem; padding: .5rem .75rem; margin-top: .5rem; font-size: .85rem; }
.bubble-actions    { display: flex; gap: .5rem; margin-top: .6rem; }
.btn-sim           { background: var(--green); color: #fff; border: none; border-radius: .35rem; padding: .35rem .75rem; cursor: pointer; font-size: .85rem; }
.btn-nao           { background: var(--surface2); color: var(--text-muted); border: 1px solid #444; border-radius: .35rem; padding: .35rem .75rem; cursor: pointer; font-size: .85rem; }
.chat-input-area   { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--border, #333); background: var(--surface); }
.chat-anexo-preview { display: flex; align-items: center; gap: .5rem; width: 100%; background: var(--surface2); border: 1px solid #444; border-radius: .35rem; padding: .35rem .65rem; font-size: .85rem; color: var(--text-muted); }
.anexo-nome         { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-remover-anexo  { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; flex-shrink: 0; }
.btn-remover-anexo:hover { color: var(--text); }
/* ── Upload preview multi-arquivo ──────────────────────────────────────────── */
.upload-preview-area { display: none; flex-wrap: wrap; gap: .35rem; width: 100%; padding: .35rem 0; }
.upload-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--surface2); border: 1px solid #444; border-radius: 1rem; padding: .2rem .55rem; font-size: .8rem; color: var(--text-muted); }
.btn-mais-foto { background: none; border: 1px dashed #555; border-radius: 1rem; color: var(--text-muted); cursor: pointer; font-size: .8rem; padding: .2rem .55rem; flex-shrink: 0; }
.btn-mais-foto:hover { border-color: var(--accent); color: var(--text); }
.chat-textarea     { flex: 1; resize: none; height: 2.5rem; max-height: 8rem; padding: .5rem; background: var(--surface2); color: var(--text); border: 1px solid #444; border-radius: .35rem; font-family: inherit; font-size: .9rem; }
.btn-icon          { width: 2.5rem; height: 2.5rem; padding: 0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.1rem; }
.nav-badge         { display: inline-flex; align-items: center; justify-content: center; min-width: 1.2em; height: 1.2em; padding: 0 .3em; background: var(--accent); color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700; margin-left: .4em; }
.nav-badge.hidden  { display: none; }

/* ── Entrada (Watchdog Unificado) ─────────�
/* ── Indicações ──────────────────────────────────────────────────────────── */
.ind-busca-wrap { padding: .5rem 1rem 0; }
.ind-busca {
  width: 100%; max-width: 380px;
  padding: .45rem .75rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .9rem;
}
.ind-busca:focus { outline: none; border-color: var(--accent); }

.ind-grupo { margin: 1.25rem 0 .5rem; }
.ind-tipo-header {
  font-size: .85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  margin: 0 0 .5rem; padding: 0 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.badge-count {
  background: var(--surface2); color: var(--text-muted);
  font-size: .72rem; font-weight: 600; padding: .1em .45em;
  border-radius: 99px;
}

/* pill "Quero rever" */
.pill-rever { background: rgba(74,158,255,.15); color: var(--accent); }

/* Avaliação com estrelas */
.av-wrap    { text-align: center; padding: .5rem 0 1rem; }
.av-titulo  { margin-bottom: 1rem; font-size: 1rem; }
.av-stars   { display: flex; justify-content: center; gap: .4rem; margin-bottom: .75rem; }
.av-star    {
  font-size: 2rem; cursor: pointer; color: var(--text-muted);
  transition: transform .1s, color .1s; user-select: none;
}
.av-star:hover, .av-star-on { color: var(--yellow); transform: scale(1.15); }
.av-hint    { font-size: .8rem; color: var(--text-muted); }
center;
  gap: .5rem;
  padding: .3rem 0;
  border-bottom: 1px solid 
/* ═══════════════════════════════════════════════════════════════════════════
   Orçamento v2 — Pirâmide redesign 2026-06-10
   Classes: orc2-*
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Header ────────────────────────────────────────────────────────────────── */
.orc2-hdr { margin-bottom: .75rem; }
.orc2-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}
.orc2-mes-nav {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .25rem .5rem;
}
.orc2-nav-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  padding: .1rem .35rem;
  border-radius: 4px;
  line-height: 1;
  opacity: .7;
  transition: opacity .15s, background .15s;
}
.orc2-nav-btn:hover { opacity: 1; background: rgba(255,255,255,.07); }
.orc2-mes-label {
  font-size: .8rem;
  font-weight: 600;
  opacity: .85;
  min-width: 120px;
  text-align: center;
  white-space: nowrap;
}

/* ── KPI ────────────────────────────────────────────────────────────────────── */
.orc2-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.orc2-kpi-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .625rem;
}
.orc2-kpi-left { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.orc2-kpi-val  { font-size: 1.75rem; font-weight: 800; color: var(--text); }
.orc2-kpi-val.over { color: var(--red); }
.orc2-kpi-of   { font-size: .875rem; color: var(--text-muted); }
.orc2-kpi-pct  { font-size: 1.1rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.orc2-kpi-pct.over { color: var(--red); }
.orc2-kpi-warn { font-size: .75rem; color: rgba(196,154,60,.8); margin-top: .4rem; }

/* ── Progress bar global ────────────────────────────────────────────────────── */
.orc2-bar {
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  overflow: hidden;
}
.orc2-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.orc2-bar-fill.over { background: var(--red); }

/* ── Pirâmide (container) ───────────────────────────────────────────────────── */
.orc2-pyr {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 1rem;
}

/* ── Slice (nível) ──────────────────────────────────────────────────────────── */
.orc2-slice {
  /* --sc = cor do nível;  --si = indentação */
  margin-left: var(--si);
  margin-right: var(--si);
  border-radius: 8px;
  border-left: 3px solid var(--sc);
  background: color-mix(in srgb, var(--sc) 6%, var(--surface));
  overflow: hidden;
  transition: margin .25s ease, background .2s;
}
.orc2-slice.expanded {
  background: color-mix(in srgb, var(--sc) 10%, var(--surface));
}
.orc2-slice-head {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .7rem .875rem;
  cursor: pointer;
  user-select: none;
}
.orc2-slice-head:hover { background: rgba(255,255,255,.03); }
.orc2-slice-icon { font-size: 1rem; flex-shrink: 0; }
.orc2-slice-info { flex-shrink: 0; min-width: 0; }
.orc2-slice-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--sc);
  white-space: nowrap;
}
.orc2-slice-sub {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Barra do slice ─────────────────────────────────────────────────────────── */
.orc2-slice-bar-wrap { flex: 1; min-width: 0; padding: 0 .5rem; }
.orc2-slice-bar {
  height: 5px;
  background: rgba(255,255,255,.1);
  border-radius: 3px;
  overflow: hidden;
}
.orc2-slice-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.orc2-slice-fill.over { background: var(--red) !important; }

/* ── Números do slice ───────────────────────────────────────────────────────── */
.orc2-slice-nums {
  display: flex;
  align-items: baseline;
  gap: .25rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.orc2-slice-gasto { font-size: .875rem; font-weight: 700; }
.orc2-slice-gasto.over { color: var(--red); }
.orc2-slice-lim { font-size: .75rem; color: var(--text-muted); }
.orc2-slice-chevron {
  font-size: .6rem;
  color: var(--text-muted);
  margin-left: .25rem;
  flex-shrink: 0;
  transition: transform .2s;
}
.orc2-slice.expanded .orc2-slice-chevron { transform: none; }

/* ── Corpo expandido (caixinhas) ────────────────────────────────────────────── */
.orc2-slice-body {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: .25rem 0 .5rem;
}
.orc2-empty-row {
  font-size: .78rem;
  opacity: .45;
  padding: .5rem 1.125rem;
  font-style: italic;
}

/* ── Linha de caixinha ──────────────────────────────────────────────────────── */
.orc2-cx-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .875rem;
  cursor: pointer;
  border-radius: 0;
  transition: background .15s;
}
.orc2-cx-row:hover { background: rgba(255,255,255,.04); }
.orc2-cx-nome {
  font-size: .8rem;
  min-width: 90px;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}
.orc2-cx-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .375rem;
  min-width: 0;
}
.orc2-cx-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  overflow: hidden;
}
.orc2-cx-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .45s ease;
}
.orc2-cx-fill.over { background: var(--red) !important; }
.orc2-cx-pct { font-size: .7rem; color: var(--text-muted); min-width: 30px; text-align: right; white-space: nowrap; }
.orc2-cx-pct.over { color: var(--red); font-weight: 700; }
.orc2-cx-nums {
  display: flex;
  align-items: baseline;
  gap: .2rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.orc2-cx-gasto { font-size: .8rem; font-weight: 600; }
.orc2-cx-gasto.over { color: var(--red); }
.orc2-cx-lim { font-size: .7rem; color: var(--text-muted); }
.orc2-cx-tag {
  font-size: .65rem;
  border: 1px solid;
  border-radius: 4px;
  padding: 1px 4px;
  flex-shrink: 0;
}

/* ── Fundos coletivos ───────────────────────────────────────────────────────── */
.orc2-fundos {
  background: rgba(255,200,80,.06);
  border: 1px solid rgba(255,200,80,.2);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
}
.orc2-fundos-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,200,80,.7);
  margin-bottom: .5rem;
}
.orc2-fundo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .4rem 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.orc2-fundo-row:last-child { border-bottom: none; }
.orc2-fundo-row:hover { opacity: .85; }
.orc2-fundo-nome { font-size: .85rem; font-weight: 600; }
.orc2-fundo-sub  { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }
.orc2-fundo-saldo { font-size: .875rem; font-weight: 700; color: rgba(255,200,80,.9); white-space: nowrap; }

/* ── Sem caixinha ───────────────────────────────────────────────────────────── */
.orc2-sc {
  border: 1px solid rgba(196,154,60,.3);
  border-radius: var(--radius);
  background: rgba(196,154,60,.04);
  overflow: hidden;
  margin-top: .5rem;
}
.orc2-sc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 600;
  color: rgba(196,154,60,.9);
  list-style: none;
  user-select: none;
}
.orc2-sc-summary::-webkit-details-marker { display: none; }
.orc2-sc-badges { display: flex; align-items: center; gap: .5rem; }
.orc2-sc-total { font-size: .95rem; font-weight: 700; }
.orc2-sc-count {
  background: rgba(196,154,60,.15);
  color: rgba(196,154,60,.8);
  font-size: .7rem;
  font-weight: 600;
  border-radius: 99px;
  padding: .1em .5em;
}
.orc2-sc-list { border-top: 1px solid rgba(196,154,60,.15); }
.orc2-sc-row {
  display: grid;
  grid-template-columns: 5rem 1fr 5.5rem 5rem auto;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1rem;
  font-size: .78rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.orc2-sc-row:last-child { border-bottom: none; }
.orc2-sc-data { color: var(--text-muted); white-space: nowrap; }
.orc2-sc-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orc2-sc-cat  { font-size: .7rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orc2-sc-val  { text-align: right; font-weight: 600; color: rgba(196,154,60,.85); white-space: nowrap; }
.orc2-sc-act  { display: flex; align-items: center; gap: .25rem; }
.orc2-sc-sel  { font-size: .72rem; padding: 2px 4px; max-width: 120px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); border-radius: 4px; }
.orc2-sc-btn  { font-size: .72rem; }

/* ── Painel de detalhe da caixinha ──────────────────────────────────────────── */
.orc2-panel-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.orc2-pstat { display: flex; flex-direction: column; gap: 2px; }
.orc2-pstat-val  { font-size: 1.5rem; font-weight: 800; }
.orc2-pstat-val.over { color: var(--red); }
.orc2-pstat-val2 { font-size: 1rem; font-weight: 700; color: var(--text-muted); }
.orc2-pstat-val2.over { color: var(--red); }
.orc2-pstat-lbl  { font-size: .72rem; color: var(--text-muted); }
.orc2-obs { font-size: .8rem; color: var(--text-muted); margin-bottom: .75rem; font-style: italic; }
.orc2-panel-tx-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .5rem;
}

/* ── Transações no painel ───────────────────────────────────────────────────── */
.orc2-tx-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: .85rem;
}
.orc2-tx-row:last-child { border-bottom: none; }
.orc2-tx-info { flex: 1; min-width: 0; }
.orc2-tx-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.orc2-tx-meta { font-size: .72rem; color: var(--text-muted); margin-top: 2px; }
.orc2-tx-val { font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.orc2-tx-val.pos { color: var(--green); }
.orc2-tx-val.neg { color: rgba(224,92,92,.85); }

/* ── Projeção ───────────────────────────────────────────────────────────────── */
.orc2-proj-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.orc2-proj-col { flex: 1; min-width: 0; }
.orc2-proj-col-r { text-align: right; }
.orc2-proj-col-val { font-size: 1rem; font-weight: 700; margin-bottom: .3rem; }
.orc2-proj-col-val.green { color: var(--green); }
.orc2-proj-col-val.red   { color: var(--red);   }
.orc2-proj-col-bar { height: 4px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; margin-bottom: .3rem; }
.orc2-proj-col-lbl { font-size: .7rem; color: var(--text-muted); }
.orc2-proj-saldo { text-align: center; padding: 0 .75rem; flex-shrink: 0; }
.orc2-proj-saldo-val { font-size: 1.4rem; font-weight: 800; white-space: nowrap; }
.orc2-proj-saldo-lbl { font-size: .7rem; color: var(--text-muted); margin-top: 2px; }
.orc2-proj-section { margin-bottom: 1.25rem; }
.orc2-proj-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .5rem;
  padding-bottom: .3rem;
  border-bottom: 1px solid var(--border);
}
.orc2-proj-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .35rem 0;
  font-size: .85rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.orc2-proj-row:last-child { border-bottom: none; }
.orc2-proj-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.orc2-proj-val  { font-weight: 600; white-space: nowrap; flex-shrink: 0; }

/* ── Utilitários ─────────────────────────────────────────────────────────────── */
.orc2-empty {
  font-size: .875rem;
  color: var(--text-muted);
  padding: 1.5rem;
  text-align: center;
}

/* color-mix fallback para browsers antigos */
@supports not (background: color-mix(in srgb, red 10%, blue)) {
  .orc2-slice { background: var(--surface); }
  .orc2-slice.expanded { background: var(--surface2); }
}

/* ── Responsivo ──────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .orc2-slice-sub  { display: none; }
  .orc2-cx-nome    { min-width: 70px; max-width: 80px; }
  .orc2-sc-row     { grid-template-columns: 4.5rem 1fr 4rem auto; }
  .orc2-sc-cat     { display: none; }
  .orc2-proj-summary { flex-direction: column; gap: .75rem; }
  .orc2-proj-col-r { text-align: left; }
  .orc2-proj-col-r .orc2-proj-col-bar div { margin-left: 0; }
}
