﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Variaveis legadas do CRM mapeadas para os tokens OrtusOS (ortus-tokens.css) */
:root {
  --bg: var(--surface-app);
  --surface: var(--surface-card);
  --surface-2: var(--gray-100);
  --surface-3: var(--gray-150);
  --card: var(--surface-card);
  --card-hover: var(--gray-50);
  --border: var(--border-subtle);
  --text: var(--pine-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  /* Destaque: Lima para preenchimentos; --accent-ink para texto/icone de destaque (Lima e ilegivel sobre branco) */
  --accent: var(--lime-500);
  --accent-light: var(--lime-400);
  --accent-hover: var(--lime-600);
  --accent-dark: var(--lime-700);
  --accent-glow: rgba(159, 232, 112, 0.35);
  --accent-ink: var(--pine-900);
  --gold: var(--lime-500);
  --gold-light: var(--lime-300);
  --gold-dark: var(--lime-600);
  --gold-gradient: var(--lime-500);
  --white: #FFFFFF;
  --status-negociacao: var(--amber-500);
  --status-fechado: var(--blue-500);
  --status-produzido: var(--pine-600);
  --status-pago: var(--lime-700);
  --status-postado: var(--pine-900);
  --status-recusa: var(--red-500);
  --status-followup: var(--gray-500);
  --status-proposta: var(--pine-400);
  --danger: var(--red-500);
  --radius: var(--radius-xl);
  --radius-sm: var(--radius-md);
  --shadow: var(--shadow-md);
  --shadow-sm: 0 1px 2px rgba(6,47,40,.04), 0 2px 6px rgba(6,47,40,.04);
  --transition: var(--duration-base) var(--ease-out);
}

/* Sidebar e telas pre-app: superficie escura Pinho do OrtusOS */
.sidebar,
.login-screen, .workspace-screen, .first-login-overlay, .edit-ws-overlay {
  --bg: var(--pine-900);
  --surface: var(--pine-800);
  --surface-2: var(--pine-800);
  --surface-3: var(--pine-700);
  --card: var(--pine-800);
  --card-hover: var(--pine-700);
  --border: rgba(159, 232, 112, 0.12);
  --text: var(--white);
  --text-secondary: var(--pine-200);
  --text-muted: var(--pine-400);
  --accent-ink: var(--lime-500);
  --shadow: 0 4px 24px rgba(0,0,0,0.25);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.18);
}

html { font-size: 16px; }
body {
  font-family: var(--font-sans), -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==================== GLOBAL TRANSITIONS ==================== */
*:not(input):not(textarea):not(select) { transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ==================== LOGIN SCREEN ==================== */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: #062F28;
  background-image: radial-gradient(ellipse at 50% 40%, rgba(159, 232, 112,0.06) 0%, transparent 60%);
  position: relative;
  overflow: hidden;
}
.login-screen::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(159, 232, 112,0.05) 0%, rgba(159, 232, 112,0.02) 40%, transparent 70%);
  pointer-events: none;
}
.login-box {
  background: rgba(14, 61, 53, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(159, 232, 112, 0.1);
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 60px rgba(159, 232, 112, 0.05), 0 25px 50px rgba(0,0,0,0.5);
  animation: loginFadeIn 0.6s ease;
}
@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-box .logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-box .logo h1 {
  font-family: var(--font-sans), sans-serif;
  font-size: 3rem;
  font-weight: 600;
  background: linear-gradient(135deg, #9FE870 0%, #CDF4B2 50%, #9FE870 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 6px;
  text-transform: uppercase;
}
.login-box .logo .brand-accent {
  color: var(--accent-ink);
}
.login-box .logo p {
  font-size: 13px;
  color: rgba(159, 232, 112, 0.6);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 400;
  margin-top: 8px;
}
.login-box .logo .brand-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #9FE870, transparent);
  margin: 24px auto 0;
  border-radius: 2px;
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition);
  outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: rgba(159, 232, 112, 0.5);
  box-shadow: 0 0 0 3px rgba(159, 232, 112, 0.1);
}
.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239a9aac' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.form-group textarea {
  resize: vertical;
  min-height: 80px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--pine-900);
  color: var(--white);
  font-weight: 600;
  border: none;
  box-shadow: var(--shadow-xs);
  width: 100%;
  transition: all 0.3s ease;
}
.btn-primary:hover { background: var(--pine-700); }
.btn-primary:active { transform: scale(0.97); }
/* Em superficies Pinho (login, workspace) o principal vira Lima */
.login-screen .btn-primary, .workspace-screen .btn-primary, .first-login-overlay .btn-primary, .edit-ws-overlay .btn-primary { background: var(--lime-500); color: var(--pine-900); }
.login-screen .btn-primary:hover, .workspace-screen .btn-primary:hover, .first-login-overlay .btn-primary:hover, .edit-ws-overlay .btn-primary:hover { background: var(--lime-600); }
.btn-danger-solid {
  background: linear-gradient(135deg, #E5484D, #e11d48);
  color: #fff;
  font-weight: 600;
  border: none;
  box-shadow: 0 4px 15px rgba(229, 72, 77,0.2);
  transition: all 0.3s ease;
}
.btn-danger-solid:hover { background: linear-gradient(135deg, #fb7185, #E5484D); box-shadow: 0 6px 20px rgba(229, 72, 77,0.35); transform: translateY(-1px); }
.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--card-hover); border-color: var(--text-muted); }
.btn-gold {
  background: var(--gold);
  color: #1a1a24;
}
.btn-gold:hover { background: var(--gold-dark); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--card-hover); color: var(--text); }
.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 12px;
  display: none;
}

/* ==================== FIRST LOGIN OVERLAY ==================== */
.first-login-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(6, 47, 40,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.first-login-overlay.active { display: flex; }
.first-login-box {
  background: rgba(14, 61, 53, 0.8);
  border: 1px solid rgba(159, 232, 112, 0.1);
  border-radius: 24px;
  padding: 44px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 0 60px rgba(159, 232, 112, 0.05), 0 25px 50px rgba(0,0,0,0.5);
  animation: loginFadeIn 0.5s ease;
}
.first-login-box h2 {
  font-family: var(--font-sans), sans-serif;
  font-size: 1.4rem;
  margin-bottom: 6px;
  color: var(--text);
}
.first-login-box p.subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 28px;
}
.first-login-box .form-group { margin-bottom: 16px; }
.first-login-box .btn-gold { width: 100%; margin-top: 8px; }
.first-login-box .wizard-cancel { width: 100%; margin-top: 8px; }

/* Wizard â€” barra de progresso */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}
.wizard-step-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.wizard-step-indicator.active {
  border-color: var(--gold);
  color: var(--accent-ink);
}
.wizard-step-indicator.completed {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg);
}
.wizard-step-line {
  width: 48px;
  height: 2px;
  background: var(--text-muted);
  opacity: 0.3;
  transition: all 0.3s ease;
}
.wizard-step-line.active {
  background: var(--gold);
  opacity: 1;
}

/* Wizard â€” animaÃ§Ã£o de troca de step */
.wizard-step {
  animation: wizardFadeIn 0.3s ease;
}
@keyframes wizardFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Wizard â€” linha de botÃµes (voltar + continuar) */
.wizard-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.wizard-btn-row .btn-secondary { flex: 1; }
.wizard-btn-row .btn-gold { flex: 2; }

/* Wizard â€” tela final (step 3) */
.wizard-done-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(159, 232, 112, 0.12);
  border: 2px solid var(--gold);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 20px;
}
.wizard-tip {
  background: rgba(159, 232, 112, 0.06);
  border: 1px solid rgba(159, 232, 112, 0.12);
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.wizard-tip-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-ink);
  margin-bottom: 6px;
}

/* Wizard â€” select estilizado */
.first-login-box select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6b80' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.first-login-box select:focus {
  border-color: var(--gold);
}

/* ==================== EDIT WORKSPACE MODAL ==================== */
.edit-ws-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(6, 47, 40, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.edit-ws-overlay.active { display: flex; }
.edit-ws-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  animation: loginFadeIn 0.4s ease;
}
.edit-ws-box h2 {
  font-family: var(--font-sans), sans-serif;
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: var(--text);
}
.edit-ws-box .form-group { margin-bottom: 14px; }
.edit-ws-box .modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ==================== WORKSPACE SELECTOR ==================== */
.workspace-screen {
  display: none;
  min-height: 100vh;
  padding: 60px 20px 40px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.workspace-screen::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(159, 232, 112,0.06) 0%, rgba(159, 232, 112,0.02) 30%, transparent 60%);
  pointer-events: none;
}
.workspace-screen.active { display: flex; flex-direction: column; align-items: center; }
.workspace-screen .ws-header {
  text-align: center;
  margin-bottom: 16px;
  animation: wsFadeInUp 0.5s ease;
}
.workspace-screen .ws-header h1 {
  font-family: var(--font-sans), sans-serif;
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}
.workspace-screen .ws-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  letter-spacing: 0.2px;
}
.workspace-screen .ws-user-info {
  text-align: center;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  animation: wsFadeInUp 0.5s ease 0.1s both;
}
.workspace-screen .ws-user-info .avatar {
  width: 40px;
  height: 40px;
  background: var(--lime-500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #062F28;
  font-weight: 500;
  font-size: 1rem;
  box-shadow: 0 2px 12px rgba(159, 232, 112,0.3);
}
.workspace-screen .ws-user-info span {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}
.workspace-screen .ws-logout {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  text-decoration: none;
  transition: color var(--transition);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.workspace-screen .ws-logout:hover { color: var(--danger); border-color: var(--danger); }
.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}
@keyframes wsFadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes wsCardIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.workspace-card {
  background: rgba(14, 61, 53, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(159, 232, 112, 0.06);
  border-radius: 16px;
  padding: 28px 28px 28px 32px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border-left: 4px solid transparent;
  animation: wsCardIn 0.45s ease both;
  display: flex;
  align-items: center;
  gap: 16px;
}
.workspace-card:hover {
  transform: translateY(-3px) scale(1.015);
  border-color: rgba(159, 232, 112, 0.15);
  box-shadow: 0 0 20px rgba(159, 232, 112, 0.05);
}
.workspace-card .ws-card-content {
  flex: 1;
  min-width: 0;
}
.workspace-card .ws-instagram {
  font-family: var(--font-sans), sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text);
  letter-spacing: -0.3px;
}
.workspace-card .ws-name {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}
.workspace-card .ws-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: all 0.35s ease;
  flex-shrink: 0;
  opacity: 0.5;
}
.workspace-card:hover .ws-arrow {
  transform: translateX(4px);
  opacity: 1;
}
.ws-branding {
  text-align: center;
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.4;
  animation: wsFadeInUp 0.5s ease 0.6s both;
}

/* ==================== APP LAYOUT ==================== */
.app { display: none; }
.app.active { display: flex; flex-direction: row; height: 100vh; overflow: hidden; }

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: 224px;
  min-width: 224px;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: left 0.3s ease;
}
.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo-text {
  font-family: var(--font-sans), sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  background: linear-gradient(135deg, #9FE870, #CDF4B2, #9FE870);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 4px;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav .nav-tab {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 10px;
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.sidebar-nav .nav-tab svg { flex-shrink: 0; opacity: 0.65; transition: opacity var(--transition); }
.sidebar-nav .nav-tab:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav .nav-tab:hover svg { opacity: 1; }
.sidebar-nav .nav-tab.active { background: rgba(159, 232, 112,0.12); color: var(--accent-ink); font-weight: 600; border-left: 3px solid var(--accent); padding-left: 10px; }
.sidebar-nav .nav-tab.active svg { opacity: 1; }
.sidebar-nav .nav-tab-settings { margin-top: auto; border-top: 1px solid var(--border); padding-top: 13px; border-radius: 0 0 10px 10px; }
.nav-excl-tag {
  display: inline-flex;
  align-items: center;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--accent-ink);
  padding: 1px 5px;
  border-radius: 3px;
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 1.5;
}
.nav-excl-tag::after {
  content: "Exclusivo para assinantes";
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  background: var(--surface-2);
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 200;
}
.nav-excl-tag:hover::after {
  opacity: 1;
}
.sidebar-footer {
  padding: 12px 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-workspace {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition);
  overflow: hidden;
}
.sidebar-workspace:hover { background: var(--surface-2); }
.sidebar-ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.sidebar-ws-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.sidebar-sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5FB030;
  flex-shrink: 0;
}
.sidebar-user-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 10px;
}
.sidebar-avatar {
  width: 30px !important;
  height: 30px !important;
  font-size: 0.8rem !important;
  flex-shrink: 0;
}
.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all var(--transition);
  flex-shrink: 0;
}
.sidebar-logout-btn:hover { color: var(--danger); background: rgba(229, 72, 77,0.1); }

/* ==================== MAIN WRAPPER ==================== */
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg);
}

/* ==================== TOPNAV (header bar) ==================== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #FFFFFF;
  border-bottom: 2px solid #9FE870;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.topnav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topnav-brand {
  font-weight: 500;
  font-size: 1.05rem;
  color: #9FE870;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity var(--transition);
}
.topnav-brand:hover { opacity: 0.75; }
.workspace-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
}
.workspace-pill:hover { opacity: 0.85; transform: scale(1.02); }
.workspace-pill .pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
  opacity: 0.7;
}
.topnav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hamburger {
  display: none;
  width: 38px;
  height: 38px;
  border: none;
  background: none;
  cursor: pointer;
  color: #062F28;
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background var(--transition);
}
.hamburger:hover { background: var(--surface-2); }
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--surface-2);
  border-radius: 20px;
  font-size: 0.8rem;
  color: #062F28;
}
.user-badge .avatar {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pine-900);
  font-weight: 500;
  font-size: 0.75rem;
}
.logout-btn {
  background: none;
  border: none;
  color: #9A9A9A;
  cursor: pointer;
  font-size: 1rem;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all var(--transition);
}
.logout-btn:hover { color: var(--danger); background: rgba(229, 72, 77,0.08); }

/* ==================== TOPNAV WORKSPACE AREA ==================== */
.topnav-ws-area { position: relative; }
.topnav-ws-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: #062F28;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background var(--transition);
}
.topnav-ws-btn:hover { background: var(--surface-2); }
.topnav-ws-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.topnav-ws-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topnav-ws-arrow {
  color: #9A9A9A;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.topnav-ws-arrow.open { transform: rotate(180deg); }

/* ==================== TOPNAV DROPDOWNS ==================== */
.topnav-dropdown-area { position: relative; }
.topnav-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 300;
  overflow: hidden;
}
.topnav-dropdown-panel.open { display: block; }
.topnav-ws-dropdown { left: 0; right: auto; }
.topnav-ws-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: background var(--transition);
}
.topnav-ws-item:hover { background: var(--surface-2); }
.topnav-ws-item.active { background: rgba(159, 232, 112,0.08); color: #9FE870; font-weight: 600; }
.topnav-ws-item-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Notifications panel */
.notif-panel { min-width: 300px; max-width: 360px; }
.notif-scroll-body { max-height: 420px; overflow-y: auto; }
.notif-panel-header {
  padding: 12px 16px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.notif-section-title {
  padding: 10px 16px 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.notif-item:hover { background: var(--surface-2); }
.notif-item-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.notif-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-item-date { font-size: 0.73rem; color: var(--text-muted); flex-shrink: 0; }
.notif-empty { padding: 20px 16px; text-align: center; font-size: 0.82rem; color: var(--text-muted); }

/* Notification section headers */
.notif-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px 6px;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
.notif-section-atencao { color: #E39B12; background: rgba(227, 155, 18,0.08); }
.notif-section-concluida { color: #5FB030; background: rgba(95, 176, 48,0.08); }

/* Notification cards */
.notif-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.notif-card:hover { background: var(--surface-2); }
.notif-card-atencao:hover { background: rgba(227, 155, 18,0.06); }
.notif-card-concluida:hover { background: rgba(95, 176, 48,0.06); }
.notif-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.notif-icon-atencao { background: rgba(254,243,199,0.15); color: #E39B12; }
.notif-icon-concluida { background: rgba(209,250,229,0.12); color: #059669; }
.notif-card-body { flex: 1; min-width: 0; }
.notif-card-title {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.notif-card-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.notif-card-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid transparent;
}
.notif-tag-atencao {
  color: #E39B12;
  background: #fef3c720;
  border-color: #E39B1230;
}

/* ==================== TOPNAV RIGHT ICONS ==================== */
.topnav-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: #6F767E;
  transition: all var(--transition);
}
.topnav-icon-btn:hover { background: var(--surface-2); color: #062F28; }
.notif-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  background: #E5484D;
  color: white;
  border-radius: 8px;
  font-size: 0.62rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}
.topnav-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 5px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  color: #062F28;
  font-weight: 500;
  transition: all var(--transition);
}
.topnav-profile-btn:hover { background: var(--surface-3); border-color: rgba(159, 232, 112,0.4); }
.topnav-avatar {
  width: 28px !important;
  height: 28px !important;
  font-size: 0.73rem !important;
  background: #9FE870;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  flex-shrink: 0;
}

/* ==================== PROFILE DROPDOWN ==================== */
.profile-dropdown {
  right: 0;
  min-width: 220px;
  padding: 6px 0;
}
.profile-dd-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 10px;
}
.profile-dd-avatar {
  width: 36px !important;
  height: 36px !important;
  font-size: 0.9rem !important;
  flex-shrink: 0;
  background: var(--lime-500);
  color: #062F28;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}
.profile-dd-info { min-width: 0; }
.profile-dd-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-dd-role {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 1px;
  text-transform: capitalize;
}
.profile-dd-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.profile-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 16px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text);
  text-align: left;
  transition: background var(--transition);
}
.profile-dd-item svg { flex-shrink: 0; color: var(--text-secondary); }
.profile-dd-item:hover { background: var(--surface-2); }
.profile-dd-item:hover svg { color: var(--text); }
.profile-dd-logout { color: #E5484D !important; }
.profile-dd-logout svg { color: #E5484D !important; }
.profile-dd-logout:hover { background: rgba(229, 72, 77,0.06) !important; }

/* ==================== PROFILE MODAL ==================== */
.profile-modal { max-width: 420px; width: 90%; }
.profile-modal .form-group { margin-bottom: 16px; }
.profile-modal .form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.profile-modal .form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--transition);
}
.profile-modal .form-control:focus { border-color: var(--accent); }
.profile-modal .form-control:disabled { opacity: 0.5; cursor: not-allowed; }

/* Mobile nav overlay (backdrop) */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.mobile-nav.open { display: block; }

/* Main content */
.main-content {
  flex: 1;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
body.hist-drawer-open .main-content {
  transform: translateX(-210px);
}

/* ==================== AGENDA / CALENDARIO ==================== */
.agenda-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.agenda-month-label {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  text-align: center;
  font-family: var(--font-sans), sans-serif;
  letter-spacing: 0.5px;
}
.agenda-nav-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 18px;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
}
.agenda-nav-btn:hover { background: var(--card); border-color: var(--gold); color: var(--accent-ink); }
.agenda-today-btn {
  background: var(--gold);
  color: #062F28;
  border: none;
  border-radius: 8px;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: opacity var(--transition);
}
.agenda-today-btn:hover { opacity: 0.85; }
.agenda-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.agenda-dow {
  background: var(--surface-2);
  text-align: center;
  padding: 10px 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.agenda-day {
  background: var(--card);
  min-height: 96px;
  padding: 8px;
  position: relative;
  transition: background var(--transition);
  vertical-align: top;
}
.agenda-day-other {
  background: var(--bg);
  opacity: 0.45;
}
.agenda-day-weekend {
  background: rgba(255,255,255,0.018);
}
.agenda-day-today {
  background: rgba(159, 232, 112,0.07);
  box-shadow: inset 0 0 0 1px rgba(159, 232, 112,0.3);
}
.agenda-day-num {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  line-height: 1;
}
.agenda-today-num {
  background: var(--gold);
  color: #062F28;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}
.agenda-event {
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: rgba(159, 232, 112,0.14);
  border-left: 2px solid var(--gold);
  border-radius: 3px;
  padding: 3px 5px;
  margin-bottom: 3px;
  cursor: pointer;
  font-size: 0.68rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: background var(--transition);
}
.agenda-event:hover { background: rgba(159, 232, 112,0.28); }
.agenda-event-mid {
  background: rgba(159, 232, 112,0.22);
  border-left-color: var(--gold);
  opacity: 0.85;
}
.agenda-event-last {
  background: rgba(159, 232, 112,0.14);
  border-left: none;
  border-right: 2px solid var(--gold);
  opacity: 0.85;
}
.agenda-event-time {
  color: var(--text);
  font-weight: 500;
  flex-shrink: 0;
  font-size: 0.66rem;
}
.agenda-event-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
@media (max-width: 768px) {
  .agenda-day { min-height: 60px; padding: 5px; }
  .agenda-day-num { font-size: 0.72rem; }
  .agenda-event { font-size: 0.6rem; padding: 2px 4px; }
  .agenda-event-time { display: none; }
  .agenda-month-label { font-size: 0.95rem; }
}
/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -224px;
    top: 0;
    height: 100vh;
    z-index: 200;
    transition: left 0.3s ease;
    box-shadow: none;
  }
  .sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
  .hamburger { display: flex !important; }
  .user-name-text { display: none; }
}

/* ==================== PLANNER-FIN DASHBOARD ==================== */
#dashStats { display: block; }
.dash-page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.dash-title { font-family: var(--font-sans), sans-serif; font-size: 1.7rem; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.dash-subtitle { font-size: 0.83rem; color: var(--text-secondary); }

.dash-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}
.dash-card {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}
.dash-card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0,0,0,0.06), 0 12px 28px rgba(0,0,0,0.08); }
.dash-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.dash-card-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-badge { font-size: 0.7rem; font-weight: 500; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.dash-card-label { font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.dash-card-value { font-size: 1.55rem; font-weight: 500; color: var(--text); letter-spacing: -0.5px; margin-bottom: 5px; font-family: var(--font-sans), sans-serif; }
.dash-card-sub { font-size: 0.75rem; color: var(--text-muted); }
.dash-meta-bar { margin-top: 10px; height: 5px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.dash-meta-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }

.dash-secondary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.dash-secondary-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: box-shadow var(--transition);
}
.dash-secondary-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.09); }
.dash-secondary-label { font-size: 0.68rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.dash-secondary-value { font-size: 1.15rem; font-weight: 500; color: var(--text); font-family: var(--font-sans), sans-serif; }
.dash-secondary-sub { font-size: 0.7rem; color: var(--text-muted); }


.dash-bottom-row {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}
.dash-chart-card, .dash-recent-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}
.dash-chart-card {
  display: flex;
  flex-direction: column;
}
.dash-chart-canvas-wrapper {
  flex: 1;
  position: relative;
  min-height: 0;
}
.dash-chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dash-chart-title { font-size: 0.95rem; font-weight: 600; color: var(--text); }
.dash-chart-legend { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: var(--text-secondary); }
.dash-legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dash-recent-header { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.dash-recent-list { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 260px; }
.dash-recent-item { display: flex; align-items: center; gap: 10px; }
.dash-recent-dot { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dash-recent-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-recent-name { font-size: 0.83rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-recent-date { font-size: 0.7rem; color: var(--text-muted); }
.dash-recent-value { font-size: 0.83rem; font-weight: 600; flex-shrink: 0; }

/* Main content background */
.main-content { background: var(--bg); }

/* Dashboard view buttons */
.dash-view-btn {
  padding: 7px 18px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.dash-view-btn:hover { border-color: #9FE870; color: #9FE870; }
.dash-view-btn-active { background: #9FE870 !important; border-color: #9FE870 !important; color: #fff !important; font-weight: 600; box-shadow: 0 2px 8px rgba(159, 232, 112,0.3); }

/* Alert banner - ajustado para tema claro */
.followup-alert-banner {
  background: rgba(229, 72, 77, 0.08) !important;
  border: 1px solid rgba(229, 72, 77, 0.25) !important;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}
.followup-alert-banner .alert-text { color: #be123c; }
.followup-alert-banner .alert-icon { display:flex; align-items:center; flex-shrink:0; }
.alert-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: inherit;
  opacity: 0.5;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: opacity 0.15s;
  flex-shrink: 0;
  margin-left: auto;
}
.alert-close-btn:hover { opacity: 1; }

@media (max-width: 1100px) {
  .dash-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-bottom-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dash-cards-grid { grid-template-columns: 1fr 1fr; }
  .dash-secondary-row { grid-template-columns: 1fr; }
}

/* ==================== DASHBOARD (legacy grid, usado nas secoes de analise) ==================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.06), 0 12px 28px rgba(0,0,0,0.08); }
.stat-card .label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.stat-card .value {
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: -0.5px;
}
.stat-card .sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-card.highlight {
  border-color: rgba(159, 232, 112, 0.4);
  background: var(--card);
}
.stat-card.gold-highlight {
  border-color: rgba(159, 232, 112, 0.4);
  background: var(--card);
}

/* ==================== VENDEDOR DASHBOARD ==================== */
.vendedor-panel {
  max-width: 900px;
  margin: 0 auto;
}
.vendedor-header {
  text-align: center;
  margin-bottom: 24px;
}
.vendedor-header h2 {
  font-family: var(--font-sans), sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #3B82F6;
  margin-bottom: 4px;
}
.vendedor-header .vendedor-period {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.vendedor-view-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.vendedor-view-btn {
  padding: 8px 20px;
  border: 1px solid #3B82F6;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #3B82F6;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.vendedor-view-btn.active {
  background: #3B82F6;
  color: white;
}
.vendedor-view-btn:hover:not(.active) {
  background: rgba(59,130,246,0.1);
}
.vendedor-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.vendedor-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.vendedor-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.vendedor-stat-card .vsc-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.vendedor-stat-card .vsc-value {
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.5px;
}
.vendedor-stat-card .vsc-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}
.vendedor-stat-card.blue-highlight {
  border-color: #3B82F6;
  background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, var(--card) 100%);
}
.vendedor-clients-section {
  margin-top: 24px;
}
.vendedor-clients-section h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 14px;
  color: var(--text);
}
.vendedor-client-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.vendedor-client-card:hover {
  background: var(--card-hover);
  border-color: #3B82F6;
  transform: translateX(3px);
}
.vendedor-client-card .vcc-info {
  flex: 1;
  min-width: 0;
}
.vendedor-client-card .vcc-empresa {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vendedor-client-card .vcc-details {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.vendedor-client-card .vcc-valor {
  font-weight: 500;
  font-size: 1rem;
  color: #3B82F6;
  white-space: nowrap;
}
.vendedor-client-card .vcc-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.vendedor-wa-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #25D366;
  color: white;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}
.vendedor-wa-btn:hover {
  transform: scale(1.1);
}
.vendedor-followup-badge {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.vendedor-followup-badge.overdue {
  background: rgba(229, 72, 77,0.15);
  color: #E5484D;
  animation: pulseOverdue 1.5s ease-in-out infinite;
}
@keyframes pulseOverdue {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.followup-alert-banner {
  background: rgba(229, 72, 77,0.12);
  border: 1px solid rgba(229, 72, 77,0.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: pulseOverdue 2s ease-in-out infinite;
}
.followup-alert-banner .alert-icon { font-size: 1.3rem; }
.followup-alert-banner .alert-text { color: #E5484D; font-weight: 600; font-size: 0.88rem; }
.vendedor-followup-badge.today {
  background: rgba(59,130,246,0.15);
  color: #3B82F6;
}
.vendedor-followup-badge.upcoming {
  background: rgba(95, 176, 48,0.15);
  color: #5FB030;
}
@media (max-width: 768px) {
  .vendedor-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== HISTORICO ==================== */
.historico-chart-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  overflow-x: auto;
}
.historico-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 320px;
  position: relative;
  padding-bottom: 40px;
  padding-left: 60px;
  min-width: 600px;
}
.historico-chart-grid {
  position: absolute;
  top: 0;
  left: 60px;
  right: 0;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.historico-chart-gridline {
  border-bottom: 1px solid rgba(46,46,58,0.5);
  position: relative;
  height: 0;
}
.historico-chart-gridline .grid-label {
  position: absolute;
  left: -60px;
  top: -8px;
  font-size: 0.65rem;
  color: var(--text-muted);
  width: 55px;
  text-align: right;
}
.historico-month-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
}
.historico-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  flex: 1;
  width: 100%;
  justify-content: center;
}
.historico-bar {
  width: 45%;
  max-width: 32px;
  border-radius: 4px 4px 0 0;
  position: relative;
  cursor: pointer;
  transition: opacity 0.2s;
  animation: barGrow 0.8s ease-out forwards;
  transform-origin: bottom;
}
.historico-bar:hover { opacity: 0.85; }
.historico-bar.bar-volume {
  background: linear-gradient(180deg, #e0b85a, #d4a853);
}
.historico-bar.bar-faturamento {
  background: linear-gradient(180deg, #5ce070, #4cd964);
}
.historico-bar-value {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.historico-bar-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 22px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--text);
  white-space: nowrap;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}
.historico-bar:hover .historico-bar-tooltip { display: block; }
.historico-month-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
  text-align: center;
}
@keyframes barGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
.historico-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 16px;
}
.historico-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.historico-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.historico-table-container {
  margin-bottom: 24px;
}
.historico-table-container table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.82rem;
}
.historico-table-container th {
  background: var(--surface);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--border);
}
.historico-table-container td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.historico-table-container tr:last-child td {
  border-bottom: none;
}
.historico-table-container tr.total-row {
  background: rgba(159, 232, 112,0.08);
  font-weight: 500;
}
.historico-comparison {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.historico-comparison .pct-up { color: #4cd964; font-weight: 500; }
.historico-comparison .pct-down { color: var(--danger); font-weight: 500; }

@media (max-width: 768px) {
  .historico-chart { height: 240px; min-width: 500px; }
  .historico-bar { max-width: 20px; }
  .historico-bar-value { font-size: 0.5rem; top: -14px; }
  .historico-table-container { overflow-x: auto; }
  .historico-table-container table { min-width: 700px; }
}

/* ==================== RELATÓRIOS (novo layout) ==================== */
/* Progress bar */
.progress-container { margin-bottom: 24px; }
.progress-bar-outer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.progress-header .label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.progress-header .pct {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text);
}
.progress-track {
  height: 12px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: var(--lime-500) !important;
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}
.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Status mini cards */
.status-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.status-mini-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  border-top: 2px solid var(--border);
}
.status-mini-card--clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.status-mini-card--clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  border-color: rgba(159, 232, 112,0.4);
}

/* Status Client Modal */
.scm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.scm-overlay.scm-open { opacity: 1; }
.scm-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  width: min(480px, 92vw); max-height: 70vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.15);
  transform: translateY(14px); transition: transform 0.2s;
}
.scm-overlay.scm-open .scm-panel { transform: translateY(0); }
.scm-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border);
}
.scm-title { font-size: 1rem; font-weight: 500; letter-spacing: -0.2px; }
.scm-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.scm-close {
  background: none; border: none; color: var(--text-muted); font-size: 1rem;
  cursor: pointer; padding: 2px 6px; border-radius: 6px;
  transition: background 0.15s; line-height: 1;
}
.scm-close:hover { background: var(--surface-2); color: var(--text); }
.scm-list { overflow-y: auto; padding: 10px 12px; }
.scm-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px; border-radius: 8px;
  cursor: pointer; transition: background 0.12s;
}
.scm-row:hover { background: var(--surface-2); }
.scm-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.scm-info { flex: 1; min-width: 0; }
.scm-name { font-size: 0.87rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-mini-card .count {
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--text);
}
.status-mini-card .status-name {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Remuneration card */
.remuneration-card {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
  margin-bottom: 24px;
  transition: all 0.3s ease;
}
.remuneration-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.remuneration-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.remuneration-row:last-child { border-bottom: none; }
.remuneration-row .r-label { color: var(--text-secondary); font-size: 0.9rem; }
.remuneration-row .r-value { font-weight: 600; font-size: 0.95rem; }
.remuneration-row.total { padding-top: 14px; }
.remuneration-row.total .r-label { color: var(--text); font-weight: 600; }
.remuneration-row.total .r-value { color: var(--text); font-size: 1.2rem; font-weight: 500; }
.remuneration-row.best .r-label { color: var(--status-pago); }
.remuneration-row.best .r-value { color: var(--status-pago); }

/* Period nav */
.period-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}
.period-nav .period-label {
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 200px;
  text-align: center;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.period-nav button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.period-nav button:hover { background: #9FE870; border-color: #9FE870; color: #fff; }

/* ==================== CLIENTS VIEW ==================== */
.clients-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.view-toggle {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-toggle button {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.view-toggle button.active { background: var(--gold); color: #062F28; }

/* Search/filter bar */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar input, .filter-bar select {
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition);
}
.filter-bar input:focus, .filter-bar select:focus { border-color: rgba(159, 232, 112, 0.5); box-shadow: 0 0 0 3px rgba(159, 232, 112, 0.1); }
.search-wrapper { position: relative; flex: 1; min-width: 200px; display: flex; align-items: center; }
.search-wrapper .search-icon { position: absolute; left: 13px; color: var(--text-muted); pointer-events: none; flex-shrink: 0; }
.search-wrapper input { width: 100%; padding-left: 36px; }
.filter-bar input { flex: 1; min-width: 200px; }
.filter-bar select {
  appearance: none;
  cursor: pointer;
  min-width: 140px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239a9aac' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* KANBAN VIEW */
.kanban-wrapper {
  position: relative;
}
.kanban-scroll-top {
  overflow-x: auto;
  overflow-y: hidden;
  height: 12px;
  margin-bottom: 4px;
}
.kanban-scroll-top-inner {
  height: 1px;
}
.kanban-container {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: 400px;
}
.kanban-column {
  flex: 0 0 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}
.kanban-column-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.kanban-column-header .col-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-column-header .col-title .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-column-header .col-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--card);
  padding: 2px 8px;
  border-radius: 10px;
}
.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kanban-card {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  touch-action: pan-y;
}
.kanban-card:hover { border-color: rgba(159, 232, 112, 0.4); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.kanban-card .kc-empresa {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  padding-right: 24px;
}
.kanban-card .kc-recorrente {
  display: inline-block;
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(95, 176, 48, 0.15);
  color: #5FB030;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
  vertical-align: middle;
}
.kanban-card .kc-segmento {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}
.kanban-card .kc-valor {
  font-weight: 500;
  color: var(--text);
  font-size: 1rem;
}
.kanban-card .kc-pacote {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.kanban-card .kc-origem {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
}
.kanban-card .kc-dates {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.kc-btn-contact {
  margin-top: 8px;
  width: 100%;
  padding: 7px 0;
  font-size: 0.75rem;
  font-weight: 600;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.2px;
}
.kc-btn-contact:hover { background: #1ebe5a; }
.kc-btn-aprovado {
  margin-top: 8px;
  width: 100%;
  padding: 7px 0;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.2px;
}
.kc-btn-aprovado:hover { opacity: 0.88; }
.kc-highlight-date {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(159, 232, 112,0.07);
  border-radius: 6px;
  border-left: 2px solid var(--accent);
}
.kc-highlight-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kc-highlight-value {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-ink);
}
.kc-payment-badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.kc-payment-paid { background: rgba(95, 176, 48,0.12); color: #5FB030; }
.kc-payment-pending { background: rgba(227, 155, 18,0.13); color: #E39B12; }

/* LIST VIEW */
.list-view { display: none; }
.list-view.active { display: block; }
.kanban-container.active { display: flex; }
.kanban-container { display: none; }

.list-table-container {
  overflow-x: auto;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
}
.list-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}
.list-table th {
  background: var(--surface);
  padding: 12px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.list-table td {
  padding: 12px 14px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.list-table tr { cursor: pointer; transition: background var(--transition); }
.list-table tbody tr:hover { background: var(--surface-2); }
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* FAB button */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  height: 48px;
  padding: 0 20px 0 16px;
  border-radius: 999px;
  background: var(--lime-500);
  border: none;
  color: #062F28;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(159, 232, 112,0.35);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  z-index: 50;
}
.fab:hover { background: var(--lime-600); transform: translateY(-2px); box-shadow: 0 6px 25px rgba(159, 232, 112,0.45); }

/* ==================== MODAL ==================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 47, 40, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 20px 60px rgba(0,0,0,0.12);
  margin-top: 40px;
  margin-bottom: 40px;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 500;
}
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--card);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--danger); color: white; }
.btn-delete-icon {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-delete-icon:hover { background: rgba(229, 72, 77,0.12); color: var(--danger); }
.modal-body {
  padding: 24px;
}
.modal-body .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-footer .btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  margin-right: auto;
}
.modal-footer .btn-danger:hover { background: var(--danger); color: white; }

/* ==================== RELATORIOS ==================== */
.rel-ev-year-btn {
  height: 32px; min-width: 58px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text-secondary); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.15s; padding: 0 14px;
}
.rel-ev-year-btn:hover:not(.active) { background: var(--card-hover); color: var(--text); border-color: var(--accent); }
.rel-ev-year-btn.active { background: var(--accent); color: #1a1000; border-color: var(--accent); }

#relDetailTable tbody tr.rel-row-current { background: rgba(159, 232, 112,0.08); }
#relDetailTable tbody tr.rel-row-current td { color: #92650a; font-weight: 600; }
#relDetailTable tfoot td { font-weight: 500; background: var(--surface); border-top: 2px solid var(--border); border-bottom: none; }
.rel-pct-ok   { color: #5FB030; font-weight: 500; }
.rel-pct-warn { color: #E39B12; font-weight: 500; }
.rel-pct-bad  { color: #E5484D; font-weight: 500; }

.rel-section-h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
}
.rel-section-h3 svg { color: var(--accent-ink); flex-shrink: 0; }

.rel-table-donut-wrap {
  display: flex;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}
@media (max-width: 960px) { .rel-table-donut-wrap { flex-direction: column; } }

.rel-table-card { flex: 1; min-width: 0; margin-bottom: 0 !important; }
.rel-donut-card {
  flex-shrink: 0;
  width: 280px;
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.rel-donut-canvas-wrap {
  position: relative;
  width: 200px;
  height: 200px;
}
.rel-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.rel-donut-pct {
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent-ink);
  font-family: var(--font-sans), sans-serif;
}
.rel-donut-pct-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rel-donut-legend { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.rel-donut-leg-row { display: flex; align-items: center; gap: 10px; }
.rel-donut-leg-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.rel-donut-leg-label { flex: 1; font-size: 13px; color: var(--text-secondary); }
.rel-donut-leg-val { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }

.rel-ranking-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .rel-ranking-grid { grid-template-columns: 1fr; } }

.rel-rank-card { margin-bottom: 0 !important; }
.rel-rank-card h3 { margin-bottom: 4px; }
.rel-rank-subtitle { font-size: 12px; color: var(--text-muted); margin: 0 0 16px; }
.rel-rank-list { display: flex; flex-direction: column; gap: 10px; }

.rel-rank-row { display: flex; flex-direction: column; gap: 5px; }
.rel-rank-meta { display: flex; align-items: center; gap: 8px; }
.rel-rank-pos {
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--surface); color: var(--text-secondary);
  font-size: 11px; font-weight: 500; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rel-rank-row:first-child .rel-rank-pos { background: var(--accent); color: #1a1000; }
.rel-rank-label { flex: 1; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-rank-cnt { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.rel-rank-val { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }

.rel-rank-bar-track { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.rel-rank-bar-fill  { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.4s ease; }

/* ==================== SETTINGS ==================== */
.settings-section {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
  margin-bottom: 20px;
  transition: all 0.3s ease;
}
.settings-section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.settings-section h3 svg { color: var(--accent-ink); flex-shrink: 0; }
.settings-section h3 { cursor: pointer; user-select: none; }
.cfg-chevron {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  flex-shrink: 0;
}
.settings-section.collapsed .cfg-chevron { transform: rotate(-90deg); }
.settings-section-body {
  overflow: hidden;
  max-height: 3000px;
  opacity: 1;
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), opacity 0.2s ease;
}
.settings-section.collapsed .settings-section-body {
  max-height: 0;
  opacity: 0;
}
.settings-section.collapsed h3 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom-color: transparent;
}
.cfg-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: -8px 0 18px;
}
.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
  line-height: 1.5;
}
.cfg-meta-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cfg-meta-form .form-group { margin: 0; flex: 1; min-width: 160px; }
.cfg-meta-btn { height: 44px; padding: 0 24px; white-space: nowrap; align-self: flex-end; }
.cfg-save-bar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0 32px;
}
.cfg-save-bar .btn { min-width: 220px; height: 48px; font-size: 0.92rem; }
.settings-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* ==================== WHATSAPP CONTACTS TABLE ==================== */
.wa-contacts-table td { vertical-align: middle; }
.wa-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent-ink);
  padding: 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.wa-action-btn:hover { background: var(--accent-glow); }
.wa-action-btn--danger { color: var(--danger); }
.wa-action-btn--danger:hover { background: rgba(229, 72, 77,0.1); }

/* ==================== PACOTES E VALORES ==================== */
#pacotesContainer { display: flex; flex-direction: column; gap: 6px; }
.pacote-row {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.18s;
}
.pacote-row:hover { border-color: rgba(159, 232, 112,0.4); }
.pacote-row-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  margin: 0 4px 0 14px;
}
.pacote-nome-input {
  flex: 2;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.88rem;
  padding: 11px 12px;
  min-width: 0;
}
.pacote-separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}
.pacote-valor-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 110px;
  max-width: 160px;
}
.pacote-valor-prefix {
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0 4px 0 12px;
  flex-shrink: 0;
  user-select: none;
}
.pacote-valor-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.88rem;
  padding: 11px 8px 11px 0;
  min-width: 0;
}
.pacote-valor-input::-webkit-inner-spin-button,
.pacote-valor-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pacote-row-del {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 14px;
  height: 42px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.pacote-row-del:hover { color: var(--danger); background: rgba(229, 72, 77,0.08); }
.pacote-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px dashed rgba(159, 232, 112,0.35);
  border-radius: 10px;
  color: var(--accent-ink);
  font-size: 0.83rem;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
  justify-content: center;
}
.pacote-add-btn:hover { background: rgba(159, 232, 112,0.07); border-color: rgba(159, 232, 112,0.6); }

/* ==================== REMUNERATION TOGGLE BLOCKS ==================== */
.rem-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  transition: all 0.3s ease;
}
.rem-block.disabled {
  opacity: 0.55;
}
.rem-block.disabled .rem-block-fields,
.rem-block.disabled .rem-block-desc {
  opacity: 0.4;
  pointer-events: none;
}
.rem-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.rem-block-header h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.rem-block-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}
.rem-block-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.rem-block-fields .form-group { margin-bottom: 0; }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--surface-3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(159, 232, 112, 0.3);
  border-color: var(--gold);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--gold);
}

/* ==================== ADMIN PANEL ==================== */
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.admin-create-btn {
  width: 100%;
  padding: 16px 32px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(227, 155, 18,0.25);
  transition: all var(--transition);
}
.admin-create-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(227, 155, 18,0.35);
}
.admin-color-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  vertical-align: middle;
}
.admin-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.admin-status-badge.ativo {
  background: rgba(95, 176, 48,0.15);
  color: #5FB030;
}
.admin-status-badge.inativo {
  background: rgba(229, 72, 77,0.15);
  color: #E5484D;
}

/* ==================== TOAST ==================== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 0.85rem;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.success { border-left: 3px solid var(--status-pago); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Google Calendar link */
.gcal-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(66,133,244,0.12);
  border: 1px solid rgba(66,133,244,0.3);
  border-radius: var(--radius-sm);
  color: #4285f4;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  margin-top: 12px;
  transition: all var(--transition);
}
.gcal-link:hover { background: rgba(66,133,244,0.22); }

/* ==================== GRAVACOES DA SEMANA ==================== */
.gravacoes-section {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
  margin-bottom: 24px;
  transition: all 0.3s ease;
}
.gravacoes-section .gravacoes-header {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-ink);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.gravacoes-dia {
  margin-bottom: 16px;
}
.gravacoes-dia:last-child { margin-bottom: 0; }
.gravacoes-dia .dia-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent-ink);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.gravacao-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(46,46,58,0.3);
}
.gravacao-item:last-child { border-bottom: none; }
.gravacao-item .gi-horario {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-light);
  min-width: 100px;
}
.gravacao-item .gi-empresa {
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.gravacao-item .gi-endereco {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gravacao-item .gi-waze {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(51,122,255,0.12);
  color: #33b5e5;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition);
}
.gravacao-item .gi-waze:hover { background: rgba(51,122,255,0.22); }

/* ==================== AGENDA / CALENDARIO ==================== */
.agenda-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.agenda-month-label {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  text-align: center;
  font-family: var(--font-sans), sans-serif;
  letter-spacing: 0.5px;
}
.agenda-nav-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 18px;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
}
.agenda-nav-btn:hover { background: var(--card); border-color: var(--gold); color: var(--accent-ink); }
.agenda-today-btn {
  background: var(--gold);
  color: #062F28;
  border: none;
  border-radius: 8px;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: opacity var(--transition);
}
.agenda-today-btn:hover { opacity: 0.85; }
.agenda-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.agenda-dow {
  background: var(--surface-2);
  text-align: center;
  padding: 10px 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.agenda-day {
  background: var(--card);
  min-height: 96px;
  padding: 8px;
  position: relative;
  transition: background var(--transition);
  vertical-align: top;
}
.agenda-day-other {
  background: var(--bg);
  opacity: 0.45;
}
.agenda-day-weekend {
  background: rgba(255,255,255,0.018);
}
.agenda-day-today {
  background: rgba(159, 232, 112,0.07);
  box-shadow: inset 0 0 0 1px rgba(159, 232, 112,0.3);
}
.agenda-day-num {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  line-height: 1;
}
.agenda-today-num {
  background: var(--gold);
  color: #062F28;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}
.agenda-event {
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: rgba(159, 232, 112,0.14);
  border-left: 2px solid var(--gold);
  border-radius: 3px;
  padding: 3px 5px;
  margin-bottom: 3px;
  cursor: pointer;
  font-size: 0.68rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: background var(--transition);
}
.agenda-event:hover { background: rgba(159, 232, 112,0.28); }
.agenda-event-mid {
  background: rgba(159, 232, 112,0.22);
  border-left-color: var(--gold);
  opacity: 0.85;
}
.agenda-event-last {
  background: rgba(159, 232, 112,0.14);
  border-left: none;
  border-right: 2px solid var(--gold);
  opacity: 0.85;
}
.agenda-event-time {
  color: var(--text);
  font-weight: 500;
  flex-shrink: 0;
  font-size: 0.66rem;
}
.agenda-event-name {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
@media (max-width: 768px) {
  .agenda-day { min-height: 60px; padding: 5px; }
  .agenda-day-num { font-size: 0.72rem; }
  .agenda-event { font-size: 0.6rem; padding: 2px 4px; }
  .agenda-event-time { display: none; }
  .agenda-month-label { font-size: 0.95rem; }
}
/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-tabs { display: none; }
  .main-content { padding: 16px; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card .value { font-size: 1.3rem; }
  .stat-card { padding: 14px; }
  .kanban-column { flex: 0 0 85vw; min-width: 240px; }
  .kanban-card { padding: 14px; }
  .kanban-card .card-empresa { font-size: 0.88rem; }
  .kanban-card div[style*="font-size:0.72rem"] { font-size: 0.78rem !important; }
  .modal { margin-top: 10px; max-height: 92vh; }
  .modal-body { }
  .modal-body .form-row { grid-template-columns: 1fr; }
  .user-badge span.user-name-text { display: none; }
  .clients-header { flex-direction: column; align-items: stretch; }
  .filter-bar { flex-direction: column; }
  .filter-bar input, .filter-bar select { min-width: auto; }
  .period-nav .period-label { font-size: 0.85rem; min-width: 160px; }
  .status-cards-row { grid-template-columns: repeat(3, 1fr); }
  .followup-alert-banner { padding: 10px 12px; }
  .followup-alert-banner .alert-text { font-size: 0.82rem; }
  .vendedor-followup-badge { font-size: 0.72rem !important; padding: 2px 6px; }
  .topnav-brand { font-size: 0.95rem; }
  .workspace-grid { grid-template-columns: 1fr; max-width: 100%; }
  .workspace-screen { padding: 32px 16px 24px; }
  .workspace-screen .ws-header h1 { font-size: 1.6rem; }
  .workspace-card { padding: 22px 20px 22px 24px; }
  .parcela-row { grid-template-columns: 1fr 1fr; }
  .parcela-row input[type="number"] { grid-column: 1; }
  .parcela-row input[type="date"] { grid-column: 2; }
  .parcela-row select { grid-column: 1; }
  .parcela-row .parcela-remove { grid-column: 2; justify-self: end; }
}
@media (max-width: 420px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .status-cards-row { grid-template-columns: repeat(2, 1fr); }
  .login-box { padding: 32px 24px; }
}

/* ==================== PARCELAS FORM ==================== */
.parcelas-section {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--bg);
}

/* ── Cobranças Asaas ── */
.asaas-section {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
}
.asaas-section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.asaas-section-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent-ink);
}
.asaas-total-label { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }
.asaas-completa-card {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px;
  background: rgba(95, 176, 48, 0.06);
  border-bottom: 1px solid rgba(95, 176, 48, 0.2);
}
.asaas-completa-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.asaas-completa-actions { display: flex; gap: 8px; }
.asaas-table-wrap { overflow-x: auto; }
.asaas-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.asaas-table th {
  text-align: left; padding: 8px 12px;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.asaas-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.asaas-table tr:last-child td { border-bottom: none; }
.asaas-status-ok { color: #5FB030; font-size: 0.78rem; font-weight: 600; }
.asaas-status-pending { color: var(--text-muted); font-size: 0.78rem; }
.asaas-footer {
  display: flex; gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.asaas-footer .btn { flex: 1; }
.parcelas-section .parcelas-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.parcela-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.parcela-row input, .parcela-row select {
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  transition: border-color var(--transition);
}
.parcela-row input:focus, .parcela-row select:focus {
  border-color: rgba(159, 232, 112, 0.5);
  box-shadow: 0 0 0 3px rgba(159, 232, 112, 0.1);
}
.parcela-row select {
  appearance: none;
  cursor: pointer;
  padding-right: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%239a9aac' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.parcela-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(229, 72, 77,0.15);
  color: var(--danger);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.parcela-remove:hover { background: var(--danger); color: white; }
.btn-add-parcela {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
}
.btn-add-parcela:hover { border-color: var(--gold); color: var(--accent-ink); }
.parcela-status-pago {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--status-pago);
}
.parcela-status-pendente {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--danger);
}

/* ==================== COBRANCAS DASHBOARD ==================== */
/* ==================== COBRANÇAS TABLE ==================== */
.cobrancas-section { /* keep for backwards compat */ }
.cob-summary-row {
  display: flex; gap: 16px; margin-bottom: 16px;
}
@media (max-width: 600px) { .cob-summary-row { flex-direction: column; } }
.cob-summary-card {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 22px;
}
.cob-summary-card--danger { border-left: 3px solid #E5484D; }
.cob-summary-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
}
.cob-summary-card--danger .cob-summary-label { color: #E5484D; }
.cob-summary-value {
  font-size: 26px; font-weight: 600; color: var(--text);
  font-family: var(--font-sans), sans-serif; line-height: 1;
}
.cob-summary-card--danger .cob-summary-value { color: #E5484D; }
.cob-summary-sub {
  font-size: 12px; color: var(--text-secondary); margin-top: 6px;
}
.cob-col-total { display: flex; align-items: center; gap: 6px; }
.cob-atraso-wrap { display: inline-flex; align-items: center; cursor: default; }
.cob-atraso-icon {
  color: #E39B12; flex-shrink: 0;
  filter: drop-shadow(0 0 3px rgba(227, 155, 18,0.4));
}
.cob-toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.cob-export-btn {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 14px; color: var(--text-secondary); font-family: inherit;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.cob-export-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.cob-search-wrap {
  position: relative; display: flex; align-items: center; flex: 1; min-width: 180px;
}
.cob-search-wrap svg { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; }
.cob-input {
  width: 100%; padding: 9px 12px 9px 36px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: inherit; font-size: 0.85rem; outline: none;
  transition: border-color var(--transition);
}
.cob-input:focus { border-color: rgba(159, 232, 112,0.5); }
.cob-filter-group {
  display: flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; color: var(--text-muted); flex-shrink: 0;
}
.cob-filter-label { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.cob-date-input {
  background: transparent; border: none; color: var(--text);
  font-family: inherit; font-size: 0.82rem; outline: none; cursor: pointer;
}
.cob-date-sep { color: var(--text-muted); font-size: 0.8rem; }
.cob-select {
  background: transparent; border: none; color: var(--text);
  font-family: inherit; font-size: 0.82rem; outline: none; cursor: pointer;
}
.cob-table-wrap {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}

/* Grid: expand | cliente | status | parcelas | próximo venc | total | ações */
.cob-thead, .cob-row {
  display: grid;
  grid-template-columns: 36px 2fr 1.5fr 0.7fr 1.6fr 1.4fr 52px;
  align-items: center; padding: 0 20px;
}
.cob-thead {
  padding-top: 11px; padding-bottom: 11px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.cob-th {
  font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
.cob-th.cob-sortable {
  cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 4px;
  transition: color 0.15s;
}
.cob-th.cob-sortable:hover { color: var(--text); }
.cob-sort-icon { display: inline-flex; flex-shrink: 0; }
.cob-row-group { border-bottom: 1px solid var(--border); }
.cob-row-group:last-child { border-bottom: none; }
.cob-row { padding-top: 14px; padding-bottom: 14px; cursor: pointer; transition: background 0.12s; }
.cob-row:hover { background: var(--surface-2); }

.cob-col-expand { display: flex; align-items: center; justify-content: center; }
.cob-chevron { transition: transform 0.2s; color: var(--text-muted); flex-shrink: 0; }
.cob-chevron.open { transform: rotate(-90deg); }

.cob-col-cliente { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cob-cliente-info { min-width: 0; }
.cob-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.73rem; font-weight: 500; letter-spacing: 0.5px;
}
.cob-empresa {
  font-size: 0.875rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cob-sub { font-size: 0.73rem; color: var(--text-muted); margin-top: 2px; }

.cob-col-status { display: flex; align-items: center; }
.cob-status-badge {
  display: inline-flex; align-items: center; padding: 4px 11px;
  border-radius: 999px; font-size: 0.73rem; font-weight: 600; white-space: nowrap;
}
.cob-pago     { background: rgba(95, 176, 48,0.15); color: #5FB030; }
.cob-aguardando { background: rgba(227, 155, 18,0.15); color: #E39B12; }

.cob-row .cob-col-parcelas, .cob-row .cob-col-venc {
  font-size: 0.85rem; color: var(--text-secondary);
}
.cob-row .cob-col-total { font-size: 0.875rem; font-weight: 500; }

.cob-col-acoes { display: flex; justify-content: center; }
.cob-action-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 7px; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; transition: all 0.15s;
}
.cob-action-btn:hover { background: var(--surface-2); color: var(--text); }

/* Detail area — indented to align with company name */
.cob-detail {
  background: var(--card); border-top: 1px solid var(--border);
  padding: 12px 20px 16px 82px;
}
.cob-parcelas-table {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.cob-parcelas-header, .cob-parcela-row {
  display: grid;
  grid-template-columns: 1.2fr 1.1fr 52px 1.2fr 1.2fr;
  align-items: center; padding: 0 14px;
}
.cob-parcelas-header {
  padding-top: 9px; padding-bottom: 9px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  font-size: 0.71rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0.3px; text-transform: uppercase;
}
.cob-parcela-row {
  padding-top: 11px; padding-bottom: 11px;
  font-size: 0.83rem; color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.cob-parcela-row:last-child { border-bottom: none; }
.cob-cell-pago { display: flex; align-items: center; }
.cob-check { width: 16px; height: 16px; cursor: pointer; accent-color: #5FB030; }
.cob-cell-pagopor { font-size: 0.82rem; color: var(--text-muted); }

.cob-empty-state {
  text-align: center; padding: 48px 24px; color: var(--text-muted); font-size: 0.88rem;
}
.btn-pago {
  padding: 5px 12px; background: var(--status-pago); color: white; border: none;
  border-radius: 14px; font-family: inherit; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition); white-space: nowrap; flex-shrink: 0;
}
.btn-pago:hover { background: #5FB030; }

/* hidden util */
.hidden { display: none !important; }
.page { display: none; }
.page.active { display: block; }
@media print {
  body > *:not(#propostaOverlay) { display: none !important; }
  #propostaOverlay { position: static !important; height: auto !important; overflow: visible !important; background: #062F28 !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  #propostaOverlay .no-print { display: none !important; }
  #propostaContent { min-height: auto !important; background: #062F28 !important; }
}

/* ==================== DASHBOARD FILTER BUTTON ==================== */
.dash-filter-area { position: relative; flex-shrink: 0; }
.dash-filter-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--card); border: 1px solid rgba(0,0,0,0.08); border-radius: 20px;
  font-size: 0.8rem; font-weight: 500; color: var(--text); font-family: inherit;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.15s;
}
.dash-filter-btn:hover { background: var(--surface-2); border-color: rgba(159, 232, 112,0.4); }
.dash-filter-chevron { opacity: 0.5; transition: transform 0.2s; }
.dash-period-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--card); border: 1px solid rgba(0,0,0,0.07); border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 16px 40px rgba(0,0,0,0.1); padding: 16px;
  min-width: 300px; z-index: 200;
}
.dash-period-dropdown.open { display: block; }
.dash-period-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.dash-period-arrow {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: none; border-radius: 8px;
  cursor: pointer; font-size: 1rem; color: var(--text);
}
.dash-period-arrow:hover { background: var(--surface-3); }
.dash-period-nav-label { font-size: 0.8rem; font-weight: 500; color: var(--text); }
.dash-view-selector { display: flex; gap: 6px; margin-bottom: 14px; }
.dash-view-selector .dash-view-btn { flex: 1; padding: 6px 0; text-align: center; font-size: 0.8rem; }
.dash-custom-range { border-top: 1px solid var(--border); padding-top: 12px; }
.dash-custom-label {
  display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px;
}
.dash-custom-inputs { display: flex; flex-direction: column; gap: 8px; }
.dash-custom-dates {
  display: flex; align-items: center; gap: 6px;
}
.dash-custom-dates input[type="date"] {
  flex: 1;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 6px 8px; font-size: 0.75rem; font-family: inherit;
}
.dash-custom-dates span { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.dash-custom-actions { display: flex; gap: 6px; }
.dash-custom-apply {
  flex: 1; padding: 7px 0; font-size: 0.78rem; font-family: inherit; font-weight: 600;
  background: var(--gold); border: none; border-radius: 8px;
  color: #000; cursor: pointer;
}
.dash-custom-apply:hover { opacity: 0.88; }
.dash-custom-clear {
  padding: 7px 14px; font-size: 0.78rem; font-family: inherit;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-secondary); cursor: pointer;
}
.dash-custom-clear:hover { background: var(--surface-3); }

/* ==================== ASSESSORIA PAGE ==================== */
.ass-export-btn {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
  background: #1e293b; border: 1px solid rgba(159, 232, 112,0.2); border-radius: 10px;
  padding: 9px 18px; color: #e8e8ee; font-family: inherit;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.ass-export-btn:hover { background: #263548; border-color: rgba(159, 232, 112,0.5); }
.ass-status-select {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 20px;
  background: var(--card); color: var(--text); font-family: inherit;
  font-size: 0.8rem; font-weight: 500; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04); min-width: 150px;
}
.ass-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px;
}
.ass-stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px;
}
.ass-stat-label { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 6px; }
.ass-stat-value { font-size: 1.3rem; font-weight: 500; color: var(--text); }
.ass-content-grid {
  display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: stretch;
}
.ass-col {
  display: flex; flex-direction: column;
}
#assessoriaRanking, #assessoriaRemuneration {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px;
  flex: 1;
}
#assessoriaOrigem {
  margin-bottom: 20px;
}
#assessoriaOrigem .ass-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px;
}
.ass-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.05rem; font-weight: 500; letter-spacing: -0.2px;
  color: var(--text); margin-bottom: 0; white-space: nowrap;
}
.ass-card-title { margin-bottom: 0; }
.ass-card-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.ass-table-wrap { overflow-x: auto; }
.ass-table-footnote {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; font-size: 0.78rem; color: var(--text-muted);
}
.ass-table { width: 100%; border-collapse: collapse; }
.ass-table th {
  font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.4px; padding: 0 12px 10px;
  text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.ass-table th:first-child { text-align: left; }
.ass-table td {
  padding: 14px 12px; font-size: 0.875rem; color: var(--text);
  border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap;
}
.ass-table td:first-child { text-align: left; }
.ass-table tbody tr:last-child td { border-bottom: none; }
.ass-total-row td {
  font-weight: 500; border-top: 2px solid var(--border);
  border-bottom: none !important; padding-top: 14px;
}
.ass-resp-cell { display: flex; align-items: center; gap: 10px; }
.ass-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 500; color: #fff;
}
.ass-rem-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 0;
}
.ass-rem-col-label {
  font-size: 0.72rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.ass-rem-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--border); gap: 12px;
}
.ass-rem-label { font-size: 0.875rem; color: var(--text); line-height: 1.4; }
.ass-rem-sublabel { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; line-height: 1.3; }
.ass-rem-value {
  font-size: 0.875rem; font-weight: 600; color: var(--text); flex-shrink: 0; white-space: nowrap;
}
.ass-rem-value.negative { color: #E5484D; }
.ass-rem-subtotal-row {
  display: flex; justify-content: space-between; padding: 14px 0 0;
  font-size: 0.9rem; font-weight: 500; color: var(--text);
}
.ass-rem-total-box {
  background: rgba(95, 176, 48,0.08); border: 1px solid rgba(95, 176, 48,0.25);
  border-radius: 10px; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center; margin-top: 14px;
}
.ass-rem-total-label {
  font-size: 0.82rem; font-weight: 500; color: #5FB030;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.ass-rem-total-value { font-size: 1.2rem; font-weight: 500; color: #5FB030; }
@media (max-width: 1100px) {
  .ass-content-grid { grid-template-columns: 1fr; }
  .ass-stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .ass-stats-row { grid-template-columns: 1fr 1fr; }
}

/* ==================== HISTORICO DE CLIENTE ==================== */
.hist-search-section { margin-bottom: 20px; }
.hist-search-row { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.hist-search-input-wrap { flex: 1 1 0; min-width: 0; position: relative; }
.hist-suggest-box {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 400;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.hist-suggest-box.open { display: block; }
.hist-suggest-item {
  padding: 9px 14px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-suggest-item:hover,
.hist-suggest-item.active { background: var(--surface-2); }
.hist-suggest-item.active { color: var(--accent-ink); }
@media (max-width: 600px) { .hist-search-cpf-wrap { flex: 1 1 0; } }
.hist-search-input-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.hist-search-input-wrap input { display: block; width: 100%; padding: 9px 12px 9px 36px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; font-size: 0.88rem; outline: none; box-sizing: border-box; }
.hist-search-input-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(159, 232, 112,0.1); }
.hist-search-row .btn { flex-shrink: 0; width: auto; padding-left: 20px; padding-right: 20px; }
.hist-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hist-filter-label { font-size: 0.8rem; color: var(--text-muted); }
.hist-filter-sep { font-size: 0.8rem; color: var(--text-muted); }
.hist-filter-row input[type="date"] { padding: 6px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-family: inherit; font-size: 0.82rem; outline: none; }
.hist-filter-row input[type="date"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(159, 232, 112,0.1); }
.hist-clear-btn { padding: 5px 12px; background: transparent; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); font-family: inherit; font-size: 0.78rem; cursor: pointer; transition: background 0.15s; }
.hist-clear-btn:hover { background: var(--bg); color: var(--text); }

.hist-empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 0.88rem; display: flex; flex-direction: column; align-items: center; }

/* ---- Hist Group Card ---- */
.hist-group {
  margin-bottom: 32px;
  display: flex; flex-direction: column; gap: 12px;
}

/* ---- Section Card ---- */
.hist-section-card {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.05);
}
/* ---- Client Profile Header ---- */
.hist-client-header {
  padding: 20px 24px;
  display: flex; align-items: flex-start; gap: 16px;
}
.hist-client-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: var(--lime-500);
  color: #062F28; font-family: var(--font-sans), sans-serif; font-weight: 500; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
}
.hist-client-info { flex: 1; min-width: 0; }
.hist-client-name { font-size: 1rem; font-weight: 500; color: var(--text); margin-bottom: 14px; }
.hist-client-fields {
  display: grid; grid-template-columns: repeat(3, auto); gap: 12px 32px;
}
.hist-field-item { display: flex; flex-direction: column; gap: 2px; }
.hist-field-lbl { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.hist-field-val { font-size: 0.85rem; color: var(--text); display: flex; align-items: center; gap: 6px; }
.hist-resp-avatar {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--lime-500);
  color: #062F28; font-size: 0.6rem; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center;
}
.hist-status-cli {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
}
.hist-edit-text-btn {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-secondary); font-size: 0.8rem; font-weight: 500;
  font-family: inherit; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.hist-edit-text-btn:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent-ink); }
/* legado */
.hist-edit-icon-btn { display: none; }

/* ---- Edit Drawer ---- */
.hist-drawer-backdrop { display: none; }

.hist-edit-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 200;
  width: 420px; max-width: 100vw;
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -12px 0 40px rgba(0,0,0,0.1);
}
.hist-edit-drawer.open { transform: translateX(0); }

.hist-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.hist-drawer-title {
  font-family: var(--font-sans), sans-serif; font-size: 1.1rem; font-weight: 500;
  color: var(--text); margin: 0;
}
.hist-drawer-close {
  width: 36px; height: 36px; border-radius: 8px; border: none;
  background: transparent; color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.hist-drawer-close:hover { background: var(--surface-2); color: var(--text); }

.hist-drawer-body {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.hist-drawer-body .form-group { margin-bottom: 16px; }
.hist-drawer-body .form-group:last-child { margin-bottom: 0; }


.hist-drawer-body textarea {
  resize: vertical; min-height: 96px;
}
.hist-obs-counter {
  display: block; text-align: right; font-size: 0.75rem;
  color: var(--text-muted); margin-top: 4px;
}

.hist-drawer-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 16px 24px; border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--surface);
}

@media (max-width: 480px) {
  .hist-edit-drawer { width: 100vw; }
}

@media (max-width: 700px) {
  .hist-client-fields { grid-template-columns: repeat(2, auto); }
}

/* ---- Stats Grid ---- */
.hist-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.hist-stat-inline {
  display: flex; align-items: center; gap: 16px;
}
.hist-stat-inline .dash-card-value { font-size: 1.3rem; }

/* ---- Hist Table ---- */
.hist-table-wrap { overflow-x: auto; }
.hist-table {
  width: 100%; border-collapse: collapse; min-width: 680px;
}
.hist-table thead tr { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.hist-table th {
  padding: 10px 14px; text-align: left;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-secondary); white-space: nowrap;
}
.hist-table-row {
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background 0.12s;
}
.hist-table-row:last-child { border-bottom: none; }
.hist-table-row:hover { background: var(--surface-2); }
.hist-table td { padding: 11px 14px; font-size: 0.83rem; color: var(--text); vertical-align: middle; }
.hist-col-data   { white-space: nowrap; color: var(--text-secondary); font-size: 0.8rem; }
.hist-col-valor  { font-weight: 600; white-space: nowrap; }
.hist-col-obs    { color: var(--text-secondary); font-size: 0.8rem; max-width: 240px; }
.hist-col-resp   { white-space: nowrap; }
.hist-resp-cell  { display: inline-flex; align-items: center; gap: 7px; }
.hist-table-foot { border-top: 1px solid var(--border); padding: 12px 16px; }
.hist-table-foot-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.hist-foot-info { font-size: 0.78rem; color: var(--text-muted); }
.hist-pagination { display: flex; gap: 4px; align-items: center; }
.hist-page-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: transparent; color: var(--text-secondary);
  font-size: 0.82rem; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.hist-page-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--accent); color: var(--accent-ink); }
.hist-page-btn.active { background: var(--accent); border-color: var(--accent); color: #062F28; font-weight: 500; }
.hist-page-btn:disabled { opacity: 0.3; cursor: default; }
.hist-page-nav { font-size: 1rem; }

.hist-parc-mini  {
  display: inline-block; margin-left: 6px; font-size: 0.68rem;
  font-weight: 600; color: var(--text-muted); vertical-align: middle;
}

/* legado — mantido para não quebrar outros usos */
.hist-timeline { padding: 20px 20px 4px; }
.hist-entry { display: flex; gap: 14px; margin-bottom: 16px; cursor: pointer; }
.hist-entry:hover .hist-entry-card { border-color: var(--accent); }
.hist-entry-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 13px; flex-shrink: 0; }
.hist-entry-card { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: border-color 0.15s; }
.hist-entry-top { display: flex; justify-content: space-between; align-items: center; padding: 9px 13px 8px; border-bottom: 1px solid var(--border); }
.hist-entry-status { font-size: 0.7rem; font-weight: 500; padding: 2px 9px; border-radius: 20px; border: 1px solid; letter-spacing: 0.3px; }
.hist-entry-date { font-size: 0.73rem; color: var(--text-muted); }
.hist-entry-body { padding: 10px 13px; }
.hist-entry-pacote { font-size: 0.76rem; color: var(--text-secondary); margin-bottom: 2px; }
.hist-entry-valor { font-size: 0.95rem; font-weight: 500; color: var(--text); margin-bottom: 7px; }
.hist-entry-field { display: flex; gap: 8px; align-items: center; font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 3px; }
.hist-field-label { color: var(--text-muted); min-width: 64px; }
.hist-entry-recusa { font-size: 0.73rem; color: var(--status-recusa); margin-top: 6px; font-style: italic; }
.hist-entry-footer { padding: 7px 13px; font-size: 0.7rem; color: var(--text-muted); border-top: 1px solid var(--border); text-align: right; transition: color 0.15s; }
.hist-entry:hover .hist-entry-footer { color: var(--accent-ink); }

.hist-entry-parcelas { margin-top: 9px; background: var(--card); border: 1px solid var(--border); border-radius: 7px; overflow: hidden; font-size: 0.74rem; }
.hist-parc-header { display: flex; justify-content: space-between; padding: 6px 10px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text-secondary); }
.hist-parc-row { display: flex; gap: 6px; padding: 5px 10px; border-bottom: 1px solid var(--border); }
.hist-parc-row:last-child { border-bottom: none; }
.hist-parc-row span { flex: 1; color: var(--text-secondary); }
.hist-parc-status { font-weight: 600; flex: 0 0 auto !important; }
.hist-parc-pago .hist-parc-status { color: var(--status-pago); }
.hist-parc-pend .hist-parc-status { color: var(--status-followup); }

@media (max-width: 600px) {
  .hist-client-header { padding: 16px; gap: 12px; }
  .hist-client-avatar { width: 40px; height: 40px; font-size: 1rem; }
  .hist-stat-card { padding: 10px 14px; }
  .hist-stat-value { font-size: 0.95rem; }
  .hist-search-row { flex-direction: column; align-items: stretch; }
}

/* ==================== CONVERSAS ==================== */
.conv-root { height: calc(100vh - 60px); display: flex; flex-direction: column; overflow: hidden; gap: 0; }
.conv-layout { display: flex; flex: 1; min-height: 0; gap: 0; background: var(--card); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }

/* Top bar */
.conv-top-bar { display:flex; align-items:center; gap:12px; padding:14px 18px 12px; background:var(--card); border:1px solid var(--border); border-bottom:none; border-radius:var(--radius) var(--radius) 0 0; flex-wrap:wrap; flex-shrink:0; }
.conv-top-left { flex:1; min-width:0; }
.conv-title { font-size:1.1rem; font-weight:600; color:var(--text); margin:0 0 2px; }
.conv-subtitle { font-size:0.75rem; color:var(--text-muted); margin:0; }
.conv-top-filters { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.conv-filter-select-wrap { position:relative; }
.conv-filter-select { appearance:none; background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:7px 28px 7px 12px; font-size:0.78rem; color:var(--text); cursor:pointer; outline:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 8px center; transition:border-color 0.15s; }
.conv-filter-select:focus { border-color:var(--accent); }
.conv-filter-select option { background:var(--card); }
.conv-clear-filters-btn { display:flex; align-items:center; gap:5px; background:none; border:1px solid var(--border); border-radius:8px; padding:7px 12px; font-size:0.78rem; color:var(--text-muted); cursor:pointer; transition:all 0.15s; white-space:nowrap; }
.conv-clear-filters-btn:hover { border-color:var(--danger,#E5484D); color:var(--danger,#E5484D); }
.conv-new-btn { display:flex; align-items:center; gap:6px; background:var(--accent); color:#062F28; border:none; border-radius:10px; padding:8px 16px; font-size:0.82rem; font-weight:500; cursor:pointer; white-space:nowrap; transition:opacity 0.15s; flex-shrink:0; }
.conv-new-btn:hover { opacity:0.85; }

/* Sidebar de contatos */
.conv-sidebar { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface); }
.conv-search-wrap { position: relative; padding: 12px; border-bottom: 1px solid var(--border); }
.conv-search-icon { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.conv-search-input { width: 100%; background: var(--surface-2, var(--bg)); border: 1px solid var(--border); border-radius: 20px; padding: 8px 14px 8px 34px; font-size: 0.82rem; color: var(--text); outline: none; transition: border-color 0.15s; }
.conv-search-input:focus { border-color: var(--accent); }
.conv-contact-list { flex: 1; overflow-y: auto; }
.conv-contact-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.12s; }
.conv-contact-item:hover { background: var(--bg); }
.conv-contact-item.active { background: var(--accent)12; border-left: 3px solid var(--accent); }
.conv-contact-item.unread { background: var(--bg); border-left: 3px solid #25D366; }
.conv-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent)22; color: var(--accent-ink); font-weight: 500; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.conv-contact-info { min-width: 0; }
.conv-contact-name { font-size: 0.86rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-contact-phone { font-size: 0.75rem; color: var(--text-muted); }
.conv-list-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.82rem; }

/* Painel de chat */
.conv-chat-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.conv-empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; }
.conv-chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--card); border-bottom: 1px solid var(--border); }
.conv-chat-name { font-size: 0.92rem; font-weight: 500; color: var(--text); }
.conv-chat-phone { font-size: 0.75rem; color: var(--text-muted); }
.conv-messages { flex: 1; overflow-y: auto; padding: 18px 18px 24px; display: flex; flex-direction: column; gap: 6px; }
.conv-msgs-loading, .conv-msgs-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.84rem; text-align: center; }
.conv-msg-wrap { display: flex; }
.conv-msg-in { justify-content: flex-start; }
.conv-msg-out { justify-content: flex-end; }
.conv-bubble { max-width: 68%; padding: 8px 12px; border-radius: 14px; font-size: 0.86rem; line-height: 1.45; word-break: break-word; }
.conv-msg-in .conv-bubble { background: var(--card); color: var(--text); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.conv-msg-out .conv-bubble { background: var(--accent); color: #062F28; border-bottom-right-radius: 4px; }
.conv-bubble-text { white-space: pre-wrap; }
.conv-bubble-time { font-size: 0.68rem; text-align: right; margin-top: 3px; opacity: 0.65; }
.conv-bubble-img { max-width:220px; max-height:220px; border-radius:8px; display:block; object-fit:cover; cursor:pointer; }
.conv-contact-client-name { font-size:0.72rem; color: var(--accent-ink); font-weight:600; margin-top:1px; }
.conv-chat-client-name { font-size:0.75rem; color: var(--accent-ink); font-weight:600; margin-top:1px; }
.conv-bubble-file { display:flex; align-items:center; gap:8px; font-size:0.82rem; padding:2px 0; }
/* ── Custom audio player ───────────────────────────── */
.conv-audio-player { display:flex; align-items:center; gap:8px; width:240px; padding:8px 10px; background:rgba(0,0,0,0.15); border-radius:20px; }
.conv-msg-out .conv-audio-player { background:rgba(0,0,0,0.18); }
.conv-audio-play-btn { flex-shrink:0; width:34px; height:34px; border-radius:50%; background:var(--accent); border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; color:#000; transition:opacity 0.15s; }
.conv-audio-play-btn:hover { opacity:0.85; }
.conv-audio-play-btn svg { display:block; }
.conv-audio-progress-wrap { flex:1; height:20px; display:flex; align-items:center; cursor:pointer; }
.conv-audio-bar { width:100%; height:3px; background:rgba(255,255,255,0.25); border-radius:3px; overflow:hidden; }
.conv-audio-fill { height:100%; background:var(--accent); border-radius:3px; transition:width 0.1s linear; }
.conv-audio-time { flex-shrink:0; font-size:0.72rem; color:var(--text-secondary); min-width:28px; text-align:right; }
.conv-audio-speed { flex-shrink:0; font-size:0.68rem; font-weight:500; color: var(--accent-ink); background:none; border:1px solid var(--accent); border-radius:6px; padding:1px 5px; cursor:pointer; line-height:1.4; white-space:nowrap; }
.conv-bubble-sticker { max-width:140px; max-height:140px; border-radius:4px; display:block; }
@keyframes conv-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.conv-input-bar { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px; background: var(--card); border-top: 1px solid var(--border); }
.conv-msg-input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 9px 14px; font-size: 0.86rem; color: var(--text); resize: none; outline: none; font-family: inherit; line-height: 1.4; max-height: 120px; overflow-y: auto; transition: border-color 0.15s; }
.conv-msg-input:focus { border-color: var(--accent); }
.conv-send-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #062F28; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: opacity 0.15s; }
.conv-send-btn:hover { opacity: 0.85; }
.conv-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.conv-spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
  .conv-sidebar { width: 240px; }
}
@media (max-width: 500px) {
  .conv-layout { flex-direction: column; }
  .conv-sidebar { width: 100%; height: 220px; border-right: none; border-bottom: 1px solid var(--border); }
}
.conv-edit-name-btn { background:none; border:none; cursor:pointer; color:var(--text-muted); padding:2px 4px; border-radius:4px; display:flex; align-items:center; transition:color 0.15s; }
.conv-edit-name-btn:hover { color: var(--accent-ink); }

/* Filter tabs */
.conv-filter-tabs { display:flex; border-bottom:1px solid var(--border); background:var(--surface); }
.conv-filter-tab { flex:1; background:none; border:none; border-bottom:2px solid transparent; padding:9px 4px; font-size:0.75rem; font-weight:500; color:var(--text-muted); cursor:pointer; transition:all 0.15s; white-space:nowrap; }
.conv-filter-tab.active { color: var(--accent-ink); border-bottom-color:var(--accent); }
.conv-filter-tab:hover { color:var(--text); }
.conv-filter-count { display:inline-flex; align-items:center; justify-content:center; background:var(--accent); color:#062F28; border-radius:10px; font-size:0.65rem; font-weight:500; padding:1px 5px; margin-left:3px; line-height:1.4; }

/* Menu ⋮ */
.conv-more-wrap { position:relative; }
.conv-more-menu { position:absolute; top:calc(100% + 6px); right:0; background:var(--card); border:1px solid var(--border); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,0.15); overflow:hidden; z-index:200; min-width:160px; }
.conv-more-menu button { display:block; width:100%; padding:10px 16px; background:none; border:none; text-align:left; font-size:0.83rem; color:var(--text); cursor:pointer; transition:background 0.12s; }
.conv-more-menu button:hover { background:var(--bg); }

/* Redesign card de contato */
.conv-avatar { width:42px; height:42px; border-radius:50%; background:var(--accent)22; color: var(--accent-ink); display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; }
.conv-avatar img { width:100%; height:100%; object-fit:cover; display:block; border-radius:50%; }
.conv-avatar-img { width:42px; height:42px; border-radius:50%; object-fit:cover; flex-shrink:0; display:block; }
.conv-avatar-photo { width:42px; height:42px; border-radius:50%; object-fit:cover; display:block; }
.conv-avatar-initial { width:100%; height:100%; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:500; font-size:1.05rem; color:#fff; }
.conv-contact-body { flex:1; min-width:0; }
.conv-contact-row1 { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-bottom:2px; }
.conv-contact-name { font-size:0.86rem; font-weight:500; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.conv-contact-time { font-size:0.7rem; color:var(--text-muted); flex-shrink:0; }
.conv-contact-lastmsg { font-size:0.75rem; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-bottom:5px; min-height:14px; }
.conv-contact-tags { display:flex; gap:5px; flex-wrap:wrap; align-items:center; }
.conv-tag { display:inline-flex; align-items:center; padding:2px 7px; border-radius:20px; font-size:0.67rem; font-weight:600; border:1px solid transparent; line-height:1.5; }
.conv-tag-ws { background:var(--accent)18; color: var(--accent-ink); border-color:var(--accent)33; }
.conv-tag-status { cursor:pointer; user-select:none; transition:opacity 0.15s; }
.conv-tag-status:hover { opacity:0.8; }
.conv-unread-badge { min-width:20px; height:20px; border-radius:10px; background:#25D366; color:#fff; font-size:0.7rem; font-weight:500; display:flex; align-items:center; justify-content:center; padding:0 5px; flex-shrink:0; align-self:center; }
.conv-contact-name.unread { color:var(--text); font-weight:500; }
.conv-contact-time.unread { color:#25D366; font-weight:600; }
.conv-contact-lastmsg.unread { color:var(--text); font-weight:500; }

/* Chat header redesign */
.conv-chat-header { display:flex; align-items:center; gap:12px; padding:10px 16px; background:var(--card); border-bottom:1px solid var(--border); }
.conv-header-info { flex:1; min-width:0; }
.conv-header-tags { display:flex; gap:6px; align-items:center; margin-top:3px; flex-wrap:wrap; }
.conv-header-actions { display:flex; gap:4px; align-items:center; flex-shrink:0; }
.conv-header-btn { background:none; border:none; cursor:pointer; color:var(--text-muted); padding:6px; border-radius:8px; display:flex; align-items:center; justify-content:center; transition:color 0.15s,background 0.15s; }
.conv-header-btn:hover { color: var(--accent-ink); background:var(--accent)14; }
.conv-header-btn.active { color: var(--accent-ink); }

/* Menu + */
.conv-plus-wrap { position:relative; }
.conv-plus-btn { border:1px solid var(--border) !important; border-radius:50% !important; width:28px; height:28px; padding:0 !important; display:flex; align-items:center; justify-content:center; transition:all 0.15s; }
.conv-plus-btn:hover { border-color:var(--accent) !important; color: var(--accent-ink) !important; background:var(--accent)10 !important; }
.conv-plus-menu { position:absolute; bottom:calc(100% + 8px); left:0; background:var(--card); border:1px solid var(--border); border-radius:12px; box-shadow:0 8px 24px rgba(0,0,0,0.15); overflow:hidden; z-index:200; min-width:190px; }
.conv-plus-menu button { display:flex; align-items:center; gap:10px; width:100%; padding:11px 16px; background:none; border:none; border-bottom:1px solid var(--border); text-align:left; font-size:0.83rem; color:var(--text); cursor:pointer; transition:background 0.12s; }
.conv-plus-menu button:last-child { border-bottom:none; }
.conv-plus-menu button:hover { background:var(--bg); }
.conv-plus-menu button svg { color:var(--text-muted); flex-shrink:0; }

/* Input area com tabs */
.conv-input-area { background:var(--card); display:flex; flex-direction:column; position:relative; }
.conv-input-tabs { display:flex; border-bottom:1px solid var(--border); }
.conv-input-tab { flex:1; background:none; border:none; border-bottom:2px solid transparent; padding:10px 12px; font-size:0.8rem; font-weight:500; color:var(--text-muted); cursor:pointer; transition:all 0.15s; }
.conv-input-tab.active { color: var(--accent-ink); border-bottom-color:var(--accent); }
.conv-msg-input { width:100%; background:transparent; border:none; padding:12px 14px 4px; font-size:0.86rem; color:var(--text); resize:none; outline:none; font-family:inherit; line-height:1.4; max-height:120px; overflow-y:auto; box-sizing:border-box; }
.conv-reply-row { flex-direction:row !important; align-items:center; gap:8px; padding:10px 12px; }
.conv-reply-row > * { flex-shrink:0; }
.conv-msg-input-inline { flex:1 !important; flex-shrink:1 !important; min-width:0; background:var(--bg); border:1px solid var(--border); border-radius:20px; padding:8px 14px; font-size:0.86rem; color:var(--text); resize:none; outline:none; font-family:inherit; line-height:1.4; max-height:120px; overflow-y:auto; transition:border-color 0.15s; }
.conv-msg-input-inline:focus { border-color:var(--accent); }
.conv-input-toolbar { display:flex; align-items:center; justify-content:space-between; padding:4px 10px 8px; }
.conv-tool-btn { background:none; border:none; cursor:pointer; color:var(--text-muted); padding:6px; border-radius:8px; display:flex; align-items:center; transition:color 0.15s; }
.conv-tool-btn:hover { color: var(--accent-ink); }

/* Schedule */
.conv-schedule-datetime { display:flex; gap:12px; padding:8px 14px; border-top:1px solid var(--border); }
.conv-schedule-field { display:flex; align-items:center; gap:6px; color:var(--text-muted); font-size:0.8rem; }
.conv-schedule-field label { color:var(--text-muted); font-size:0.8rem; }
.conv-schedule-input { background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:5px 8px; font-size:0.8rem; color:var(--text); outline:none; }
.conv-schedule-input:focus { border-color:var(--accent); }
.conv-schedule-footer { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 14px 12px; flex-wrap:wrap; }
.conv-schedule-info { display:flex; align-items:center; gap:6px; font-size:0.75rem; color:var(--text-muted); flex:1; }
.conv-schedule-btn { display:flex; align-items:center; gap:6px; background:var(--accent); color:#062F28; border:none; border-radius:10px; padding:8px 16px; font-size:0.82rem; font-weight:500; cursor:pointer; white-space:nowrap; transition:opacity 0.15s; flex-shrink:0; }
.conv-schedule-btn:hover { opacity:0.85; }

/* Notas inline */
.conv-notes-tab-header { display:flex; align-items:center; gap:6px; padding:8px 14px 6px; font-size:0.75rem; color:var(--text-muted); border-bottom:1px solid var(--border); background:var(--accent)08; }
.conv-notes-tab-header svg { color: var(--accent-ink); flex-shrink:0; }

/* Banner de mensagem agendada */
.conv-scheduled-banner { padding:7px 16px; font-size:0.76rem; color:var(--text-muted); border-top:1px solid var(--border); background:var(--bg); display:flex; align-items:center; gap:4px; flex-wrap:wrap; }
.conv-scheduled-banner-btn { background:none; border:none; cursor:pointer; color: var(--accent-ink); font-size:0.76rem; font-weight:600; padding:0; text-decoration:underline; }
.conv-scheduled-banner-btn:hover { opacity:0.8; }

/* Mensagens agendadas */
.conv-scheduled-list { display:flex; flex-direction:column; gap:0; max-height:220px; overflow-y:auto; }
.conv-scheduled-item { padding:12px 16px; border-bottom:1px solid var(--border); display:flex; flex-direction:column; gap:5px; }
.conv-scheduled-item.conv-scheduled-past { opacity:0.55; }
.conv-scheduled-meta { display:flex; align-items:center; gap:6px; font-size:0.74rem; color:var(--text-muted); }
.conv-scheduled-badge { padding:2px 7px; border-radius:20px; font-size:0.66rem; font-weight:500; background:var(--accent)22; color: var(--accent-ink); }
.conv-scheduled-badge.pending { background:#E39B1222; color:#E39B12; }
.conv-scheduled-text { font-size:0.82rem; color:var(--text); white-space:pre-wrap; word-break:break-word; }
.conv-scheduled-cancel { align-self:flex-end; background:none; border:1px solid var(--border); border-radius:6px; padding:3px 10px; font-size:0.72rem; color:var(--text-muted); cursor:pointer; transition:all 0.15s; }
.conv-scheduled-cancel:hover { border-color:#E5484D; color:#E5484D; }

/* Emoji picker */
.conv-emoji-picker { position:absolute; bottom:calc(100% + 6px); left:14px; background:var(--card); border:1px solid var(--border); border-radius:12px; padding:8px; display:flex; flex-wrap:wrap; gap:2px; width:240px; box-shadow:0 8px 24px rgba(0,0,0,0.2); z-index:100; }
.conv-emoji-btn { background:none; border:none; cursor:pointer; font-size:1.2rem; padding:4px; border-radius:6px; transition:background 0.1s; }
.conv-emoji-btn:hover { background:var(--bg); }
.conv-input-area { position:relative; }

/* Painel lateral de informações */
.conv-info-panel { width:300px; flex-shrink:0; border-left:1px solid var(--border); background:var(--surface); flex-direction:column; overflow:hidden; }
.conv-info-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid var(--border); flex-shrink:0; }
.conv-info-title { font-weight:500; font-size:0.88rem; color:var(--text); }
.conv-info-body { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:20px; }
.conv-info-contact { display:flex; align-items:center; gap:12px; }
.conv-whatsapp-btn { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; padding:10px; background:#25D366; color:#fff; border:none; border-radius:10px; font-size:0.84rem; font-weight:600; cursor:pointer; text-decoration:none; transition:opacity 0.15s; }
.conv-whatsapp-btn:hover { opacity:0.9; }
.conv-info-section { display:flex; flex-direction:column; gap:8px; }
.conv-info-section-title { font-weight:500; font-size:0.82rem; color:var(--text); }
.conv-info-section-sub { font-size:0.75rem; color:var(--text-muted); margin:0; }

/* Triagem */
.conv-triagem-options { display:flex; flex-direction:column; gap:6px; }
.conv-triagem-btn { display:flex; align-items:center; gap:10px; width:100%; padding:10px 14px; background:var(--bg); border:1px solid var(--border); border-radius:10px; cursor:pointer; font-size:0.83rem; font-weight:500; color:var(--text); transition:all 0.15s; text-align:left; }
.conv-triagem-btn:hover { border-color:var(--triagem-color); background:var(--triagem-color)11; }
.conv-triagem-btn.active { border-color:var(--triagem-color); background:var(--triagem-color)18; color:var(--triagem-color); font-weight:500; }
.conv-triagem-icon { display:flex; flex-shrink:0; }
.conv-triagem-check { margin-left:auto; font-size:0.85rem; }

/* Notas */
.conv-notes-input { width:100%; min-height:80px; background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:10px 12px; font-size:0.82rem; color:var(--text); resize:vertical; outline:none; font-family:inherit; box-sizing:border-box; transition:border-color 0.15s; }
.conv-notes-input:focus { border-color:var(--accent); }
.conv-notes-save-btn { align-self:flex-end; background:none; border:1px solid var(--border); border-radius:8px; padding:6px 14px; font-size:0.78rem; color:var(--text-muted); cursor:pointer; transition:all 0.15s; }
.conv-notes-save-btn:hover { border-color:var(--accent); color: var(--accent-ink); }

/* Info rows */
.conv-info-rows { display:flex; flex-direction:column; gap:10px; }
.conv-info-row { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:0.78rem; }
.conv-info-row span:first-child { color:var(--text-muted); flex-shrink:0; }
.conv-info-row span:last-child { color:var(--text); font-weight:600; text-align:right; }
.conv-assigned-input { background:var(--bg); border:1px solid var(--border); border-radius:6px; padding:3px 8px; font-size:0.78rem; color:var(--text); outline:none; width:120px; text-align:right; }
.conv-assigned-input:focus { border-color:var(--accent); }

/* ── Propostas Comerciais — barra + dropdown em Conversas ── */
.conv-proposal-bar { display:flex; justify-content:flex-end; padding:4px 12px 0; }
.conv-proposal-wrap { position:relative; }
.conv-proposal-btn {
  display:flex; align-items:center; gap:6px;
  background:var(--accent); color:#062F28;
  border:none; border-radius:20px; padding:7px 14px;
  font-size:0.8rem; font-weight:500; cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,0.18);
  transition:opacity 0.15s, transform 0.1s;
  white-space:nowrap;
}
.conv-proposal-btn:hover { opacity:0.88; transform:translateY(-1px); }
.conv-proposal-menu {
  position:absolute; bottom:calc(100% + 6px); right:0;
  background:var(--card); border:1px solid var(--border);
  border-radius:12px; min-width:240px; max-width:300px;
  box-shadow:0 8px 24px rgba(0,0,0,0.22);
  flex-direction:column; overflow:hidden; z-index:200;
}
.conv-proposal-list { display:flex; flex-direction:column; max-height:260px; overflow-y:auto; }
.conv-proposal-item {
  display:flex; align-items:center; gap:10px;
  padding:10px 14px; background:none; border:none;
  border-bottom:1px solid var(--border); cursor:pointer;
  text-align:left; transition:background 0.12s; width:100%;
}
.conv-proposal-item:last-child { border-bottom:none; }
.conv-proposal-item:hover { background:var(--surface-2, rgba(255,255,255,0.05)); }
.conv-proposal-item-icon { flex-shrink:0; color: var(--accent-ink); }
.conv-proposal-item-info { display:flex; flex-direction:column; gap:2px; min-width:0; }
.conv-proposal-item-name { font-size:0.84rem; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.conv-proposal-item-file { font-size:0.73rem; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.conv-proposal-footer { border-top:1px solid var(--border); padding:6px 8px; }
.conv-proposal-footer button {
  display:flex; align-items:center; gap:6px; width:100%;
  background:none; border:none; color:var(--text-muted);
  font-size:0.78rem; padding:6px 8px; border-radius:7px;
  cursor:pointer; transition:background 0.12s;
}
.conv-proposal-footer button:hover { background:var(--surface-2, rgba(255,255,255,0.05)); color:var(--text); }

/* ── Propostas Comerciais — seção de Configurações ── */
.proposal-upload-form {
  display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap;
  background:var(--surface-2, rgba(255,255,255,0.03));
  border:1px solid var(--border); border-radius:10px; padding:14px;
}
.proposal-upload-fields { display:flex; gap:12px; flex:1; flex-wrap:wrap; min-width:0; }
.proposal-list-item {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px 12px; border:1px solid var(--border);
  border-radius:8px; margin-bottom:8px; background:var(--card); flex-wrap:wrap;
}
.proposal-list-info { display:flex; align-items:center; gap:8px; min-width:0; flex:1; }
.proposal-list-name { font-size:0.85rem; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.proposal-preview-link { color:var(--text-muted); display:flex; align-items:center; flex-shrink:0; }
.proposal-preview-link:hover { color: var(--accent-ink); }
.proposal-list-actions { display:flex; gap:6px; flex-shrink:0; }

/* ==================== LOGO ORTUS OS (wordmark oficial) ==================== */
.ortus-logo-wrap { background: none !important; -webkit-text-fill-color: initial !important; line-height: 0; display: inline-block; }
.ortus-logo { display: block; height: auto; max-width: 100%; }
.login-box .logo h1.ortus-logo-wrap .ortus-logo { width: 240px; margin: 0 auto; }
.login-box .logo h1.ortus-logo-wrap + p { margin-top: 16px; }
.sidebar-logo-text.ortus-logo-wrap .ortus-logo { width: 120px; }

/* =====================================================================
   TIPOGRAFIA ORTUS OS (DS v2)
   Inter em toda a interface (valores com tabular-nums). Só a primeira letra maiúscula;
   caixa alta apenas em rótulos pequenos de seção.
   ===================================================================== */
:root { --ortus-tracking-label: 0.06em; }

/* família única + números tabulares */
body, button, input, select, textarea { font-family: var(--font-sans), system-ui, -apple-system, sans-serif; }
body { line-height: 1.5; font-feature-settings: 'cv11', 'ss01'; }
strong, b { font-weight: 600; }

/* títulos: Medium 500, tracking levemente negativo */
h1, h2, h3, h4, h5 { font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; }
.dash-title, .workspace-screen .ws-header h1 { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
.dash-subtitle, .workspace-screen .ws-header p { font-size: 12px; line-height: 1.6; }
.modal-header h3, .first-login-box h2, .edit-ws-box h2 { font-size: 16px; font-weight: 500; letter-spacing: 0; }
.agenda-month-label { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.scm-title { font-weight: 500; }

/* números de KPI: tamanho display, Medium, tabular */
.dash-card-value, .status-mini-card .count, .kanban-card .kc-valor, .dash-secondary-value {
  font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.dash-card-value { font-size: 24px; }
.status-mini-card .count { font-size: 24px; }
.kanban-card .kc-valor { font-size: 16px; }
td, .kc-highlight-value { font-variant-numeric: tabular-nums; }

/* botões: pílula, verbo primeiro, 13px/500 */
.btn, .fab, .kc-btn-contact, .kc-btn-aprovado, .agenda-today-btn, .conv-new-btn, .conv-schedule-btn {
  font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; border-radius: var(--radius-pill);
}
.btn-sm { font-size: 12px; }
.login-box .btn-primary { font-size: 14px; }
.form-group label, .profile-modal .form-group label {
  font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none;
}
.list-table th, .hist-table th, .asaas-table th, .cob-parcelas-table th, .ass-table th, .main-content table th, .cob-th {
  font-size: 10px; font-weight: 400; letter-spacing: var(--ortus-tracking-label); text-transform: uppercase;
}
.status-badge, .kc-payment-badge, .kc-recorrente, .kc-origem, .dash-badge, .notif-card-tag, .nav-excl-tag {
  font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; border-radius: var(--radius-pill);
}
.dash-card-label, .status-mini-card .status-name, .kanban-card .kc-segmento, .kc-highlight-label,
.kanban-column-header .col-title, .kanban-column-header .col-count, .agenda-dow,
.notif-panel-header, .notif-section-title, .notif-section-header, .settings-section h3,
.wizard-tip-label, .cob-summary-label, .ws-branding, .login-box .logo p {
  font-size: 10px; font-weight: 400; letter-spacing: var(--ortus-tracking-label); text-transform: uppercase;
}
.login-box .logo p, .ws-branding { letter-spacing: 0.12em; }
.view-toggle button, .conv-filter-tab, .conv-input-tab {
  font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none;
}

/* menu lateral: 13px, só a primeira letra maiúscula */
.sidebar-nav .nav-tab { font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.sidebar-nav .nav-tab.active { font-weight: 500; }
.sidebar-ws-text { font-size: 11px; font-weight: 400; letter-spacing: var(--ortus-tracking-label); text-transform: uppercase; }

/* corpo: 12–14px, entrelinha 1.6 */
.cfg-desc, .kanban-card .kc-pacote, .kanban-card .kc-dates, .dash-card-sub { font-size: 11px; line-height: 1.6; }
.list-table td { font-size: 12px; }
.kanban-card .kc-empresa { font-size: 13px; font-weight: 500; }
.topnav-ws-btn { font-size: 13px; font-weight: 500; }
.profile-dd-item, .topnav-ws-item, .toast { font-size: 12px; }
.profile-dd-name, .notif-card-title, .workspace-card .ws-instagram { font-weight: 500; }
.workspace-card .ws-instagram { font-size: 16px; letter-spacing: -0.01em; }

/* valores dos cards de KPI: Inter Semibold 600 */
.dash-card-value, .dash-secondary-value, .stat-card .value { font-weight: 600; }


/* ==================== ORTUSOS — valores e metricas (fonte numerica + tabular-nums) ==================== */
.dash-card-value, .dash-secondary-value, .dash-recent-value, .historico-bar-value,
.kc-highlight-value, .cob-summary-value, .ass-stat-value, .ass-rem-value,
.ass-rem-total-value, .hist-col-valor, .hist-entry-valor {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--lime-300); color: var(--pine-900); }
:focus-visible { outline: none; box-shadow: var(--ring-focus); }

/* =====================================================================
   LAYOUT APP WEB ORTUSOS (ui_kits/app)
   Sidebar clara 240px + barra superior 64px + grade de cards brancos
   sobre gray-100 com espaco de 12px.
   ===================================================================== */

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--pine-900);
  border-right: none;
  padding: 18px 14px;
  gap: 6px;
}
.sidebar-logo { padding: 4px 8px 14px; border-bottom: none; }
.sidebar-logo-text.ortus-logo-wrap .ortus-logo { width: 104px; }

.sidebar-account {
  margin-bottom: 14px;
  /* seletor de workspace: card branco sobre a sidebar Pinho (dropdown tambem claro) */
  --card: var(--white);
  --card-hover: var(--gray-50);
  --surface: var(--white);
  --surface-2: var(--gray-100);
  --surface-3: var(--gray-150);
  --border: var(--border-subtle);
  --text: var(--pine-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --accent-ink: var(--pine-900);
}
.sidebar .topnav-ws-btn {
  width: 100%;
  gap: 10px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--white);
  border-radius: var(--radius-md);
  text-align: left;
}
.sidebar .topnav-ws-btn:hover { background: var(--gray-50); }
.sidebar .topnav-ws-dot {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--pine-900);
  color: var(--lime-500);
  font: 600 12px/1 var(--font-sans);
  box-shadow: 0 0 0 2px var(--white), 0 0 0 3.5px var(--ws-cor, var(--lime-500));
}
.sb-acc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar .topnav-ws-name { max-width: none; font: 600 12px/1.2 var(--font-sans); color: var(--pine-900); }
.sb-acc-sub { font: 400 11px/1.2 var(--font-sans); color: var(--gray-600); }
.sb-acc-sub:empty { display: none; }
.sidebar .topnav-ws-arrow { color: var(--gray-500); }
.sidebar .topnav-ws-arrow.open { transform: none; }
.sidebar .topnav-ws-dropdown { left: 0; right: 0; min-width: 0; top: calc(100% + 6px); box-shadow: var(--shadow-lg); border-color: var(--border-subtle); }

.sidebar-nav { padding: 0; gap: 2px; }
.sidebar-section-label {
  font: 500 10px/1 var(--font-sans);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--pine-400);
  padding: 6px 12px;
}
.sidebar-section-label--gap { padding-top: 18px; }
.sidebar-nav .nav-tab {
  height: 36px;
  padding: 0 12px;
  gap: 10px;
  border-radius: var(--radius-md);
  border-left: none;
  font: 400 13px/1 var(--font-sans);
  color: var(--pine-200);
}
.sidebar-nav .nav-tab svg { width: 16px; height: 16px; opacity: 1; }
.sidebar-nav .nav-tab:hover { background: rgba(255, 255, 255, 0.06); color: var(--white); }
.sidebar-nav .nav-tab.active {
  background: rgba(255, 255, 255, 0.10);
  box-shadow: none;
  border-left: none;
  padding-left: 12px;
  font-weight: 600;
  color: var(--white);
}
.sidebar-nav .nav-tab.active svg { color: var(--lime-500); }
.sidebar-nav .nav-tab-settings { margin-top: 0; border-top: none; padding-top: 0; border-radius: var(--radius-md); }

/* ---------- Barra superior ---------- */
.topnav {
  height: var(--topbar-height);
  padding: 0 var(--page-gutter);
  background: var(--surface-app);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: none;
  gap: 12px;
}
.topnav-left { flex: 1; min-width: 0; }
.topbar-title { min-width: 0; }
.topbar-h { font: 600 14px/1.2 var(--font-sans); color: var(--pine-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { font: 400 12px/1.3 var(--font-sans); color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub:empty { display: none; }
.topnav-right { gap: 8px; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  width: 260px; height: var(--control-md);
  padding: 0 8px 0 12px;
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--gray-500);
  cursor: text;
  transition: box-shadow var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.topbar-search:focus-within { border-color: var(--lime-500); box-shadow: var(--ring-focus); }
.topbar-search input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent; box-shadow: none;
  font: 400 13px/1 var(--font-sans); color: var(--pine-900);
}
.topbar-search input:focus-visible { box-shadow: none; }
.topbar-search input::placeholder { color: var(--text-subtle); }
.topbar-search input::-webkit-search-cancel-button { display: none; }
.topbar-kbd { display: flex; gap: 3px; }
.topbar-kbd kbd {
  font: 500 10px/1 var(--font-sans);
  padding: 3px 5px;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  background: var(--white);
  color: var(--gray-600);
}
.topnav-icon-btn { width: 36px; height: 36px; border-radius: var(--radius-pill); color: var(--pine-900); }
.topnav-icon-btn:hover { background: var(--white); }
.topnav-profile-btn { padding: 0; background: none; border: none; }
.topnav-profile-btn:hover { background: none; }
.topnav-profile-btn #userName { display: none; }
.topnav-avatar { width: 34px; height: 34px; box-shadow: 0 0 0 1px var(--border-default); }

/* ---------- Conteudo ---------- */
.main-wrapper { background: var(--surface-app); }
.main-content { padding: var(--page-gutter); }
/* titulo/subtitulo vao para a barra superior; o cabecalho da pagina fica so com as acoes */
.main-content .page .dash-title,
.main-content .page .dash-subtitle { display: none; }
.main-content .clients-header { margin-bottom: var(--card-gap); justify-content: flex-end; }
/* rotulo "Preferencias" some quando o usuario nao ve nenhum item da secao */
.sidebar-section-label--gap:not(:has(~ .nav-tab:not([style*="none"]))) { display: none; }
.main-content .dash-page-header { margin-bottom: var(--card-gap); justify-content: flex-end; }
.main-content .dash-page-header:not(:has(button, select, input, a)) { display: none; }

.dash-cards-grid { gap: var(--card-gap); margin-bottom: var(--card-gap); }
.dash-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--card-padding);
  box-shadow: var(--shadow-xs);
}
.dash-card:hover { transform: none; box-shadow: var(--shadow-sm); }

/* Card de destaque em Lima (equivalente ao card de saldo do UI kit): Receita bruta */
#page-dashboard .dash-cards-grid > .dash-card:nth-child(2) {
  position: relative;
  overflow: hidden;
  background: var(--lime-500);
  border-color: var(--lime-500);
}
#page-dashboard .dash-cards-grid > .dash-card:nth-child(2)::after {
  content: '';
  position: absolute;
  right: -60px; top: -40px;
  width: 220px; height: 220px;
  border-radius: 50%;
  border: 28px solid rgba(255, 255, 255, 0.22);
  pointer-events: none;
}
#page-dashboard .dash-cards-grid > .dash-card:nth-child(2) > * { position: relative; z-index: 1; }
#page-dashboard .dash-cards-grid > .dash-card:nth-child(2) .dash-card-label,
#page-dashboard .dash-cards-grid > .dash-card:nth-child(2) .dash-card-sub { color: var(--pine-700); }
#page-dashboard .dash-cards-grid > .dash-card:nth-child(2) .dash-card-value { color: var(--pine-900); }
#page-dashboard .dash-cards-grid > .dash-card:nth-child(2) .dash-card-icon { background: rgba(255, 255, 255, 0.55) !important; color: var(--pine-900) !important; }
#page-dashboard .dash-cards-grid > .dash-card:nth-child(2) .dash-badge { background: var(--white) !important; color: var(--pine-900) !important; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .sidebar { left: calc(-1 * var(--sidebar-width)); }
  .sidebar.mobile-open { left: 0; box-shadow: var(--shadow-lg); }
}
@media (max-width: 768px) {
  .topbar-search { display: none; }
  .topbar-sub { display: none; }
}

/* Resumo: grafico e "Atualizacoes recentes" alinhados com as 6 colunas do funil.
   Evolucao acumulada = Negociacao..Produzido (4 col.); Atualizacoes = Postado..Follow-up (2 col.) */
@media (min-width: 1101px) {
  #page-dashboard .status-cards-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--card-gap); }
  #page-dashboard .dash-bottom-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--card-gap); }
  #page-dashboard .dash-bottom-row > .dash-chart-card { grid-column: span 4; }
  #page-dashboard .dash-bottom-row > .dash-recent-card { grid-column: span 2; }
}

/* Botao flutuante "Novo cliente": Pinho, como a sidebar */
.fab { background: var(--pine-900); color: var(--white); box-shadow: 0 4px 20px rgba(6, 47, 40, 0.25); }
.fab:hover { background: var(--pine-700); box-shadow: 0 6px 25px rgba(6, 47, 40, 0.3); }

/* Atualizacoes recentes: respiro entre os valores e a barra de rolagem */
.dash-recent-list { padding-right: 12px; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent; }
.dash-recent-list::-webkit-scrollbar { width: 4px; }
.dash-recent-list::-webkit-scrollbar-track { background: transparent; }
.dash-recent-list::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-pill); }
.dash-recent-list::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Resumo: card de destaque em Lima 300 (DS) */
#page-dashboard .dash-cards-grid > .dash-card:nth-child(2) { background: var(--lime-300); border-color: var(--lime-300); }
#page-dashboard .dash-cards-grid > .dash-card:nth-child(2)::after { border-color: rgba(255, 255, 255, 0.45); }

/* Avatar do usuario (barra superior e menu do perfil): Pinho com inicial em Lima, como o avatar do workspace */
.topnav-avatar, .profile-dd-avatar { background: var(--pine-900); color: var(--lime-500); }

/* Login: card branco sobre o fundo Pinho (formulario de login e de redefinir senha) */
.login-box, #forgotPasswordForm {
  --card: var(--gray-50);
  --card-hover: var(--gray-100);
  --surface: var(--white);
  --surface-2: var(--gray-100);
  --border: var(--border-default);
  --text: var(--pine-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --accent-ink: var(--pine-900);
  background: var(--white) !important;
  border: 1px solid var(--white) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: var(--shadow-lg);
}
.login-box .logo p { color: var(--gray-600); }
#forgotPasswordForm h3 { color: var(--pine-900) !important; }
.login-screen .login-box .btn-primary, .login-screen #forgotPasswordForm .btn-primary { background: var(--pine-900); color: var(--white); }
.login-screen .login-box .btn-primary:hover, .login-screen #forgotPasswordForm .btn-primary:hover { background: var(--pine-700); }

/* "Em breve": recursos visiveis, mas bloqueados (Conversas e Asaas para quem nao e Administrador) */
.tag-em-breve {
  display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 8px;
  border-radius: 999px; background: var(--lime-100); color: var(--pine-900);
  font: 600 10px/1.4 var(--font-sans); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}
.nav-tab.is-locked { opacity: 0.7; }
.nav-tab.is-locked .tag-em-breve { margin-left: auto; }
.kc-btn-contact.is-locked, .kc-btn-contact.is-locked:hover,
.btn-abrir-conversa.is-locked, .btn-abrir-conversa.is-locked:hover {
  background: var(--gray-100) !important; color: var(--gray-600) !important; cursor: not-allowed;
}
.kc-btn-contact.is-locked .tag-em-breve, .btn-abrir-conversa.is-locked .tag-em-breve { margin-left: 6px; }
.settings-section.is-locked > h3,
#page-configuracoes .settings-section.is-locked > h3 { cursor: not-allowed; color: var(--gray-500); }
.settings-section.is-locked > h3 > svg { color: var(--gray-500); }
.settings-section.is-locked > h3 .cfg-chevron { opacity: 0.3; }
.asaas-section.is-locked .asaas-table-wrap,
.asaas-section.is-locked .asaas-footer,
.asaas-section.is-locked #asaasCompletaCard { opacity: 0.5; }
.asaas-section.is-locked button { cursor: not-allowed; }
.toast.info { border-left: 3px solid var(--lime-500); }

/* Campo de senha com botao de olho (mostrar/ocultar) */
.pass-wrap { position: relative; }
.form-group .pass-wrap input { padding-right: 46px; }
.pass-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-muted); cursor: pointer; transition: color var(--transition), background var(--transition);
}
.pass-toggle:hover { color: var(--text); background: var(--card-hover); }
.pass-toggle:focus-visible { outline: 2px solid var(--lime-500); outline-offset: 1px; }
.pass-toggle .eye-closed { display: none; }
.pass-toggle.is-visible .eye-open { display: none; }
.pass-toggle.is-visible .eye-closed { display: block; }

/* Ilustracao "pesquisando" (DS OrtusOS) no estado vazio de Clientes */
.hist-empty-illustration { width: auto; height: 180px; max-width: 70%; margin-bottom: 20px; user-select: none; pointer-events: none; }

/* =====================================================================
   CONFIGURACOES — espacamentos e tipografia no padrao OrtusOS
   ===================================================================== */
#page-configuracoes .settings-section {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  margin-bottom: var(--card-gap);
}
/* titulo da secao = titulo de card: 14px/600, so a primeira letra maiuscula */
#page-configuracoes .settings-section h3 {
  gap: 10px;
  font: 600 14px/1.3 var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
  color: var(--pine-900);
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom-color: var(--border-subtle);
}
#page-configuracoes .settings-section h3 svg:first-child { width: 16px; height: 16px; }
#page-configuracoes .settings-section.collapsed h3 { margin-bottom: 0; padding-bottom: 0; border-bottom-color: transparent; }
/* cabecalho com altura estavel (toggle e botao "Adicionar contato" nao encostam na linha) */
#page-configuracoes .settings-section h3 { min-height: 32px; }
/* descricao: sem margem negativa (era cortada pelo overflow do corpo) */
#page-configuracoes .cfg-desc { font-size: 13px; line-height: 1.5; color: var(--text-muted); margin: 0 0 16px; }
#page-configuracoes .form-group { margin-bottom: 16px; }
#page-configuracoes .form-group label { font-size: 12px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
#page-configuracoes .form-hint { font-size: 12px; margin-top: 8px; }
#page-configuracoes .settings-row .form-group:last-child { margin-bottom: 0; }
/* metas: botao ao lado dos campos, largura do conteudo */
#page-configuracoes .cfg-meta-form { gap: 12px; margin-bottom: 16px; }
#page-configuracoes .cfg-meta-form .form-group { margin-bottom: 0; }
#page-configuracoes .cfg-meta-btn { width: auto; flex: 0 0 auto; height: 44px; padding: 0 24px; }
/* barra final de salvar */
#page-configuracoes .cfg-save-bar { padding: 4px 0 32px; }
#page-configuracoes .cfg-save-bar .btn { width: auto; min-width: 200px; height: 44px; font-size: 14px; }
/* blocos internos (Remuneracao): bloco aninhado do DS = raio 16 + borda 1px, padding 16 */
#page-configuracoes .rem-block {
  background: var(--gray-50);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: var(--card-gap);
}
#page-configuracoes .rem-block:last-child { margin-bottom: 0; }
#page-configuracoes .rem-block-header h4 { font: 600 13px/1.3 var(--font-sans); color: var(--pine-900); }
#page-configuracoes .rem-block-desc { font-size: 12px; }
#page-configuracoes .rem-block-fields .form-group { margin-bottom: 0; }

/* Assessoria > Calculo da remuneracao: card em Pinho com letras brancas, caixa "Total a pagar" em Lima 600 */
#assessoriaRemuneration {
  --card: var(--pine-900);
  --text: var(--white);
  --text-secondary: var(--white);
  --text-muted: rgba(255, 255, 255, 0.7);
  --border: rgba(255, 255, 255, 0.12);
  --accent-ink: var(--white);
  background: var(--pine-900);
  border-color: var(--pine-900);
  color: var(--white);
}
#assessoriaRemuneration .ass-rem-total-box { background: var(--lime-600); border-color: var(--lime-600); border-radius: var(--radius-md); }
#assessoriaRemuneration .ass-rem-total-label { color: var(--pine-800); }
#assessoriaRemuneration .ass-rem-total-value { color: var(--pine-900); font-weight: 600; }

/* =====================================================================
   FINANCEIRO — linhas de receita (tipo), card Receita bruta e modal
   ===================================================================== */
.cob-thead, .cob-row { grid-template-columns: 36px 2fr 1.25fr 1.45fr 0.6fr 1.4fr 1.3fr 52px; }
.cob-col-tipo { display: flex; align-items: center; min-width: 0; }

/* selo de tipo: pilula suave (DS), cor por linha de receita + texto sempre visivel */
.rec-tipo-badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: var(--radius-pill); font: 500 12px/1 var(--font-sans); white-space: nowrap;
}
.rec-tipo--publicidade { background: var(--lime-100); color: var(--lime-700); }
.rec-tipo--cupom       { background: var(--blue-100); color: var(--blue-500); }
.rec-tipo--afiliado    { background: var(--amber-100); color: var(--amber-500); }
.rec-tipo--plataforma  { background: #E6ECEA; color: var(--pine-700); }
.rec-tipo--recorrente  { background: var(--pine-900); color: var(--lime-500); }
.rec-tipo--outros      { background: var(--gray-100); color: var(--gray-600); }

/* card Receita bruta */
.cob-summary-card--bruta .cob-summary-label { color: var(--lime-700); }

/* botao Adicionar receita na barra de filtros */
.cob-add-btn { width: auto; flex: 0 0 auto; height: 38px; padding: 0 16px; gap: 6px; display: inline-flex; align-items: center; }


.rec-tipos { display: flex; flex-wrap: wrap; gap: 8px; }
.rec-tipo-chip {
  height: 34px; padding: 0 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-default); background: var(--white); color: var(--pine-900);
  font: 500 13px/1 var(--font-sans); cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.rec-tipo-chip:hover { background: var(--gray-100); }
.rec-tipo-chip.active { background: var(--lime-100); border-color: var(--lime-500); font-weight: 600; }

.rec-check { display: flex; align-items: center; gap: 8px; height: 44px; margin-top: 22px; font: 500 13px/1 var(--font-sans); color: var(--pine-900); cursor: pointer; }
.rec-check input { width: 16px; height: 16px; accent-color: var(--lime-700); }

.rec-parcelas { display: flex; flex-direction: column; gap: 8px; }
.rec-parcela-row { display: grid; grid-template-columns: 20px 1fr 1fr 118px; gap: 8px; align-items: center; }
.rec-parcela-row > :last-child { justify-self: end; }
.rec-parcela-row input { height: 38px; }
.rec-parcela-row.pago input { opacity: 0.6; }
.rec-parcela-n { font: 500 12px/1 var(--font-numeric); color: var(--text-muted); text-align: center; }
.rec-parcela-status { font: 500 11px/1.2 var(--font-sans); color: var(--lime-700); background: var(--lime-100); padding: 5px 8px; border-radius: var(--radius-pill); white-space: nowrap; }
.rec-parcela-del {
  width: 30px; height: 30px; border: none; border-radius: var(--radius-pill); background: transparent;
  color: var(--gray-500); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.rec-parcela-del:hover { background: var(--red-100); color: var(--red-500); }
.rec-parcelas-empty { font-size: 13px; color: var(--text-muted); padding: 8px 0; }
.rec-add-parcela {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-pill); background: transparent;
  color: var(--pine-900); font: 500 12px/1 var(--font-sans); cursor: pointer;
}
.rec-add-parcela:hover { background: var(--gray-100); }

}

/* Modal de receita: usa .modal-overlay/.modal do Novo Cliente; tipos com o visual das abas do formulario */
.rec-modal .rec-tipos { margin-top: 2px; }
.rec-modal .rec-tipo-chip { height: 32px; padding: 0 14px; font-size: 13px; border-color: var(--border); color: var(--text-muted); }
.rec-modal .rec-tipo-chip:hover { color: var(--pine-900); background: var(--gray-100); }
.rec-modal .rec-tipo-chip.active { background: var(--lime-500); border-color: var(--lime-500); color: var(--pine-900); font-weight: 600; }
.rec-modal .form-hint { margin-top: 8px; }
/* Conversor US$ -> R$ (Cupom/Afiliado/Plataforma): resumo do que sera salvo em reais */
.rec-conversao { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 72px; margin-top: 22px; margin-bottom: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--lime-100); }
.rec-conversao:empty { display: none; }
.rec-modal .form-row[hidden] { display: none; }
.rec-conversao-label { font: 500 12px/1.2 var(--font-sans); color: var(--gray-600); }
.rec-conversao-valor { font: 600 18px/1.2 var(--font-numeric); color: var(--pine-900); }
.rec-conversao-sub { font: 400 12px/1.3 var(--font-sans); color: var(--gray-600); }
.rec-conversao-sub .nowrap { white-space: nowrap; }
@media (max-width: 560px) { .rec-conversao { margin-top: 0; } }
.rec-opcional { font-size: 11px; font-weight: 400; color: var(--text-muted); }
@media (max-width: 560px) { .rec-check { margin-top: 0; } }
/* linha separando o "Tipo de receita" dos campos do tipo escolhido (publicidade ou demais) */
.rec-modal .rec-tipo-group { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border-subtle); }

/* =====================================================================
   RESUMO — Analise avancada: Receita por tipo | Top segmentos | Top origens
   ===================================================================== */
.dash-analise-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--card-gap); margin-top: var(--card-gap); align-items: stretch; }
.dash-analise-row > div { border-radius: var(--radius-xl) !important; border-color: var(--border-subtle) !important; box-shadow: var(--shadow-xs); padding: 16px 18px !important; }
@media (max-width: 1100px) { .dash-analise-row { grid-template-columns: 1fr; } }

.rtipo-card { background: var(--card); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); padding: 16px 18px; }
.rtipo-title { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); font-size: 0.85rem; margin-bottom: 10px; }
.rtipo-body { display: flex; align-items: center; gap: 12px; }
.rtipo-donut { position: relative; width: 104px; height: 104px; flex: none; }
.rtipo-donut svg { width: 104px; height: 104px; }
.rtipo-donut circle { transition: opacity var(--duration-fast) var(--ease-out); }
.rtipo-donut svg:hover circle:not(:hover):not(:first-child) { opacity: 0.45; }
.rtipo-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.rtipo-center span { font: 400 10px/1 var(--font-sans); color: var(--text-muted); }
.rtipo-center strong { font: 600 12px/1.2 var(--font-numeric); color: var(--text); margin-top: 3px; font-variant-numeric: tabular-nums; }
.rtipo-legend { flex: 1; min-width: 0; padding-right: 2px; display: flex; flex-direction: column; gap: 6px; }
.rtipo-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto 36px; column-gap: 6px; align-items: center; font-size: 0.76rem; white-space: nowrap; }
.rtipo-swatch { width: 8px; height: 8px; border-radius: 3px; }
.rtipo-nome { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rtipo-pct { color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.rtipo-valor { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.rtipo-empty { font-size: 0.82rem; color: var(--text-muted); padding: 24px 0; text-align: center; }


/* =====================================================================
   MOBILE ORTUSOS (ate 768px)
   Camada so para celular: todas as regras ficam dentro do @media abaixo,
   entao a visao web (desktop/tablet) nao muda. Segue o DS OrtusOS:
   pilulas, cards brancos raio 20, dialogos raio 28, Pinho/Lima, foco lima.
   ===================================================================== */
/* botao "voltar" das Conversas: so aparece no celular */
.conv-back-btn { display: none; }

@media (max-width: 768px) {
  :root { --page-gutter: 16px; }

  /* ---------- Barra superior ---------- */
  .topnav {
    height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0 6px;
    gap: 6px;
  }
  .hamburger {
    display: flex;
    flex-shrink: 0;
    width: 40px; height: 40px;
    border-radius: var(--radius-pill);
    color: var(--pine-900);
  }
  .hamburger:hover, .hamburger:active { background: var(--white); }
  .hamburger svg { width: 20px; height: 20px; }
  .topbar-h { font-size: 15px; }
  .topnav-right { gap: 2px; }
  .topnav-icon-btn { width: 40px; height: 40px; }
  .topnav-profile-btn { margin-left: 4px; }
  .topnav-dropdown-panel { position: fixed; top: calc(60px + env(safe-area-inset-top)); left: 12px; right: 12px; width: auto; max-width: none; }

  /* ---------- Gaveta de navegacao ---------- */
  .mobile-nav { background: rgba(6, 47, 40, 0.32); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  .sidebar {
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    transition: left var(--duration-slow) var(--ease-out);
  }
  .sidebar-nav .nav-tab { height: 44px; font-size: 14px; }
  .sidebar-nav .nav-tab svg { width: 18px; height: 18px; }
  .sidebar .topnav-ws-btn { padding: 10px; }

  /* ---------- Conteudo ---------- */
  .main-content { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .main-content:has(#page-conversas.active) { padding-bottom: 16px; }

  /* cabecalho das paginas: acoes numa linha so, alinhadas a direita como na web */
  .main-content .dash-page-header,
  .main-content .clients-header { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
  .main-content .dash-page-header > div,
  .main-content .clients-header > div { flex-wrap: nowrap !important; max-width: 100%; min-width: 0; gap: 8px !important; }
  /* "Exportar" vira botao de icone redondo (IconButton do DS) */
  .main-content .cob-export-btn {
    font-size: 0; gap: 0;
    width: 40px; height: 40px; padding: 0;
    justify-content: center;
    border-radius: var(--radius-pill);
  }
  .main-content .cob-export-btn svg { width: 16px; height: 16px; }

  /* ---------- Todos os cards com a mesma largura: um por linha ---------- */
  .dash-cards-grid,
  .status-cards-row,
  .ass-stats-row,
  .hist-stats-grid { grid-template-columns: minmax(0, 1fr); gap: var(--card-gap); }
  .dash-card { min-width: 0; }
  .dash-card-value { font-size: 1.45rem; white-space: nowrap; }
  .rel-donut-card { width: auto; align-self: stretch; }

  /* ---------- Negociacoes: busca inteira + filtros em duas colunas ---------- */
  .filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .filter-bar .search-wrapper { grid-column: 1 / -1; }
  .filter-bar > :last-child:nth-child(even) { grid-column: 1 / -1; }
  .filter-bar select { width: 100%; min-width: 0; }
  /* colunas do kanban com a largura toda; o deslize para o lado encaixa uma coluna por vez */
  .kanban-container { scroll-snap-type: x mandatory; }
  .kanban-column { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; }

  /* ---------- Clientes (resultado da busca) ---------- */
  /* cadastro: avatar + nome na primeira linha, campos em 2 colunas abaixo, botao na largura toda */
  .hist-client-header {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 14px 12px;
    padding: 16px;
  }
  .hist-client-avatar { width: 44px; height: 44px; font-size: 1.05rem; }
  .hist-client-info { display: contents; }
  .hist-client-name { margin: 0; font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
  .hist-client-fields { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
  .hist-field-val { overflow-wrap: anywhere; }
  .hist-edit-text-btn { grid-column: 1 / -1; justify-content: center; height: 44px; border-radius: var(--radius-pill); }
  /* indicadores: um por linha, icone + texto */
  .hist-stat-inline { padding: 14px 16px; gap: 14px; }
  .hist-stat-inline .dash-card-value { white-space: nowrap; }
  /* historico: cada negociacao vira um card */
  .hist-table { min-width: 0; }
  .hist-table thead { display: none; }
  .hist-table, .hist-table tbody { display: block; }
  .hist-table-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "data   status"
      "pacote valor"
      "resp   resp"
      "obs    obs";
    gap: 6px 12px;
    padding: 14px 16px;
  }
  .hist-table td { padding: 0; }
  .hist-table .hist-col-data   { grid-area: data; align-self: center; }
  .hist-table .hist-col-status { grid-area: status; justify-self: end; }
  .hist-table .hist-col-pacote { grid-area: pacote; color: var(--text-secondary); }
  .hist-table .hist-col-valor  { grid-area: valor; justify-self: end; text-align: right; }
  .hist-table .hist-col-resp   { grid-area: resp; }
  .hist-table .hist-col-obs    { grid-area: obs; max-width: none; }
  .hist-table .hist-col-obs--vazio { display: none; }

  /* ---------- Financeiro: cada lancamento vira um card ---------- */
  .cob-toolbar { gap: 8px; }
  .cob-toolbar > * { flex: 1 1 100%; min-width: 0; }
  .cob-toolbar > .cob-filter-group { flex: 1 1 0; }
  .cob-toolbar > .cob-export-btn { flex: 0 0 40px; }
  .cob-search-wrap { min-width: 0; }
  .cob-filter-group .cob-select { width: 100%; min-width: 0; }
  .cob-thead { display: none; }
  .cob-row {
    grid-template-columns: 16px minmax(0, 1fr) auto 36px;
    grid-template-areas:
      "exp cli cli aco"
      ".   tip sta sta"
      ".   ven tot tot";
    column-gap: 8px; row-gap: 8px;
    padding: 14px 12px;
  }
  .cob-row .cob-col-expand   { grid-area: exp; }
  .cob-row .cob-col-cliente  { grid-area: cli; }
  .cob-row .cob-col-acoes    { grid-area: aco; }
  .cob-row .cob-col-tipo     { grid-area: tip; }
  .cob-row .cob-col-status   { grid-area: sta; justify-self: end; }
  .cob-row .cob-col-venc     { grid-area: ven; font-size: 0.8rem; }
  .cob-row .cob-col-venc::before { content: 'Vence '; color: var(--text-muted); }
  .cob-row .cob-col-total    { grid-area: tot; justify-self: end; display: flex; align-items: center; gap: 4px; }
  .cob-row .cob-col-parcelas { display: none; }
  .cob-detail { padding: 10px 12px 14px; overflow-x: auto; }
  .cob-parcelas-table { min-width: 460px; }

  /* ---------- Tabelas largas: rolagem lateral dentro do card ---------- */
  .list-table-container, .historico-table-container, .ass-table-wrap { -webkit-overflow-scrolling: touch; }

  /* ---------- Dialogos: folha que sobe da base ---------- */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    margin: 0;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top));
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: ortusSheetIn var(--duration-base) var(--ease-out);
  }
  .modal-header { position: sticky; top: 0; z-index: 2; background: var(--card); padding: 16px 20px; }
  .modal-body { padding: 20px; }
  .modal-footer { position: sticky; bottom: 0; z-index: 2; background: var(--card); padding: 12px 20px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 auto; justify-content: center; }
  .modal-close { width: 40px; height: 40px; }
  .modal-body > div:has(> .formTabBtn) { flex-wrap: nowrap; scrollbar-width: none; }
  .modal-body > div:has(> .formTabBtn)::-webkit-scrollbar { display: none; }
  .formTabBtn { flex-shrink: 0; white-space: nowrap; }

  /* campos com 16px: o iPhone nao da zoom ao focar */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }

  /* ---------- Botao flutuante ---------- */
  .fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); height: 52px; padding: 0 22px 0 18px; }

  /* ---------- Conversas: lista e conversa em telas separadas ---------- */
  .conv-root { height: calc(100dvh - 56px - env(safe-area-inset-top) - 32px); }
  .conv-top-bar { padding: 14px 14px 12px; gap: 10px; }
  .conv-top-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .conv-top-filters::-webkit-scrollbar { display: none; }
  .conv-top-filters > * { flex-shrink: 0; }
  .conv-layout { flex-direction: column; }
  .conv-sidebar { width: 100%; height: auto; flex: 1; min-height: 0; border-right: none; border-bottom: none; }
  .conv-chat-panel { display: none; }
  .conv-layout.conv-has-chat .conv-sidebar { display: none; }
  .conv-layout.conv-has-chat .conv-chat-panel { display: flex; flex: 1; min-height: 0; }
  .conv-root:has(.conv-has-chat) .conv-top-bar { display: none; }
  .conv-root:has(.conv-has-chat) .conv-layout { border-radius: var(--radius-xl); }
  .conv-back-btn { display: flex; margin-left: -6px; }
  .conv-chat-header { padding: 10px 12px; gap: 8px; }
  .conv-messages { padding: 14px 12px 18px; }
  .conv-bubble { max-width: 85%; }
  .conv-info-panel { position: absolute; inset: 0; width: 100%; z-index: 5; }
  .conv-layout { position: relative; }
}

@keyframes ortusSheetIn {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==================== AVISO DE COOKIES (GA4) ==================== */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface-card);
  color: var(--pine-900);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 10001;
  animation: ortusSheetIn 200ms var(--ease-out);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-text { flex: 1; min-width: 0; }
.cookie-banner-text strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cookie-banner-text p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.cookie-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-banner-actions .btn {
  width: auto;
  padding: 0 18px;
  height: 36px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
}
@media (max-width: 768px) {
  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .cookie-banner-actions .btn { flex: 1; height: 44px; }
}
