/* ============ Design tokens ============ */
:root {
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;

  /* brand accent (customizable via Configurações) */
  --accent: #11F512;
  --accent-rgb: 17, 245, 18;
  --accent-2: #22c1c3;
  --btn-primary-bg: #11F512;
  --btn-primary-text: #0a0a0a;

  /* ícones "Dark Glow Squircle" (customizável via Configurações > Aparência) */
  --icon-glow-rgb: 42, 127, 255;
}

:root[data-theme="dark"] {
  /* Sem isto, o navegador pinta pedaços que o CSS não cobre (calendário do
     input[type=date], fundo do <select> nativo no iOS, autofill etc.) no
     claro por padrão — mesmo com o resto da tela certinho em escuro. */
  color-scheme: dark;
  --bg: #0e0f13;
  --bg-elevated: #16171d;
  --bg-card: #1a1b22;
  --bg-hover: #22232c;
  --bg-input: #1f2028;
  --border: #2a2b34;
  --border-soft: #24252d;
  --text: #f3f3f6;
  --text-dim: #a7a8b3;
  --text-faint: #6f7080;
  --green: #3ddc84;
  --green-bg: rgba(61, 220, 132, 0.12);
  --red: #ff6b6b;
  --red-bg: rgba(255, 107, 107, 0.12);
  --yellow: #ffc857;
  --yellow-bg: rgba(255, 200, 87, 0.12);
  --blue: #5b9dff;
  --blue-bg: rgba(91, 157, 255, 0.12);
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
  --scrollbar: #33343e;
}

:root[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #eef0f3;
  --bg-input: #ffffff;
  --border: #e2e4e9;
  --border-soft: #eaebef;
  --text: #17181c;
  --text-dim: #5b5d6b;
  --text-faint: #9698a6;
  --green: #16a34a;
  --green-bg: rgba(22, 163, 74, 0.1);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.1);
  --yellow: #b45309;
  --yellow-bg: rgba(180, 83, 9, 0.12);
  --blue: #2563eb;
  --blue-bg: rgba(37, 99, 235, 0.1);
  --shadow: 0 8px 24px rgba(20,20,30,0.08);
  --scrollbar: #d7d9e0;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow-x: hidden; width: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  cursor: url("../assets/cursor-white.svg") 5 3, auto;
}
:root[data-theme="light"] body { cursor: url("../assets/cursor-black.svg") 5 3, auto; }
a, button, .nav-item, .tab, .kcard, [data-route], input[type="checkbox"], select {
  cursor: url("../assets/cursor-white.svg") 5 3, pointer;
}
:root[data-theme="light"] a, :root[data-theme="light"] button, :root[data-theme="light"] .nav-item,
:root[data-theme="light"] .tab, :root[data-theme="light"] .kcard, :root[data-theme="light"] [data-route],
:root[data-theme="light"] input[type="checkbox"], :root[data-theme="light"] select {
  cursor: url("../assets/cursor-black.svg") 5 3, pointer;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

svg { display: block; }
svg.icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ============ App shell ============ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(to bottom, var(--bg-elevated) 0%, #000 100%);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: width 0.18s ease, box-shadow 0.18s ease;
}
/* Menu fixo por padrão (largura estável) — só encolhe pro modo ícone quando
   a pessoa clica no botão de minimizar (ver #btn-sidebar-collapse em
   js/app.js), não mais sozinho ao tirar o mouse de cima. */
.app-shell.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
.mobile-menu-toggle {
  display: none;
  margin-left: auto;
  width: 34px; height: 34px;
  align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 18px 12px 18px 19px;
  border-bottom: 1px solid var(--border-soft);
  min-height: var(--topbar-h);
  flex-shrink: 0;
}
.sidebar-logo .logo-icon { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.sidebar-logo .logo-fallback {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 13px;
}
.app-shell.sidebar-collapsed .sidebar-logo .logo-icon { display: inline-block; }
.app-shell.sidebar-collapsed .sidebar-logo .logo-fallback { display: flex; }
.sidebar-logo .logo-icon, .sidebar-logo .logo-fallback { display: none; }
.sidebar-logo .brand-name {
  font-weight: 700; font-size: 15px; letter-spacing: 0.2px; white-space: nowrap;
  opacity: 1; max-width: 200px; overflow: hidden; display: inline-block;
  transition: opacity 0.12s ease, max-width 0.18s ease;
}
.sidebar-logo .brand-wordmark {
  height: 30px; max-height: 30px; width: auto; object-fit: contain;
  opacity: 1; max-width: 200px; overflow: hidden; display: inline-block; flex-shrink: 0;
  transition: opacity 0.12s ease, max-width 0.18s ease;
}
.app-shell.sidebar-collapsed .sidebar-logo .brand-name,
.app-shell.sidebar-collapsed .sidebar-logo .brand-wordmark {
  opacity: 0; max-width: 0;
}

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px 10px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 0 9px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 2px;
  transition: background 0.12s ease, color 0.12s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
/* Item ativo do menu: degradê neutro (escuro embaixo, um pouco mais claro
   em cima — sem verde nenhum aqui), mais uma barrinha acesa (não a borda
   inteira) centrada na altura, encostada na borda direita — só ali usa a
   var(--accent) do app. */
.nav-item.active, .sidebar-footer a.active {
  background: linear-gradient(to top, var(--bg-card) 0%, var(--bg-hover) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: #fff;
}
.nav-item.active::after, .sidebar-footer a.active::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 2px;
  transform: translateY(-50%);
  width: 3px;
  height: 44%;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 9px 2px rgba(var(--accent-rgb), 0.75);
}
.nav-item.active:hover, .sidebar-footer a.active:hover {
  background: linear-gradient(to top, var(--bg-card) 0%, var(--bg-hover) 100%);
  color: #fff;
}
/* Glyph do item ativo: mantém a cor de destaque (ver .app-icon-box.active
   mais abaixo), já legível sobre o novo fundo verde. */
.nav-item .icon { width: 17px; height: 17px; flex-shrink: 0; }
.nav-item span, .sidebar-footer .nav-item span, .sidebar-footer a span {
  opacity: 1;
  max-width: 200px;
  overflow: hidden;
  display: inline-block;
  transition: opacity 0.12s ease, max-width 0.18s ease;
}
.app-shell.sidebar-collapsed .nav-item span,
.app-shell.sidebar-collapsed .sidebar-footer .nav-item span,
.app-shell.sidebar-collapsed .sidebar-footer a span {
  opacity: 0;
  max-width: 0;
}
.nav-item .badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 10px 10px 14px;
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.sidebar-footer a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 0 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
  margin-bottom: 2px;
}
.sidebar-footer a:hover { background: var(--bg-hover); color: var(--text); }
.sidebar-footer a .icon { width: 17px; height: 17px; flex-shrink: 0; }

/* Modo claro: sidebar usa a cor de destaque como fundo, contrastando com o
   conteúdo branco (em vez de repetir a mesma superfície branca dos cards). */
:root[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-right: none;
}
:root[data-theme="light"] .sidebar-logo { border-bottom-color: rgba(255,255,255,0.22); }
:root[data-theme="light"] .sidebar-logo .brand-name { color: #fff; }
:root[data-theme="light"] .sidebar-logo .logo-fallback { background: rgba(255,255,255,0.25); }
:root[data-theme="light"] .nav-item { color: rgba(255,255,255,0.88); }
:root[data-theme="light"] .nav-item:hover { background: rgba(255,255,255,0.14); color: #fff; }
:root[data-theme="light"] .sidebar-footer { border-top-color: rgba(255,255,255,0.22); }
:root[data-theme="light"] .sidebar-footer a { color: rgba(255,255,255,0.88); }
:root[data-theme="light"] .sidebar-footer a:hover { background: rgba(255,255,255,0.14); color: #fff; }
:root[data-theme="light"] .sidebar:hover, :root[data-theme="light"] .sidebar:focus-within {
  box-shadow: 6px 0 28px rgba(0,0,0,0.18);
}

/* ============ Main area ============ */
.main-area { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; transition: margin-left 0.18s ease; }
.app-shell.sidebar-collapsed .main-area { margin-left: var(--sidebar-w-collapsed); }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  position: relative;
  transition: background 0.12s, color .12s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg-elevated);
}
.notif-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  box-shadow: var(--shadow);
}

.chart-light-toggle { width: 28px; height: 28px; border-radius: 8px; }
.chart-light-toggle .icon { width: 14px; height: 14px; }
.chart-light-toggle.active { background: rgba(255,196,0,0.16); border-color: rgba(255,196,0,0.4); color: #ffc400; }
.chart-light-toggle.active:hover { background: rgba(255,196,0,0.24); color: #ffc400; }

.page-content { padding: 24px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ============ Notification panel ============ */
.notif-panel {
  position: fixed;
  bottom: 76px; right: 24px;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  z-index: 200;
  display: none;
}
.notif-panel.open { display: block; }
.notif-header { padding: 12px 14px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--border-soft); }
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; }
.notif-item:last-child { border-bottom: none; }
.notif-item .t { font-weight: 600; margin-bottom: 2px; }
.notif-item .d { color: var(--text-faint); font-size: 11.5px; }
.notif-empty { padding: 24px 14px; text-align: center; color: var(--text-faint); font-size: 12.5px; }

/* ============ Generic components ============ */
.grid { display: grid; gap: 16px; min-width: 0; }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1300px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } .grid-4 {grid-template-columns: repeat(2,1fr);} }
@media (max-width: 905px) { .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card-glass-gradient), var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  min-width: 0;
}
.card-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title .sub { font-size: 11px; font-weight: 500; color: var(--text-faint); }

.kpi-card { padding: 16px 18px; }
/* Na Dashboard, essas 4 caixas esticam pra bater a altura do bloco de
   Entradas + Transações ao lado — sem isso o conteúdo ficava todo
   espremido no canto de cima, sobrando um vazio grande embaixo. */
#kpi-row .kpi-card { height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 22px 24px; }
/* Textos maiores aqui pra ocupar melhor a caixa esticada — só nesse bloco,
   sem afetar as outras páginas que também usam .kpi-card em altura normal. */
#kpi-row .kpi-label { font-size: 13px; margin-bottom: 10px; }
#kpi-row .kpi-value { font-size: 32px; }
#kpi-row .kpi-sub { font-size: 13px; margin-top: 8px; }
.kpi-label { font-size: 11.5px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 8px; }
.kpi-value { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.kpi-sub { font-size: 11.5px; margin-top: 6px; color: var(--text-dim); }
.kpi-sub.pos { color: var(--green); }
.kpi-sub.neg { color: var(--red); }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; transition: background .2s ease, color .2s ease; }
.kpi-card.kpi-featured { box-shadow: 0 10px 30px -8px rgba(0,0,0,0.4); transition: background .2s ease; overflow: hidden; background-color: transparent; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-size: 20px; font-weight: 800; margin: 0; }
.page-sub { color: var(--text-faint); font-size: 12.5px; margin-top: 2px; }

/* Breadcrumb de pastas da página Documentos (js/pages/documentos.js) */
.doc-breadcrumb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.doc-breadcrumb span[data-open-folder] { cursor: pointer; }
.doc-breadcrumb span[data-open-folder]:hover { color: var(--text); text-decoration: underline; }
.doc-breadcrumb span.current { color: var(--text); font-weight: 700; cursor: default; }
.doc-breadcrumb span.current:hover { text-decoration: none; }

/* Cards de pasta (ícone + nome), estilo "explorador de arquivos" — ver
   folderCardHtml em js/pages/documentos.js. Reaproveita o .app-icon-box
   ("Dark Glow Squircle") já usado no resto do app pra manter consistência. */
.doc-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.doc-folder-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  text-align: center;
}
.doc-folder-card:hover { background: var(--bg-hover); border-color: var(--border); }
.doc-folder-name { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.doc-folder-meta { font-size: 10.5px; color: var(--text-faint); }
.doc-folder-card-actions {
  position: absolute; top: 6px; right: 6px;
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.doc-folder-card:hover .doc-folder-card-actions { opacity: 1; }

.btn {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn.primary {
  background: var(--btn-primary-bg, var(--accent));
  border-color: var(--btn-primary-bg, var(--accent));
  color: var(--btn-primary-text, #fff);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.btn.primary:hover {
  transform: scale(1.045);
  filter: brightness(1.08);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18), 0 8px 20px rgba(var(--accent-rgb), 0.5);
}
.btn.primary:active { transform: scale(0.97); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 7px 14px; font-size: 11.5px; }
.btn .icon { width: 14px; height: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.select, .input, .textarea {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}
.select:focus, .input:focus, .textarea:focus { border-color: var(--accent); }
/* appearance:none tira a setinha nativa do <select> (que em compensação
   vinha clara demais em telas de sistema fora do nosso controle) — repõe
   uma setinha própria, sempre no mesmo tom independente do SO/navegador. */
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9ba8' stroke-width='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 8px center;
  background-size: 15px;
  padding-right: 28px;
}
/* iOS/Chrome pintam o campo de amarelo/branco assim que o autofill entra em
   ação, por cima de qualquer background nosso — o truque da sombra interna
   gigante "repõe" a cor certa por baixo do preenchimento automático. */
.input:-webkit-autofill, .input:-webkit-autofill:hover, .input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
  box-shadow: 0 0 0 1000px var(--bg-input) inset;
  transition: background-color 9999s ease-in-out 0s;
}
.textarea { resize: vertical; }
.input[type="number"]::-webkit-inner-spin-button,
.input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input[type="number"] { -moz-appearance: textfield; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--text-dim); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 9px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-faint);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--text-dim); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab.sm { padding: 5px 10px; font-size: 11px; border-bottom: none; background: var(--bg-card); }
.tab.sm.active { background: rgba(var(--accent-rgb), 0.14); }
.select.sm { padding: 4px 8px; font-size: 11px; }

/* Galeria de quadros (Entregas) — cards com capa, estilo Figma */
/* Grid (não flex-wrap) de propósito: com largura fixa em px, os cards não
   se ajustavam à largura real da tela — sobrava um vão vazio na direita
   sempre que a largura disponível não era múltipla exata de 230px (bem
   comum no celular). minmax(...,1fr) faz cada linha esticar os cards pra
   preencher 100% da largura, não importa o tamanho da tela. */
.board-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; transition: gap 0.15s ease; }
.board-gallery-item {
  width: auto; cursor: pointer; border-radius: var(--radius-lg); overflow: hidden;
  border: 2px solid transparent; background: var(--bg-card);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.board-gallery-item:hover { transform: translateY(-2px); }
.board-gallery-item.active { border-color: var(--accent); }
.board-gallery-cover {
  position: relative; aspect-ratio: 16 / 9; width: 100%; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85); background-color: var(--bg-elevated);
}
.board-gallery.compact { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.board-gallery-cover .icon { width: 24px; height: 24px; }
.board-gallery-cover-edit {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 7px;
  background: rgba(0,0,0,0.55); color: #fff; border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity 0.12s ease;
}
.board-gallery-cover-edit .icon { width: 13px; height: 13px; }
.board-gallery-item:hover .board-gallery-cover-edit { opacity: 1; }
.board-gallery-name { padding: 10px 12px 2px; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-gallery-client { padding: 0 12px 10px; font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sticky-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); min-width: 0; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  text-align: left; padding: 10px 12px;
  background: var(--bg-elevated);
  color: var(--text-faint);
  font-weight: 700;
  font-size: 10.8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }

/* Tabelas de resumo (ex.: Visão Anual do Financeiro) — mais espaçadas que as
   tabelas densas de lançamentos, que precisam caber muitos campos por linha. */
table.table-spaced { font-size: 13px; }
table.table-spaced thead th { padding: 14px 18px; }
table.table-spaced tbody td { padding: 15px 18px; }
table.table-spaced tfoot td { padding: 15px 18px; }
tbody tr:hover { background: var(--bg-hover); }
/* Linhas do Financeiro (entrada/saída/pendente) com cor bem mais forte que o
   resto do app — aqui o objetivo é o oposto do "sutil": bater o olho. */
tbody tr.row-green { background: color-mix(in srgb, var(--green) 26%, transparent); }
tbody tr.row-red { background: color-mix(in srgb, var(--red) 26%, transparent); }
tbody tr.row-yellow { background: color-mix(in srgb, var(--yellow) 26%, transparent); }
tbody tr.row-green:hover, tbody tr.row-red:hover, tbody tr.row-yellow:hover { filter: brightness(1.12); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 10.8px; font-weight: 700; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.yellow { background: var(--yellow-bg); color: var(--yellow); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.gray { background: var(--bg-hover); color: var(--text-faint); }

.tag { display: inline-flex; padding: 2px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 600; background: rgba(var(--accent-rgb),0.14); color: var(--accent); margin: 2px 3px 2px 0; }
.client-ac-item:hover { background: var(--bg-hover); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-faint); }
.empty-state .icon { width: 40px; height: 40px; margin: 0 auto 12px; opacity: 0.5; }

/* Mini-calendário (Dashboard > Agenda) */
.agenda-cal-header { position: relative; display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding-top: 6px; }
.agenda-cal-title { position: relative; z-index: 1; font-size: 13px; font-weight: 700; text-transform: capitalize; }
.agenda-cal-nav {
  position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.agenda-cal-nav:hover { background: var(--bg-hover); color: var(--text); }
.agenda-cal-nav .icon { width: 12px; height: 12px; }
.agenda-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.agenda-cal-dow { text-align: center; font-size: 9.5px; font-weight: 700; color: var(--text-faint); padding-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px; }
.agenda-cal-cell { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: var(--text-dim); }
.agenda-cal-cell.outside { color: var(--text-faint); opacity: 0.4; }
.agenda-cal-cell.today .agenda-cal-daynum {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.16), 0 3px 12px rgba(var(--accent-rgb), 0.55);
}
/* Bug corrigido: antes esse círculo do "hoje" usava o seletor genérico
   "span", que também pegava o .agenda-cal-dot (também é um <span>) e o
   deixava do mesmo tamanho — duas bolinhas grandes empilhadas. Agora só o
   número do dia (.agenda-cal-daynum) vira círculo. */
.agenda-cal-dot { position: absolute; bottom: 1px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.agenda-cal-cell.today .agenda-cal-dot { background: var(--accent); bottom: -3px; }

/* ============ Calendário (página própria) ============ */
.calendario-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-title { font-size: 15px; font-weight: 700; text-transform: capitalize; }
.cal-grid-page { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-faint); padding-bottom: 8px; text-transform: uppercase; letter-spacing: 0.3px; }
.cal-cell {
  min-height: 96px; min-width: 0; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background 0.12s, border-color .12s;
  box-sizing: border-box;
}
.cal-cell:hover { background: var(--bg-hover); }
.cal-cell.outside { opacity: 0.35; cursor: default; }
.cal-cell.outside:hover { background: transparent; }
.cal-cell.today { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }
.cal-daynum { font-size: 12px; font-weight: 700; color: var(--text-dim); }
.cal-cell.today .cal-daynum { color: var(--accent); }
.cal-chips { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal-chip {
  font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 5px;
  background: rgba(var(--accent-rgb), 0.16); color: var(--accent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-chip.done { background: var(--bg-hover); color: var(--text-faint); text-decoration: line-through; }
.cal-chip.google { background: rgba(66, 133, 244, 0.16); color: #6c9cff; display: flex; align-items: center; gap: 3px; }
.cal-chip.google .icon { width: 9px; height: 9px; flex-shrink: 0; }
.cal-chip-more { font-size: 10px; color: var(--text-faint); padding: 2px 6px; }
@media (max-width: 905px) {
  .calendario-layout { grid-template-columns: 1fr; }
  .cal-cell { min-height: 64px; padding: 4px; }
  .cal-chip, .cal-chip-more { font-size: 9px; }
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 300; padding: 24px;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: 100%; max-width: 720px;
  max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal.wide { max-width: 980px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; background: var(--bg-card); z-index: 5;
}
.modal-header h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border-soft); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { cursor: pointer; color: var(--text-faint); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.modal-close:hover { background: var(--bg-hover); color: var(--text); }

/* Kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kanban-col { flex: 0 0 270px; width: 270px; min-width: 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 260px); }
.kanban-col-header { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.kanban-col-title { font-size: 12px; font-weight: 700; min-width: 0; overflow-wrap: break-word; }
.kanban-col-meta { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }
.kanban-col-body {
  padding: 10px; flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column;
  gap: 8px; min-height: 60px; min-width: 0; scrollbar-gutter: stable;
}
.kanban-col-body::-webkit-scrollbar { width: 7px; }
.kanban-col-body::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 4px; }
.kanban-col-title[data-col-title] { cursor: text; border-radius: 4px; padding: 2px 4px; margin: -2px -4px; }
.kanban-col-title[data-col-title]:hover { background: var(--bg-hover); }
.kanban-col-body.drag-over { background: rgba(var(--accent-rgb), 0.08); }

.kcard { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 11px 12px; cursor: grab; transition: box-shadow .12s, border-color .12s; min-width: 0; min-height: 64px; overflow: hidden; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; }
.kcard .kc-content-icons { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--text-faint); }
.kcard .kc-content-icons .icon { width: 12px; height: 12px; }
.kcard:hover { border-color: rgba(var(--accent-rgb), 0.4); }
.kcard.dragging { opacity: 0.4; }
.kcard.drag-over-top { box-shadow: 0 -3px 0 0 var(--accent); }
.kcard.drag-over-bottom { box-shadow: 0 3px 0 0 var(--accent); }
.kcard .kc-top { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.kcard .kc-title { font-weight: 700; font-size: 12.5px; margin-bottom: 6px; flex: 1; min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.kcard .kc-row { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-top: 6px; }
.kcard .kc-score { font-weight: 700; }
.kcard .kc-checklist { font-size: 11px; color: var(--text-faint); margin-top: 6px; }

.kc-check {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--border); background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: transparent; transition: background .12s, border-color .12s, color .12s;
}
.kc-check:hover { border-color: var(--green); }
.kc-check.done { background: var(--green); border-color: var(--green); color: #fff; }
.kc-check svg { width: 12px; height: 12px; }

.kanban-col-header.col-drag-over { background: rgba(var(--accent-rgb), 0.12); }

#review-kanban .kanban-col, #review-kanban .kcard { background: linear-gradient(45deg, #0a0a0a, #313131); }
:root[data-theme="light"] #review-kanban .kanban-col, :root[data-theme="light"] #review-kanban .kcard { background: var(--bg-elevated); }
:root[data-theme="light"] #review-kanban .kcard { background: var(--bg-card); }

/* Board floating panel */
.board-panel-toggle {
  position: fixed; top: 50%; right: 0; transform: translateY(-50%);
  width: 30px; height: 60px; border-radius: 10px 0 0 10px;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 95; border: none; box-shadow: -4px 0 14px rgba(0,0,0,0.25);
  transition: right .25s ease;
}
.board-panel-toggle .icon { width: 16px; height: 16px; }
.board-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 360px; max-width: 90vw; background: var(--bg-elevated); border-left: 1px solid var(--border);
  overflow-y: auto; z-index: 90; padding: 18px; transition: transform .25s ease;
  box-shadow: -10px 0 30px rgba(0,0,0,0.25);
}
.board-panel.closed { transform: translateX(100%); }
.panel-section { margin-bottom: 22px; }
.panel-section-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-faint); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.panel-task-item, .panel-check-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.panel-task-item span, .panel-check-item span { flex: 1; }
.panel-task-item.done span, .panel-check-item.done span { text-decoration: line-through; color: var(--text-faint); }
.panel-checklist-group { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 10px; margin-bottom: 10px; }
.panel-checklist-group-title { font-weight: 700; font-size: 12px; margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }

.progress-bar { height: 6px; border-radius: 4px; background: var(--bg-hover); overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }

/* Auth screen */
.auth-screen { width: 100%; min-height: 100vh; display: flex; background: var(--bg); }
.auth-hero { display: none; background-color: var(--auth-hero-bg, var(--bg-card)); background-size: cover; background-position: center; }
.auth-panel { flex: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; }
/* Mesmo degradê escuro dos "cards escuros" (.dash-gradient) em vez do
   --bg-card chapado — no login o card fica sozinho contra o fundo, sem
   nada em volta pra disfarçar, então a diferença de tom (cinza-claro vs. o
   preto do resto da tela) ficava bem mais visível aqui do que em qualquer
   outra página. */
.auth-card { width: 100%; max-width: 380px; background: linear-gradient(45deg, #0a0a0a, #313131); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.auth-logo { margin-bottom: 18px; display: flex; justify-content: center; }
.auth-card h1 { margin: 0; font-size: 20px; text-align: center; }
.auth-card .page-sub { text-align: center; }
.auth-error { font-size: 12px; color: var(--red); background: var(--red-bg); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 12px; }
.auth-error.auth-success { color: var(--green); background: var(--green-bg); }
.btn.w-full { width: 100%; }

.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap .input { padding-left: 34px; width: 100%; }
.auth-input-icon { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--text-faint); pointer-events: none; }
.auth-input-wrap .input[type="password"], .auth-input-wrap .input[id="auth-password"] { padding-right: 34px; }
.auth-input-toggle { position: absolute; right: 6px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--text-faint); cursor: pointer; border-radius: var(--radius-sm); padding: 0; }
.auth-input-toggle:hover { color: var(--text); background: var(--bg-hover); }
.auth-input-toggle .icon { width: 15px; height: 15px; }

.auth-remember-row { display: flex; align-items: center; gap: 8px; margin: 14px 0 16px; }
.auth-toggle-switch { position: relative; width: 34px; height: 19px; display: inline-block; flex-shrink: 0; cursor: pointer; }
.auth-toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.auth-toggle-switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background 0.15s; }
.auth-toggle-switch span::before { content: ""; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform 0.15s; }
.auth-toggle-switch input:checked + span { background: var(--btn-primary-bg, var(--accent)); }
.auth-toggle-switch input:checked + span::before { transform: translateX(15px); }
.auth-remember-label { font-size: 12.5px; color: var(--text-dim); }

.auth-btn-submit { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px; }
.auth-btn-submit .icon { width: 15px; height: 15px; }

.auth-panel-mark { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; font-size: 10px; opacity: 0.3; }

@media (min-width: 900px) {
  .auth-hero { display: block; flex: 1.4; min-height: 100vh; background-image: none; }
  .auth-panel { flex: 0 0 460px; background: var(--bg); }
  .auth-panel .auth-card { background: transparent; border: none; box-shadow: none; padding: 0; max-width: 320px; }
}

@media (max-width: 899px) {
  .auth-screen { flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 16px; gap: 16px; min-height: 100vh; }
  .auth-hero { display: block; width: 100%; height: 220px; border-radius: var(--radius-lg); flex: none; background-image: none; }
  .auth-panel { flex: none; min-height: 0; padding: 0; width: 100%; display: block; }
  .auth-panel .auth-card { max-width: 100%; margin: 0 auto; }
  .auth-panel-mark { display: none; }
}

.checklist-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.checklist-item input { accent-color: var(--accent); }
.checklist-item.done span { text-decoration: line-through; color: var(--text-faint); }

/* Card context menu */
.context-menu { position: fixed; z-index: 400; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 6px; min-width: 195px; }
.context-menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12.5px; cursor: pointer; color: var(--text-dim); }
.context-menu-item:hover { background: var(--bg-hover); color: var(--text); }
.context-menu-item .icon { width: 15px; height: 15px; }
.context-menu-item.danger { color: var(--red); }
.context-menu-sep { height: 1px; background: var(--border-soft); margin: 5px 2px; }

/* Toast */
.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 500; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 12px 16px; border-radius: var(--radius-md); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; animation: slideIn .32s ease; }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Misc utils */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; min-width: 0; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-bold { font-weight: 700; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border-soft); margin: 16px 0; }

.color-swatch { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); }
.logo-upload-box { width: 100%; height: 90px; border: 1px dashed var(--border); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; cursor: pointer; background: var(--bg-elevated); overflow: hidden; }
.logo-upload-box img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ============ Loading screen (boot) ============ */
.loading-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 100vh; width: 100%; background: var(--bg); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--accent, #11F512); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Animações de entrada (toda a plataforma) ============ */
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalPop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.card, .kpi-card, .auth-card, tbody tr { animation: fadeSlideUp 0.6s ease both; }
.modal { animation: modalPop 0.4s ease both; }
.kcard, .board-gallery-item { animation: fadeSlideUp 0.55s ease both; }

.kcard:nth-child(1), .board-gallery-item:nth-child(1), .kpi-card:nth-child(1) { animation-delay: 0ms; }
.kcard:nth-child(2), .board-gallery-item:nth-child(2), .kpi-card:nth-child(2) { animation-delay: 60ms; }
.kcard:nth-child(3), .board-gallery-item:nth-child(3), .kpi-card:nth-child(3) { animation-delay: 120ms; }
.kcard:nth-child(4), .board-gallery-item:nth-child(4), .kpi-card:nth-child(4) { animation-delay: 180ms; }
.kcard:nth-child(5), .board-gallery-item:nth-child(5), .kpi-card:nth-child(5) { animation-delay: 240ms; }
.kcard:nth-child(6), .board-gallery-item:nth-child(6) { animation-delay: 300ms; }
.kcard:nth-child(7), .board-gallery-item:nth-child(7) { animation-delay: 360ms; }
.kcard:nth-child(8), .board-gallery-item:nth-child(8) { animation-delay: 420ms; }

@media (prefers-reduced-motion: reduce) {
  .card, .kpi-card, .auth-card, tbody tr, .modal, .kcard, .board-gallery-item { animation: none; }
}

/* ============ SDR > Checklist (js/pages/sdr-checklist.js) ============ */
.sdr-check-day { transition: border-color .2s ease; }
.sdr-check-day.today { border-color: var(--accent); }
.sdr-check-day.completed { border-color: var(--green); }
.sdr-check-day-head { padding: 14px 18px; cursor: pointer; }
.sdr-check-day-head:hover { background: var(--bg-hover); }
.sdr-check-day-tasks { padding: 0 18px 14px; }
.sdr-check-task { padding: 10px 0; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
@media (max-width: 700px) {
  .sdr-check-task { gap: 8px; }
  .sdr-check-task label { flex-basis: 100%; }
}

/* ============ Portal do Cliente (revisao.js) ============ */
/* Menu lateral fixo no desktop; vira barra flutuante embaixo no mobile
   (ver .revisao-mobile-nav, só visível no media query <=905px abaixo). */
/* width:100% obrigatório — #app carrega "app-shell" (display:flex) fixo
   desde o index.html, então sem isso .revisao-shell (agora o elemento raiz
   desta página) vira um item flex "encolhido pro conteúdo" em vez de
   esticar pra tela toda (mesma causa já corrigida em .revisao-portal-wrap). */
.revisao-shell { display: flex; width: 100%; min-height: 100vh; box-sizing: border-box; }
/* Mesmo padrão visual do menu lateral principal (.sidebar/.nav-item em
   js/app.js): degradê vertical, marca no topo com borda inferior, item
   ativo com fundo neutro + barrinha de destaque na borda direita — em vez
   do estilo próprio (degradê diagonal, destaque chapado) que esta página
   tinha antes. */
.revisao-sidebar {
  width: 240px; flex-shrink: 0; align-self: flex-start; position: sticky; top: 0;
  height: 100vh; background: linear-gradient(to bottom, var(--bg-elevated) 0%, #000 100%); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; box-sizing: border-box;
}
.revisao-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 12px 18px 19px; border-bottom: 1px solid var(--border-soft);
  min-height: var(--topbar-h); flex-shrink: 0; box-sizing: border-box;
  font-size: 15px; font-weight: 700; letter-spacing: 0.2px; overflow: hidden;
}
.revisao-sidebar-brand img.logo-icon { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.revisao-sidebar-brand img.brand-wordmark { height: 30px; max-height: 30px; width: auto; object-fit: contain; flex-shrink: 0; }
.revisao-sidebar-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.revisao-sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.revisao-sidebar-nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px; padding: 9px 0 9px 16px;
  border-radius: var(--radius-sm); border: none; background: transparent;
  color: var(--text-dim); font-size: 13.5px; font-weight: 500; cursor: pointer;
  text-align: left; width: 100%; white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.revisao-sidebar-nav-item:hover { background: var(--bg-hover); color: var(--text); }
.revisao-sidebar-nav-item.active {
  background: linear-gradient(to top, var(--bg-card) 0%, var(--bg-hover) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: #fff;
}
.revisao-sidebar-nav-item.active::after {
  content: "";
  position: absolute; top: 50%; right: 2px; transform: translateY(-50%);
  width: 3px; height: 44%; border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 9px 2px rgba(var(--accent-rgb), 0.75);
}
.revisao-sidebar-nav-item .icon { width: 17px; height: 17px; flex-shrink: 0; }
.revisao-main { flex: 1; min-width: 0; }

.revisao-mobile-nav { display: none; }

/* #app carrega a classe "app-shell" (display:flex) fixa desde o index.html,
   usada pelo painel interno — sem "width:100%" aqui, esse wrap virava um
   item flex "encolhido pro conteúdo" em vez de esticar pra tela toda. */
.revisao-portal-wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 40px 48px; box-sizing: border-box; }
.revisao-alert {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--yellow-bg); border: 1px solid rgba(255,200,87,0.35);
  border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 32px;
}
.revisao-alert-icon { color: var(--yellow); display: flex; }
.revisao-alert-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--yellow); }
.revisao-alert-sub { font-size: 14px; font-weight: 700; margin-top: 2px; }
/* Botão "Sair" e a setinha dos avisos usam o cinza-azulado padrão do resto
   do sistema (--bg-card) por herdarem .btn/.icon-btn genéricos — no portal
   do cliente o tom certo é o mesmo neutro escuro do menu lateral. */
#btn-sair-revisao, .revisao-alert .icon-btn {
  background: #1a1a1a; border-color: #2a2a2a;
}
#btn-sair-revisao:hover, .revisao-alert .icon-btn:hover { background: #242424; }
:root[data-theme="light"] #btn-sair-revisao, :root[data-theme="light"] .revisao-alert .icon-btn {
  background: var(--bg-card); border-color: var(--border);
}

.revisao-hero { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.revisao-hero-main {
  border-radius: var(--radius-lg); min-height: 320px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; background-color: var(--bg-elevated);
}
.revisao-hero-main::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.78) 100%);
}
.revisao-hero-overlay { position: relative; z-index: 1; display: flex; flex-direction: column; flex: 1; padding: 26px; color: #fff; }
.revisao-hero-overlay .pill { background: rgba(0,0,0,0.45); color: #fff; backdrop-filter: blur(2px); }
.revisao-hero-title { font-size: 22px; font-weight: 800; color: #fff; }
.revisao-hero-pct { font-size: 36px; font-weight: 800; color: #fff; }

.revisao-hero-stats { display: flex; flex-direction: column; gap: 22px; }
.revisao-stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
/* Mesmo gradiente escuro da Dashboard interna, só nos 4 cards de resumo da
   Visão Geral do portal do cliente — não no .revisao-stat-card genérico
   (que também é usado pelos cards de Objetivo em Atividades, sem relação). */
.revisao-stat-card.dash-gradient { background: linear-gradient(45deg, #0a0a0a, #313131); }
:root[data-theme="light"] .revisao-stat-card.dash-gradient { background: var(--bg-card); }
.revisao-stat-icon { width: 34px; height: 34px; border-radius: 9px; background: rgba(var(--accent-rgb),0.14); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.revisao-stat-icon .icon { width: 17px; height: 17px; }
.revisao-stat-label { font-size: 11px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.revisao-stat-value { font-size: 26px; font-weight: 800; margin-top: 4px; }

.revisao-folder-grid { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.revisao-folder-item {
  width: 170px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s ease, transform .15s ease;
}
.revisao-folder-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.revisao-folder-item.dash-gradient { background: linear-gradient(45deg, #0a0a0a, #313131); }
:root[data-theme="light"] .revisao-folder-item.dash-gradient { background: var(--bg-card); }
.revisao-folder-item .icon { width: 20px; height: 20px; color: var(--accent); }
.revisao-folder-name { font-size: 12.5px; font-weight: 700; }

.revisao-demand-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.revisao-demand-item { display: flex; gap: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
.revisao-demand-cover { width: 160px; flex-shrink: 0; border-radius: var(--radius-md); background-color: var(--bg-elevated); position: relative; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.revisao-demand-cover-play { width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; display: flex; align-items: center; justify-content: center; }
.revisao-demand-body { flex: 1; min-width: 0; }
.revisao-demand-title { font-size: 15px; font-weight: 700; margin-top: 6px; }

/* ============ Mobile (<=905px): menu no topo, prioridade a 1 coluna ============ */
@media (max-width: 905px) {
  /* iOS Safari dá zoom automático ao focar um campo com fonte menor que
     16px — isso é o que parecia um "bug de zoom" ao preencher e-mail/senha
     no celular. Sobe a fonte só no mobile, sem mudar o visual compacto do
     desktop. */
  .select, .input, .textarea { font-size: 16px; }

  .mobile-menu-toggle { display: flex; }

  .app-shell { flex-direction: column; }

  .sidebar {
    width: 100%;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: auto;
    height: 56px;
    overflow: hidden;
    border-right: none;
    border-bottom: 1px solid var(--border);
    transition: height 0.2s ease;
  }
  .sidebar.mobile-open {
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
  }
  .sidebar:hover, .sidebar:focus-within { width: 100%; box-shadow: none; }
  .sidebar.mobile-open:hover, .sidebar.mobile-open:focus-within { box-shadow: 0 12px 28px rgba(0,0,0,0.35); }

  .sidebar-logo { width: 100%; min-height: 56px; flex-shrink: 0; padding: 0 14px; }
  .sidebar-logo .logo-icon, .sidebar-logo .logo-fallback { display: flex !important; }
  .sidebar-logo .brand-name, .sidebar-logo .brand-wordmark { opacity: 1 !important; max-width: 200px !important; display: inline-block !important; }

  .sidebar-nav, .sidebar-footer { display: none; }
  .sidebar.mobile-open .sidebar-nav, .sidebar.mobile-open .sidebar-footer { display: block; }
  .sidebar-nav { padding: 10px 14px; }
  .nav-item, .sidebar-footer a { padding: 11px 10px; gap: 12px; }
  .nav-item span, .sidebar-footer a span { opacity: 1 !important; max-width: 200px !important; }
  /* Minimizar não existe no menu mobile (é sempre gaveta cheia ou fechada). */
  .sidebar-collapse-toggle { display: none !important; }

  .main-area { margin-left: 0; margin-top: 56px; }
  .page-content { padding: 14px; }

  /* Abas com muitos itens (ex.: os 12 meses do Financeiro) não cabem na
     tela — rolam de lado (".tabs" já tem overflow-x:auto), mas sem
     nenhuma pista visual isso parecia "cortado"/quebrado. O degradê no
     fim esmaece a última aba visível, indicando que dá pra arrastar. */
  .tab { padding: 8px 10px; font-size: 11.5px; }
  .tabs {
    mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
  }

  /* Prioridade a 1 coluna: qualquer grid (por classe ou inline) vira coluna única */
  .grid-5, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  .sticky-side { position: static; max-height: none; }

  /* Financeiro (js/pages/financeiro.js): no mobile o resumo do fluxo de
     caixa aparece ANTES da planilha de lançamentos (mesma linha do grid,
     só troca a ordem visual). */
  #cashflow-panel { order: 1; }
  .fin-lancamentos-card { order: 2; }

  /* Tabelas largas (Configurações > Equipe): tinham várias colunas com
     largura fixa pensada pra desktop — no celular isso virava uma faixa
     horizontal gigante, quase ilegível. ".resp-table" (marcada na tag
     <table>, ver js/utils.js U.responsiveTable que copia o texto de cada
     <th> pro data-label do <td> da coluna) vira uma lista de cartões: cada
     linha empilha os campos em bloco, com o nome da coluna acima, ocupando
     a largura toda. */
  .resp-table thead { display: none; }
  .resp-table, .resp-table tbody, .resp-table tr, .resp-table td { display: block; width: 100%; }
  .resp-table tr {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    padding: 10px 12px;
  }
  .resp-table td { border: none; padding: 7px 0; }
  .resp-table td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-faint);
    margin-bottom: 4px;
  }
  .resp-table td input.input, .resp-table td select.select { width: 100% !important; }
  .table-wrap:has(.resp-table) { border: none; overflow-x: visible; }

  /* Lançamentos (#fin-table): pedido explícito pra manter a tabela/planilha
     de verdade (não virar cartão) — só esconde as colunas menos usadas no
     dia a dia (NF, Nº Nota, Emissão, Observações) pra sobrar menos coluna
     pra rolar de lado. O resto (Data, Cliente, Tipo, Valor, Descrição,
     Categoria) continua editável do jeito que já era. */
  #fin-table th:nth-child(6), #fin-table td:nth-child(6),
  #fin-table th:nth-child(7), #fin-table td:nth-child(7),
  #fin-table th:nth-child(8), #fin-table td:nth-child(8),
  #fin-table th:nth-child(10), #fin-table td:nth-child(10) {
    display: none;
  }
  .table-wrap:has(#fin-table) {
    mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
  }
  /* Deixa a planilha mais compacta: cabeçalho, espaçamento das células e
     texto dos campos menores, e as colunas visíveis mais estreitas.
     Truque pro texto pequeno não disparar o zoom automático do iOS ao
     tocar pra editar: o campo volta pra 16px só enquanto está com foco
     (é nesse instante que o iOS decide se dá zoom ou não), e encolhe nas
     de novo ao perder o foco. */
  #fin-table thead th { font-size: 9.5px; padding: 6px 6px; }
  #fin-table tbody td { padding: 5px 6px; }
  #fin-table input.input, #fin-table select.select { font-size: 9px; }
  #fin-table input.input:focus, #fin-table select.select:focus { font-size: 16px; }
  #fin-table td:nth-child(1) input { max-width: 108px; }
  #fin-table td:nth-child(2) input { max-width: 100px; }
  #fin-table td:nth-child(3) select { max-width: 90px; }
  #fin-table td:nth-child(4) input { max-width: 76px; }
  #fin-table td:nth-child(5) input { max-width: 130px; }
  #fin-table td:nth-child(9) select { max-width: 120px; }

  /* Visão Anual do Financeiro (.table-spaced): continua tabela normal (o
     formato de cartão ficou pior aqui, era só um resumo curto) — só reduz
     o espaçamento pra caber as 4 colunas sem passar da largura da tela. */
  table.table-spaced { font-size: 11.5px; }
  table.table-spaced thead th, table.table-spaced tbody td, table.table-spaced tfoot td { padding: 9px 6px; }

  /* CRM (#crm-table): mesmo pedido — volta a ser tabela normal (não
     cartão), só com fonte/espaçamento menores e o nome do cliente
     truncado (reticências) em vez de quebrar em 2 linhas e empurrar as
     outras colunas pra fora. */
  #crm-table { font-size: 11px; }
  #crm-table thead th { font-size: 9.5px; padding: 6px 8px; }
  #crm-table tbody td { padding: 6px 8px; }
  #crm-table td:nth-child(1) { max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* WhatsApp, Etiquetas e Pendente ocultos no celular — o filtro de
     etiqueta já fica acima da tabela, e os outros dois cabem melhor
     abrindo o cliente (botão "Ver"). */
  #crm-table th:nth-child(2), #crm-table td:nth-child(2),
  #crm-table th:nth-child(3), #crm-table td:nth-child(3),
  #crm-table th:nth-child(5), #crm-table td:nth-child(5) {
    display: none;
  }
  .table-wrap:has(#crm-table) {
    mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
  }

  .notif-panel { width: calc(100vw - 28px); right: 14px; }

  .modal-overlay { padding: 10px; }
  .modal, .modal.wide { max-width: 100%; }
  .modal-body { padding: 14px; }
  .modal-footer { flex-wrap: wrap; }

  .kanban-col { flex-basis: 86vw; width: 86vw; max-height: calc(100vh - 220px); }
  /* Mesma pista visual de rolagem das abas (ver .tabs acima): sem isso,
     a próxima coluna do quadro parecia só "cortada" na borda da tela. */
  .kanban {
    mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
  }

  /* Galeria de quadros (Entregas): colunas um pouco mais estreitas no
     celular pra caber 2 por linha confortavelmente, ainda esticando pra
     preencher a largura toda (ver .board-gallery em regra não-mobile). */
  .board-gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .board-gallery.compact { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

  .revisao-sidebar { display: none; }
  .revisao-mobile-nav {
    display: flex; position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    max-width: 90vw; overflow-x: auto;
    background: linear-gradient(45deg, #0a0a0a, #313131); border: 1px solid #2a2a2a; border-radius: 20px;
    padding: 8px; gap: 2px; z-index: 50; box-shadow: var(--shadow);
  }
  :root[data-theme="light"] .revisao-mobile-nav { background: var(--bg-card); border-color: var(--border); }
  .revisao-mobile-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0;
    padding: 8px 12px; border: none; background: transparent; color: var(--text-faint);
    font-size: 10px; font-weight: 700; border-radius: 14px; cursor: pointer; white-space: nowrap;
  }
  .revisao-mobile-nav-item.active { color: var(--accent); background: rgba(var(--accent-rgb), 0.14); }
  .revisao-mobile-nav-item .icon { width: 19px; height: 19px; }

  .revisao-portal-wrap { padding: 16px 12px 100px; }
  .revisao-hero { grid-template-columns: 1fr; gap: 14px; }
  .revisao-hero-main { min-height: 0; aspect-ratio: 4/3; }
  .revisao-hero-stats { flex-direction: column; }
  .revisao-demand-item { flex-direction: column; }
  .revisao-demand-cover { width: 100%; aspect-ratio: 16/9; }

  .board-panel { width: 100%; max-width: 100%; }

  .section-header { gap: 10px; }
}

@media print { .sidebar, .notif-fab { display: none; } .main-area { margin-left: 0; } }

/* ============ Sistema de ícones — glyph solto, sem caixa ============ */
.app-icon-box {
  --icon-size: 44px;
  width: var(--icon-size);
  height: var(--icon-size);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-icon-box.disabled { opacity: 0.55; }
.app-icon-box.disabled.disabled .icon { stroke: #6b7280; }

/* Glyph solto direto sobre o container escuro (sem card branco interno —
   o próprio container já é a "caixa"). Prata (ou a cor customizada em
   Aparência) por padrão; vira a cor de destaque dos botões quando o item
   está selecionado/ativo. */
.app-icon-box.app-icon-box .icon {
  width: 52%;
  height: 52%;
  stroke: var(--icon-color, url(#icon-metallic-gradient));
  stroke-width: 2.1;
  transition: stroke 0.15s ease;
}
.app-icon-box.active.active .icon, .app-icon-box.selected.selected .icon {
  stroke: var(--btn-primary-bg, var(--accent));
}

.nav-item .app-icon-box, .sidebar-footer a .app-icon-box {
  --icon-size: 30px;
}
.nav-item.active .app-icon-box.active .icon,
.sidebar-footer a.active .app-icon-box.active .icon {
  stroke: #fff;
}

/* Menu minimizado: centraliza o ícone na coluna estreita em vez de
   ancorar no padding-esquerdo usado quando o menu está expandido. */
.app-shell.sidebar-collapsed .nav-item,
.app-shell.sidebar-collapsed .sidebar-footer a,
.app-shell.sidebar-collapsed .sidebar-footer .nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  gap: 0; /* span do rótulo continua no DOM (largura 0) — sem isso o "gap"
             reservava espaço fantasma e descentralizava o ícone */
}

/* ============ Stat cards "glass" (novo design — em teste, 2 exemplos) ============
   Cores controladas via CSS custom properties, definidas em app.js a
   partir de Configurações > Aparência > "Cards de Métrica" (sempre com um
   valor concreto — nunca dependem de fallback do var() aqui). */
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--card-glass-gradient), var(--bg-card);
  border: 1px solid var(--stat-border-color);
  box-shadow: 0 10px 22px -16px rgba(0,0,0,0.65);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
:root[data-theme="light"] .stat-card {
  box-shadow: 0 10px 20px -16px rgba(0,0,0,0.22);
}
html.stat-glow-strong .stat-card:not(.stat-highlight) {
  box-shadow: 0 14px 30px -14px rgba(0,0,0,0.7);
}
.stat-badge {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.stat-badge .icon { width: 18px; height: 18px; }
.stat-label { font-size: 11.5px; color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: var(--stat-text-color); }
.stat-change {
  display: inline-flex; align-items: center; gap: 3px;
  margin-top: 10px; padding: 3px 9px 3px 7px;
  border-radius: 20px; font-size: 11px; font-weight: 700;
}
.stat-change .icon { width: 11px; height: 11px; }
.stat-change.pos { background: var(--green-bg); color: var(--green); }
.stat-change.neg { background: var(--red-bg); color: var(--red); }

.stat-card.stat-highlight {
  /* borda real (não transparente) — uma borda transparente deixava o
     contorno "incompleto" nos cantos arredondados, pegando só nas
     laterais retas por causa do desenho do glow por baixo. */
  border-color: var(--stat-highlight-border);
  box-shadow: 0 18px 42px -12px var(--stat-highlight-shadow, rgba(124,92,255,0.55)), 0 4px 14px rgba(0,0,0,0.35);
}
.stat-card.stat-highlight .stat-label { color: rgba(255,255,255,0.85); }
.stat-card.stat-highlight .stat-value { color: #fff; }
.stat-card.stat-highlight .stat-change { background: rgba(255,255,255,0.22); color: #fff; }

/* Card "carteira" do Entradas na Dashboard: saldo + botão "+" (vai pro
   Financeiro) + lista de transações recentes do mês logo abaixo. Ao lado:
   Despesas/Lucro (cards escuros) e o card de Atividades da semana. */
/* Flex (não grid) de propósito: a 3ª coluna (Minha Agenda) precisa ficar
   com a MESMA altura das colunas 1+2 mesmo quando tem mais conteúdo — num
   grid com align-items:stretch a linha inteira cresceria junto. Em flex
   com align-items:flex-start as colunas 1/2 mantêm a altura natural delas,
   e o JS (syncAgendaCardHeight, em js/pages/dashboard.js) mede essa altura
   e aplica na coluna 3, que rola por dentro (.agenda-week-list) o que não
   couber. */
.dash-top-row { display: flex; align-items: flex-start; gap: 16px; }
.dash-top-row > *:nth-child(1) { flex: 0 0 300px; min-width: 240px; }
.dash-top-row > *:nth-child(2) { flex: 1 1 0; min-width: 200px; }
.dash-top-row > *:nth-child(3) { flex: 0 0 320px; min-width: 260px; overflow: hidden; }
@media (max-width: 905px) {
  .dash-top-row { flex-direction: column; }
  .dash-top-row > * { flex: 1 1 auto; width: 100%; }
  /* No mobile a ordem pedida é Entradas, Despesas, Lucro, Evolução
     Financeira — só que essas duas primeiras estão dentro dos mesmos
     wrappers ".flex-col" que Transações/Agenda (usados pro layout de 3
     colunas do desktop). display:contents "dissolve" os wrappers só aqui,
     promovendo os cards a irmãos diretos de .dash-top-row, daí o `order`
     de cada um decide a sequência. */
  .dash-top-row > .flex-col { display: contents; }
  .dash-top-row > .flex-col > * { flex: 1 1 auto; width: 100%; }
  #wallet-card-block { order: 1; }
  #kpi-row { order: 2; }
  .dash-card-evolucao { order: 3; }
  .dash-card-transacoes { order: 4; }
  .dash-card-agenda { order: 5; }
}

/* Despesas/Lucro: estilo fixo (gradiente sólido 45°), não segue as cores
   configuráveis de Configurações > Aparência como os outros cards. */
.dash-dark-card {
  position: relative;
  background: linear-gradient(45deg, #0a0a0a, #313131);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  color: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: 0 10px 24px -14px rgba(0,0,0,0.7);
}
.dash-dark-card-label { font-size: 14.5px; font-weight: 700; color: rgba(255,255,255,0.92); }
.dash-dark-card-value { font-size: 32px; font-weight: 800; letter-spacing: -0.01em; color: #fff; margin-top: 12px; }
.dash-dark-card-trend { margin-top: 10px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.dash-dark-card-trend .icon { width: 13px; height: 13px; }
.dash-dark-card-trend.pos { color: var(--green); }
.dash-dark-card-trend.neg { color: var(--red); }

/* Banner no topo do Dashboard — placeholder clicável até subir uma imagem,
   depois vira a imagem de verdade (base64 em settings.dashboardBanner, ver
   js/pages/dashboard.js). */
.dash-banner-placeholder {
  width: 100%;
  min-height: 320px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 12.5px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.dash-banner-placeholder:hover { border-color: var(--accent); color: var(--text-dim); }
.dash-banner-placeholder .icon { width: 22px; height: 22px; }

.dash-banner { position: relative; width: 100%; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 16px; background: var(--bg-card); }
.dash-banner img { width: 100%; display: block; }
.dash-banner-edit { position: absolute; top: 10px; right: 10px; opacity: 0; transition: opacity 0.12s ease; }
.dash-banner:hover .dash-banner-edit { opacity: 1; }
@media (max-width: 905px) { .dash-banner-edit { opacity: 1; } }

/* "Minha Agenda" no Dashboard: tira semanal + compromissos da semana
   abaixo (ver paintAgenda em js/pages/dashboard.js). Sem itens = espaço
   em branco de propósito; com mais itens do que cabe, rola dentro da
   lista (a altura do card todo é fixa, definida pelas colunas ao lado). */
.agenda-week-strip { display: flex; gap: 4px; }
.agenda-week-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 0; }
.agenda-week-cell .dow { font-size: 9.5px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.3px; }
.agenda-week-cell .num {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: var(--text-dim);
}
.agenda-week-cell.today .num { background: var(--accent); color: #fff; }
.agenda-week-list { flex: 1; overflow-y: auto; min-height: 0; }

/* Mesmo gradiente escuro aplicado a cards de conteúdo maior (Transações,
   Evolução Financeira, Agenda, Top Clientes, Top Categorias) — só troca o
   fundo, mantém o resto do .card normal. Só no tema escuro: no claro esses
   cards têm texto escuro, então o gradiente fixo ficaria ilegível — volta
   pro fundo padrão do .card nesse caso. */
.card.dash-gradient { background: linear-gradient(45deg, #0a0a0a, #313131); }
:root[data-theme="light"] .card.dash-gradient { background: var(--card-glass-gradient), var(--bg-card); }

.wallet-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-lg);
  color: #fff;
  box-shadow: 0 18px 42px -12px var(--stat-highlight-shadow, rgba(61,220,132,0.5)), 0 4px 14px rgba(0,0,0,0.35);
}
.wallet-card-label { font-size: 14.5px; font-weight: 700; color: rgba(255,255,255,0.92); margin-bottom: 10px; }
.wallet-card-value { font-size: 32px; font-weight: 800; letter-spacing: -0.01em; }
.wallet-card-sub { margin-top: 8px; }
.wallet-card-btn {
  position: absolute; top: 18px; right: 18px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer; border: none;
  transition: background 0.15s ease;
}
.wallet-card-btn:hover { background: rgba(255,255,255,0.34); }
.wallet-card-btn .icon { width: 18px; height: 18px; }
.wallet-card .stat-change { background: rgba(255,255,255,0.22); color: #fff; }

.tx-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.tx-row:last-child { border-bottom: none; }
.tx-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0; }
.tx-name { font-size: 12.5px; font-weight: 600; }
.tx-date { font-size: 10.5px; color: var(--text-faint); margin-top: 2px; }
.tx-value { font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.tx-value.pos { color: var(--green); }
.tx-value.neg { color: var(--red); }
