
/* DIRETRIZES SAAS SALES DASHBOARD (FIGMA) */
:root {
  --background: #eef4fb; /* Fundo geral claro premium */
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  
  /* Menu Lateral (Dark/Slate theme do Figma) */
  --sidebar-bg: #0f172a; /* Slate 900 */
  --sidebar-fg: #94a3b8; /* Slate 400 */
  --sidebar-active: #38bdf8; /* Azul vivo para destaque */
  --sidebar-active-bg: rgba(56, 189, 248, 0.1);
  --sidebar-hover: #1e293b;
  
  /* Cores de Ação (Primary) */
  --primary: #1d4ed8; /* Azul corporativo refinado */
  --primary-foreground: #ffffff;
  --primary-hover: #163fb0;
  
  /* Acentos */
  --secondary: #f8fafc;
  --secondary-foreground: #334155;
  --accent: #eff6ff; 
  --accent-foreground: #1d4ed8;
  
  /* Status */
  --success: #10b981; 
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --destructive: #ef4444; 
  --destructive-bg: #fef2f2;
  --info: #6366f1;
  --info-bg: #e0e7ff;
  
  /* Estrutura */
  --border: #d8e2ef;
  --input: #d8e2ef;
  --ring: #1d4ed8;
  --muted-foreground: #64748b;
  --radius: 16px; /* Bordas mais redondas (Figma style) */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.18);
  --shadow-md: 0 18px 42px -18px rgba(15, 23, 42, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; overflow-x: clip; }
body { font-family: 'Inter', sans-serif; background: var(--background); color: var(--foreground); line-height: 1.5; -webkit-font-smoothing: antialiased; position: relative; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; background:
  radial-gradient(circle at top left, rgba(29, 78, 216, 0.10), transparent 28%),
  radial-gradient(circle at 80% 20%, rgba(20, 184, 166, 0.09), transparent 24%),
  radial-gradient(circle at bottom right, rgba(99, 102, 241, 0.06), transparent 26%); z-index: 0; }
body.auth-locked { overflow: hidden; }

/* Login / Acesso */
.auth-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; background:
  radial-gradient(circle at top left, rgba(29, 78, 216, 0.22), transparent 30%),
  radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.14), transparent 28%),
  linear-gradient(135deg, #0f172a 0%, #111827 46%, #0b1220 100%); z-index: 9999; }
.auth-shell { width: min(100%, 1080px); display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 24px; align-items: stretch; }
.auth-hero, .auth-card { border-radius: 28px; box-shadow: 0 30px 80px rgba(15, 23, 42, 0.30); }
.auth-hero { padding: 40px; color: #fff; background: linear-gradient(160deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92)); border: 1px solid rgba(255,255,255,0.09); display: flex; flex-direction: column; justify-content: space-between; min-height: 640px; }
.auth-brand { display: flex; width: 100%; justify-content: center; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.72); }
.auth-brand i { color: #38bdf8; width: 18px; height: 18px; }
.auth-wordmark { width: min(100%, 380px); height: auto; display: block; }
.sb-logo { display: block; width: min(100%, 176px); height: auto; opacity: 1; filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.18)); }
.auth-hero h1 { font-size: clamp(34px, 4vw, 56px); line-height: 0.98; letter-spacing: -0.05em; margin-top: 18px; max-width: 18ch; }
.auth-hero p { margin-top: 18px; color: rgba(255,255,255,0.76); font-size: 16px; max-width: 56ch; }
.auth-points { display: grid; gap: 14px; margin-top: 28px; }
.auth-point { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); }
.auth-point i { color: #38bdf8; width: 18px; height: 18px; margin-top: 2px; }
.auth-point strong { display: block; font-size: 14px; }
.auth-point span { display: block; font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.auth-card { background: rgba(255,255,255,0.98); border: 1px solid rgba(148, 163, 184, 0.14); padding: 28px; display: flex; flex-direction: column; justify-content: center; backdrop-filter: blur(14px); }
.auth-card-wrap { position: relative; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,0.92); color: var(--foreground); cursor: pointer; font-size: 13px; font-weight: 700; box-shadow: var(--shadow-sm); transition: all 0.2s ease; }
.theme-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.theme-toggle i { width: 16px; height: 16px; }
.theme-toggle.dark { background: rgba(15, 23, 42, 0.08); color: #0f172a; }
.auth-card h2 { font-size: 28px; letter-spacing: -0.03em; color: var(--foreground); }
.auth-card p { color: var(--muted-foreground); margin-top: 8px; font-size: 14px; }
.auth-form { margin-top: 24px; display: grid; gap: 14px; }
.auth-field label { display: block; font-size: 12px; font-weight: 700; color: var(--foreground); margin-bottom: 8px; }
.auth-field input { width: 100%; padding: 13px 14px; border: 1px solid var(--input); border-radius: 12px; background: #fff; color: var(--foreground); font-size: 14px; outline: none; transition: 0.2s; }
.auth-field input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.auth-pass-wrap { position: relative; }
.auth-pass-wrap input { padding-right: 48px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; letter-spacing: 0.04em; }
.auth-eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--muted-foreground); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: 0.2s; }
.auth-eye:hover { background: var(--secondary); color: var(--foreground); }
.auth-eye i { width: 18px; height: 18px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.auth-check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 13px; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.auth-actions { display: grid; gap: 10px; margin-top: 4px; }
.auth-note { font-size: 12px; color: var(--muted-foreground); line-height: 1.5; }
.auth-reset { background: transparent; border: none; color: var(--primary); font-weight: 600; cursor: pointer; padding: 0; }
.auth-reset:hover { text-decoration: underline; }
.auth-alt { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.auth-alt-text { color: var(--muted-foreground); font-size: 13px; text-align: center; }
.auth-alt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-link-btn { min-height: 42px; border-radius: 12px; border: 1px solid var(--border); background: #fff; color: var(--foreground); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: 0.2s; }
.auth-link-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.auth-link-btn i { width: 16px; height: 16px; }
.auth-link-btn:disabled { opacity: 0.68; cursor: not-allowed; transform: none; box-shadow: none; }
.google-mark { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; }
.google-mark svg { width: 16px; height: 16px; display: block; }
.auth-error { display: none; padding: 12px 14px; border-radius: 12px; background: #fef2f2; color: #991b1b; font-size: 13px; border: 1px solid #fecaca; }
.auth-error.a { display: block; }
.app-hidden { display: none !important; }

@media (max-width: 980px) { .auth-shell { grid-template-columns: 1fr; } .auth-hero { min-height: auto; } }
@media (max-width: 640px) { .auth-hero, .auth-card { padding: 22px; border-radius: 22px; } }

/* Layout Base */
.kw { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.mb { display: none; }

/* Sidebar (Menu Escuro SaaS Figma) */
.sb { width: 264px; background: var(--sidebar-bg); border-right: none; display: flex; flex-direction: column; padding: 28px 18px; position: fixed; height: 100vh; z-index: 50; overflow-y: auto; box-shadow: 4px 0 24px rgba(0,0,0,0.05); }
.sb-b { padding: 0 6px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 20px; }
.sb-b h2 { font-size: 22px; font-weight: 800; color: #ffffff; letter-spacing: -0.03em; display:flex; align-items:center; gap:8px;}
.sb-b h2 i { color: var(--sidebar-active); }
.sb-brand-wrap { display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; padding: 14px 12px 12px; min-height: 64px; border-radius: 18px; background: rgba(255,255,255,0.055); border: 1px solid rgba(255,255,255,0.09); }
.sb-user { display: grid; gap: 12px; padding: 0 6px 18px; margin: 0 0 8px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sb-user-top { min-width: 0; display: grid; gap: 4px; }
.sb-user-label { font-size: 10px; color: rgba(255,255,255,0.56); text-transform: uppercase; font-weight: 800; letter-spacing: 0.1em; line-height: 1.35; white-space: nowrap; }
.sb-user-name { font-size: 15px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; line-height: 1.3; }
.sidebar-actions { display: flex; gap: 10px; align-items: center; justify-content: space-between; width: 100%; }
.sidebar-actions .theme-toggle { width: 44px; height: 44px; padding: 0; flex: 0 0 auto; background: rgba(255,255,255,0.055); border-color: rgba(255,255,255,0.10); color: #fff; box-shadow: none; }
.sidebar-actions .theme-toggle:hover { background: rgba(255,255,255,0.08); }
.sidebar-actions .btn-sm { min-height: 42px; min-width: 76px; padding: 0 16px; border-radius: 12px; }
.sb-b p { font-size: 10px; color: var(--sidebar-fg); text-transform: uppercase; font-weight: 700; letter-spacing: 1.15px;}
.sb-t { font-size: 10px; font-weight: 800; color: rgba(255,255,255,0.28); text-transform: uppercase; padding: 8px 10px; margin-top: 14px; letter-spacing: 1.15px;}
.sb-i { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; font-size: 13px; font-weight: 500; color: var(--sidebar-fg); cursor: pointer; transition: all 0.2s ease; margin-bottom: 4px; }
.sb-i:hover { background: var(--sidebar-hover); color: #ffffff; }
.sb-i.a { background: var(--sidebar-active-bg); color: var(--sidebar-active); font-weight: 600; border-left: 3px solid var(--sidebar-active); border-radius: 4px 12px 12px 4px;}
.sb-i .ic { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; opacity: 0.8;}
.sb-i.a .ic { opacity: 1; }

/* Main Area */
.mn { flex: 1; margin-left: 264px; padding: 32px; max-width: calc(100% - 264px); min-height: 100vh; }
.mh h1 { overflow-wrap: anywhere; min-width: 0; }
.mh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.mh p { font-size: 14px; color: var(--muted-foreground); margin-top: 6px; max-width: 68ch; }


/* Botoes */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); border: none; }
.btn-p { background: var(--primary); color: var(--primary-foreground); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); }
.btn-p:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3); }
.btn-s { background: var(--card); color: var(--foreground); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-s:hover { background: var(--secondary); border-color: #cbd5e1; }
.btn-success { background: var(--success); color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2); }
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 10px; }
.btn-icon { padding: 10px; border-radius: 10px; background: transparent; border: 1px solid transparent; cursor: pointer; color: var(--muted-foreground); transition: all 0.2s; display:flex; align-items:center; justify-content:center; }
.btn-icon:hover { background: var(--secondary); color: var(--foreground); }
.btn-icon.success { color: var(--success); }
.btn-icon.success:hover { background: var(--success-bg); color: #059669; }
.btn-icon.danger { color: var(--destructive); }
.btn-icon.danger:hover { background: var(--destructive-bg); color: #b91c1c; }

/* Containers */
.pn { display: none; opacity: 0; transform: translateY(8px); }
.pn.a { display: block; animation: sectionFade 0.36s ease forwards; }
@keyframes sectionFade { from { opacity: 0; transform: translateY(12px) scale(0.995); } to { opacity: 1; transform: translateY(0) scale(1); } }
.pn.a .cd,
.pn.a .tw,
.pn.a .fechamento-card,
.pn.a .k-card,
.pn.a .note-card,
.pn.a .info-card,
.pn.a .kanban-col,
.pn.a .calc-res { animation: riseIn 0.4s ease both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.cd, .tw, .fechamento-card, .k-card, .note-card, .info-card, .kanban-col, .calc-res, .side-panel, .auth-card, .auth-hero { transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease; }
.cd:hover, .tw:hover, .fechamento-card:hover, .k-card:hover, .note-card:hover, .info-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:hover { transform: translateY(-1px); }
.sb-i:hover { transform: translateX(2px); }

/* Cards & Tabelas */
.tw { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow); }
.commission-tables { display: flex; flex-direction: column; gap: 22px; align-items: stretch; }
.commission-section { width: 100%; }
.commission-table-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 10px; min-height: 32px; }
.commission-table-title h2 { font-size: 17px; line-height: 1.15; letter-spacing: -0.02em; }
.commission-table-title span { font-size: 12px; line-height: 1.25; color: var(--muted-foreground); text-align: right; max-width: 280px; }
.commission-table { table-layout: fixed; }
.commission-table th { padding: 14px 18px; }
.commission-table td { padding: 14px 18px; min-height: 64px; }
.commission-name { display: block; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.commission-inputs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 420px; }
.commission-mini-field { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--secondary); white-space: nowrap; }
.commission-mini-field span { color: var(--muted-foreground); font-size: 11px; font-weight: 800; }
.commission-mini-field input { width: 48px; border: 0; background: transparent; color: var(--foreground); font-size: 13px; font-weight: 800; outline: none; text-align: right; }
.commission-mini-field input::-webkit-outer-spin-button,
.commission-mini-field input::-webkit-inner-spin-button { margin: 0; }
.commission-bonus-editor { display: flex; flex-wrap: wrap; gap: 8px; min-width: 220px; }
.commission-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 78px; }
/* Central rule settings need their own card spacing; unlike tables, they contain form controls. */
.commission-central-config { margin-top: 24px; padding: 20px; overflow: visible; }
.commission-central-config .commission-table-title { align-items: flex-start; margin-bottom: 0; }
.commission-central-config .commission-table-title > div { display: grid; gap: 5px; }
.commission-central-config .commission-table-title span { max-width: 640px; text-align: left; }
.commission-central-config .amil-config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.commission-central-config .amil-config-row { grid-template-columns: 1fr; gap: 8px; padding: 14px; }
.commission-central-config .amil-config-row input { min-height: 44px; }
.amil-config-grid { display: grid; gap: 12px; margin-top: 18px; }
.amil-config-row { display: grid; grid-template-columns: minmax(260px, 1fr) 220px; gap: 16px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--secondary); }
.amil-config-row label { margin: 0; font-size: 13px; font-weight: 800; color: var(--foreground); }
.amil-config-row input { width: 100%; padding: 11px 12px; border: 1px solid var(--input); border-radius: 9px; background: var(--card); color: var(--foreground); font-weight: 800; outline: none; }
.amil-config-row input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.tt { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); gap: 16px; background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.92) 100%); }
.sb2 { position: relative; flex: 1; min-width: 300px; }
.sb2 input { padding: 12px 16px 12px 44px; border: 1px solid var(--input); border-radius: 12px; font-size: 14px; width: 100%; outline: none; transition: all 0.2s; background: #f8fafc; color: var(--foreground); }
.sb2 input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); background: #ffffff;}
.sb2 svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; width: 18px; }
.fs { padding: 12px 16px; border: 1px solid var(--input); border-radius: 12px; font-size: 14px; background: #f8fafc; outline: none; cursor: pointer; transition: all 0.2s; color: var(--foreground); font-weight: 500;}
.fs:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); background:#ffffff;}

table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th { text-align: left; padding: 18px 24px; font-size: 12px; font-weight: 700; color: var(--muted-foreground); border-bottom: 1px solid var(--border); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.5px;}
td { padding: 18px 24px; border-bottom: 1px solid var(--border); color: var(--foreground); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--secondary); }

/* Badges modernos (SaaS style) */
.bdg { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.bdg::before { content: ''; display: block; width: 6px; height: 6px; border-radius: 50%; }
.bd-success { background: var(--success-bg); color: #065f46; }
.bd-success::before { background: var(--success); }
.bd-warning { background: var(--warning-bg); color: #92400e; }
.bd-warning::before { background: var(--warning); }
.bd-danger { background: var(--destructive-bg); color: #991b1b; }
.bd-danger::before { background: var(--destructive); }
.bd-info { background: var(--info-bg); color: #3730a3; }
.bd-info::before { background: var(--info); }
.bd-neutral { background: var(--secondary); color: var(--muted-foreground); }
.bd-neutral::before { background: var(--muted-foreground); }

/* Slide-over Panels (Modais Laterais) */
.panel-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(4px); display: none; z-index: 100; opacity: 0; transition: opacity 0.3s; }
.panel-overlay.a { display: block; opacity: 1; }
.side-panel { position: fixed; top: 0; right: 0; transform: translateX(100%); width: 100%; max-width: 500px; height: 100vh; background: var(--card); box-shadow: -20px 0 40px rgba(0,0,0,0.1); z-index: 101; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s; display: flex; flex-direction: column; border-left: 1px solid var(--border); visibility: hidden; }
.panel-overlay.a + .side-panel { transform: translateX(0); visibility: visible; }
.sp-header { padding: 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: #ffffff; }
.sp-body { padding: 24px; flex: 1; overflow-y: auto; }
.sp-footer { padding: 20px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; background: #fafafa; }

/* Formulários Internos */
.fg { margin-bottom: 20px; }
.fg label { display: block; font-size: 13px; font-weight: 600; color: var(--foreground); margin-bottom: 8px; }
.fg input, .fg select, .fg textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--input); border-radius: 10px; font-size: 14px; outline: none; transition: all 0.2s; background: #f8fafc; color: var(--foreground); }
.fg input:focus, .fg select:focus, .fg textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); background: #ffffff; }
.fr { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Top Dashboard Cards (SaaS Style) */
.cg { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 40px; }
.cd { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.02); display:flex; flex-direction:column; position:relative; overflow:hidden;}
.cd::after { content:''; position:absolute; top:0; right:0; width:120px; height:120px; background:var(--sidebar-active-bg); border-radius:50%; filter:blur(40px); z-index:0; pointer-events:none;}
.cd > * { position:relative; z-index:1; }
.cl { font-size: 14px; font-weight: 600; color: var(--muted-foreground); margin-bottom: 12px; display: flex; justify-content: space-between; align-items:center; }
.cl-icon { width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center; }
.cv { font-size: 32px; font-weight: 800; color: var(--foreground); letter-spacing: -0.03em; margin-bottom: 8px;}
.cd-trend { display:flex; align-items:center; gap:6px; font-size:13px; font-weight:600; }
.trend-up { color:var(--success); }
.trend-text { color:var(--muted-foreground); font-weight:500;}

/* Fechamento Cards */
.fechamento-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; background: var(--card); box-shadow: var(--shadow); }
.fc-header { background: #ffffff; padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.fc-header h3 { font-size: 18px; font-weight: 800; color: var(--foreground); display: flex; align-items: center; gap: 10px; }
.fc-header h3 i { color: var(--primary); }
.fc-summary { display: flex; gap: 32px; }
.fc-stat { text-align: right; }
.fc-stat span { display: block; font-size: 12px; text-transform: uppercase; color: var(--muted-foreground); font-weight: 700; letter-spacing: 0.5px;}
.fc-stat strong { font-size: 18px; color: var(--foreground); font-weight: 800;}
.fc-stat .highlight { color: var(--success); }
.future-gains-card { margin-top: 28px; border-style: dashed; }
.future-gains-card .fc-header { align-items: flex-start; gap: 16px; }
.future-gains-title { display: grid; gap: 4px; }
.future-gains-title p { font-size: 12px; color: var(--muted-foreground); margin: 0; font-weight: 500; }
.future-gains-card.collapsed .future-gains-body { display: none; }
.future-gains-toggle { white-space: nowrap; }
.future-gains-body { display: grid; gap: 16px; padding: 16px; }
.future-gains-month { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); }
.future-gains-month-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--secondary); border-bottom: 1px solid var(--border); }
.future-gains-month-header h4 { margin: 0; font-size: 14px; text-transform: capitalize; }
.future-gains-month-header strong { color: var(--primary); font-size: 15px; }

/* Theme: Dark */
body[data-theme="dark"] {
  --background: #08101d;
  --foreground: #eef4ff;
  --card: #0f172a;
  --card-foreground: #eef4ff;
  --sidebar-bg: #020617;
  --sidebar-fg: #93a4bb;
  --sidebar-active-bg: rgba(34, 211, 238, 0.16);
  --sidebar-hover: #0f172a;
  --primary: #22d3ee;
  --primary-hover: #06b6d4;
  --secondary: #0b1220;
  --secondary-foreground: #d4deeb;
  --accent: #111827;
  --accent-foreground: #7dd3fc;
  --border: #243244;
  --input: #334155;
  --ring: #22d3ee;
  --muted-foreground: #8fa3bd;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.35);
  --shadow: 0 18px 40px -18px rgba(0,0,0,0.58);
  --shadow-md: 0 22px 54px -18px rgba(0,0,0,0.68);
}
body[data-theme="dark"]::before { background:
  radial-gradient(circle at top left, rgba(34, 211, 238, 0.09), transparent 28%),
  radial-gradient(circle at 78% 18%, rgba(20, 184, 166, 0.08), transparent 24%),
  radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.08), transparent 26%); }
body[data-theme="dark"] .auth-screen { background:
  radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 30%),
  radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.10), transparent 28%),
  linear-gradient(135deg, #020617 0%, #0b1220 46%, #111827 100%); }
body[data-theme="dark"] .auth-card { background: rgba(15, 23, 42, 0.94); color: #eef4ff; border-color: rgba(255,255,255,0.10); }
body[data-theme="dark"] .auth-card h2 { color: #f8fafc; }
body[data-theme="dark"] .auth-card p, body[data-theme="dark"] .auth-note, body[data-theme="dark"] .auth-check { color: #94a3b8; }
body[data-theme="dark"] .auth-field label { color: #e5eefb; }
body[data-theme="dark"] .auth-field input { background: #08101d; color: #eef4ff; border-color: #2b3a4d; }
body[data-theme="dark"] .auth-field input::placeholder { color: #64748b; }
body[data-theme="dark"] .auth-card .theme-toggle { background: rgba(255,255,255,0.05); color: #eef4ff; border-color: rgba(255,255,255,0.08); }
body[data-theme="dark"] .auth-card .theme-toggle.dark { background: rgba(34, 211, 238, 0.16); color: #67e8f9; }
body[data-theme="dark"] .tw, body[data-theme="dark"] .cd, body[data-theme="dark"] .fechamento-card, body[data-theme="dark"] .side-panel { background: #0f172a; border-color: #243244; }
body[data-theme="dark"] .tt, body[data-theme="dark"] .sp-header, body[data-theme="dark"] .sp-footer, body[data-theme="dark"] .fc-header, body[data-theme="dark"] .table-head, body[data-theme="dark"] .calc-res { background: #0b1220; border-color: #243244; }
body[data-theme="dark"] .mn, body[data-theme="dark"] .mh h1, body[data-theme="dark"] .cv, body[data-theme="dark"] .fc-header h3, body[data-theme="dark"] .auth-card h2, body[data-theme="dark"] .auth-hero h1 { color: #f8fbff; }
body[data-theme="dark"] .mh p, body[data-theme="dark"] .trend-text, body[data-theme="dark"] .cl, body[data-theme="dark"] .note-date, body[data-theme="dark"] .sb2 svg { color: #8fa3bd; }
body[data-theme="dark"] .sb2 input, body[data-theme="dark"] .fs, body[data-theme="dark"] .fg input, body[data-theme="dark"] .fg select, body[data-theme="dark"] .fg textarea, body[data-theme="dark"] .note-lead select { background: #08101d; color: #eef4ff; border-color: #2b3a4d; }
body[data-theme="dark"] .sb2 input:focus, body[data-theme="dark"] .fs:focus, body[data-theme="dark"] .fg input:focus, body[data-theme="dark"] .fg select:focus, body[data-theme="dark"] .fg textarea:focus { background: #0b1220; }
body[data-theme="dark"] .btn-s { background: #08101d; color: #eef4ff; border-color: #2b3a4d; }
body[data-theme="dark"] .btn-icon:hover { background: #0b1220; color: #f8fafc; }
body[data-theme="dark"] .commission-mini-field { background: #08101d; border-color: #2b3a4d; }
body[data-theme="dark"] .commission-mini-field input { color: #eef4ff; }
body[data-theme="dark"] .amil-config-row { background: #08101d; border-color: #2b3a4d; }
body[data-theme="dark"] .amil-config-row input { background: #0b1220; color: #eef4ff; border-color: #2b3a4d; }
body[data-theme="dark"] tr:hover td { background: rgba(148,163,184,0.06); }
body[data-theme="dark"] .auth-point, body[data-theme="dark"] .auth-stat { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.08); }
body.auth-locked[data-theme="dark"] .auth-screen { background:
  radial-gradient(circle at top left, rgba(29, 78, 216, 0.22), transparent 30%),
  radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.14), transparent 28%),
  linear-gradient(135deg, #0f172a 0%, #111827 46%, #0b1220 100%); }
body.auth-locked[data-theme="dark"] .auth-card { background: rgba(15, 23, 42, 0.94); color: #eef4ff; border-color: rgba(255,255,255,0.10); }
body.auth-locked[data-theme="dark"] .auth-card h2, body.auth-locked[data-theme="dark"] .auth-field label { color: #f8fafc; }
body.auth-locked[data-theme="dark"] .auth-card p, body.auth-locked[data-theme="dark"] .auth-note, body.auth-locked[data-theme="dark"] .auth-check, body.auth-locked[data-theme="dark"] .auth-alt-text { color: #94a3b8; }
body.auth-locked[data-theme="dark"] .auth-field input, body.auth-locked[data-theme="dark"] .auth-link-btn { background: #08101d; color: #eef4ff; border-color: #2b3a4d; }
body.auth-locked[data-theme="dark"] .auth-field input::placeholder { color: #64748b; }
body.auth-locked[data-theme="dark"] .auth-link-btn:hover { border-color: #22d3ee; color: #67e8f9; }
body[data-theme="dark"] .note-card { border-color: rgba(15,23,42,0.12); }
body[data-theme="dark"] .note-card textarea { color: #0f172a; }
body[data-theme="dark"] .note-card textarea::placeholder { color: #64748b; }
body[data-theme="dark"] .note-card .note-date { color: #475569; }
body[data-theme="dark"] .note-card .note-del { color: #0f172a; }
body[data-theme="dark"] .note-card .note-footer { border-top-color: rgba(15,23,42,0.12); }
body[data-theme="dark"] .note-card .note-lead select { background: rgba(255,255,255,0.78); color: #0f172a; border-color: rgba(15,23,42,0.18); }

/* Toggle Checkboxes (Modernos) */
.toggle-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; font-weight: 600; cursor: pointer; background: #ffffff; color: var(--muted-foreground); transition: all 0.2s; }
.toggle-btn:hover { background: var(--secondary); border-color: #cbd5e1; }
.toggle-btn.active-client { background: var(--success-bg); color: #065f46; border-color: var(--success); }
.toggle-btn.active-broker { background: var(--info-bg); color: #3730a3; border-color: var(--info); }
.cg { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin-bottom: 28px; }
.cd { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--border); display:flex; flex-direction:column; position:relative; overflow:hidden; }
.cd::after { content:''; position:absolute; top:0; right:0; width:96px; height:96px; background:var(--sidebar-active-bg); border-radius:50%; filter:blur(36px); z-index:0; pointer-events:none; opacity:0.7; }
.cd > * { position:relative; z-index:1; }
.cl { font-size: 13px; font-weight: 600; color: var(--muted-foreground); margin-bottom: 10px; display: flex; justify-content: space-between; align-items:center; }
.cv { font-size: 30px; font-weight: 800; color: var(--foreground); letter-spacing: -0.03em; margin-bottom: 6px; }
.cd-trend { display:flex; align-items:center; gap:6px; font-size:12px; font-weight:600; }
.trend-up { color:var(--success); }
.trend-text { color:var(--muted-foreground); font-weight:500; }
.dash-chart { padding: 18px 20px !important; height: 300px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.96) 100%); }
.dash-chart h3 { font-size: 14px !important; margin-bottom: 12px !important; color: var(--foreground); letter-spacing: -0.01em; }
.dash-chart canvas { opacity: 0.98; }
.dashboard-filter { display: flex; align-items: flex-end; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-sm); }
.dashboard-filter label { display: grid; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .04em; }
.dashboard-filter input, .dashboard-filter select { min-width: 180px; padding: 11px 12px; border: 1px solid var(--input); border-radius: 12px; background: var(--card); color: var(--foreground); font-size: 14px; font-weight: 700; outline: none; }
.dashboard-filter input:focus, .dashboard-filter select:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.dashboard-status-panel { margin-top: 22px; padding: 20px; }
.dashboard-status-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:16px; }
.dashboard-status-header h3 { margin:0; font-size:16px; }
.dashboard-status-header p { margin:6px 0 0; color:var(--muted-foreground); font-size:13px; }
.dashboard-status-header strong { white-space:nowrap; color:var(--primary); }
.dashboard-status-totals { display:grid; justify-items:end; gap:5px; }
.dashboard-status-totals strong:last-child { color:var(--foreground); font-size:13px; }
.dashboard-status-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.dashboard-status-item { border:1px solid var(--border); border-radius:12px; padding:14px; background:color-mix(in srgb,var(--card) 92%,var(--primary)); }
.dashboard-status-item > div { display:flex; justify-content:space-between; gap:10px; align-items:baseline; }
.dashboard-status-item strong { font-size:13px; }
.dashboard-status-item span { color:var(--muted-foreground); font-size:12px; white-space:nowrap; }
.dashboard-status-item p, .dashboard-status-empty { margin:8px 0 0; color:var(--muted-foreground); font-size:13px; line-height:1.45; }

/* Kanban Drag & Drop */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 24px; min-height: calc(100vh - 200px); align-items: flex-start; scroll-behavior: smooth; }
.kanban-col { background: var(--secondary); border-radius: var(--radius); width: 280px; min-width: 280px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); border: 2px dashed transparent; transition: border-color 0.2s; }
.kanban-col.drag-over { border-color: var(--primary); background: #e6f4f1; }
.kc-header { padding: 14px 16px; font-weight: 700; font-size: 13px; color: var(--foreground); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.kc-count { background: var(--border); padding: 2px 8px; border-radius: 999px; font-size: 11px; color: var(--muted-foreground); }
.kc-body { padding: 12px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; min-height: 150px; }
.k-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 14px; cursor: grab; box-shadow: var(--shadow-sm); transition: transform 0.1s, box-shadow 0.2s; }
.k-card:active { cursor: grabbing; transform: scale(0.98); box-shadow: var(--shadow-md); }
.k-card:hover { border-color: var(--primary); }
.k-card h4 { font-size: 14px; font-weight: 700; color: var(--foreground); margin-bottom: 4px; }
.k-card p { font-size: 12px; color: var(--muted-foreground); display: flex; align-items: center; gap: 4px; }
.k-card .k-val { font-size: 13px; font-weight: 600; color: var(--primary); margin-top: 8px; }
.k-card .k-actions { display: flex; justify-content: flex-end; gap: 4px; border-top: 1px dashed var(--border); padding-top: 8px; margin-top: 10px; }

/* Outros Componentes */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.note-card { border-radius: 8px; padding: 16px; box-shadow: var(--shadow-sm); position: relative; border: 1px solid rgba(15,23,42,0.12); display: flex; flex-direction: column; color: #0f172a; }
.note-card textarea { width: 100%; border: none; background: transparent; resize: none; outline: none; font-family: 'Inter', sans-serif; font-size: 14px; color: #0f172a; min-height: 100px; margin-top: 12px; }
.note-card textarea::placeholder { color: #64748b; }
.note-date { font-size: 10px; color: #475569; margin-top: 8px; }
.note-del { position: absolute; top: 8px; right: 8px; background: transparent; border: none; cursor: pointer; color: #0f172a; opacity: 0.4; }
.note-del:hover { opacity: 1; }
.note-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(15,23,42,0.12); padding-top: 10px; margin-top: 10px; gap: 8px;}
.note-colors { display: flex; gap: 6px; }
.n-col { width: 16px; height: 16px; border-radius: 50%; cursor: pointer; border: 1px solid rgba(0,0,0,0.2); transition: transform 0.2s; }
.n-col:hover { transform: scale(1.2); }
.note-lead select { width: 100%; padding: 6px 8px; border-radius: 6px; border: 1px solid rgba(15,23,42,0.18); background: rgba(255,255,255,0.78); font-size: 12px; outline: none; color: #0f172a; cursor: pointer; }

.calc-res { margin-top: 24px; background: var(--secondary); padding: 20px; border-radius: 8px; border: 1px solid var(--border); display: none; }
.calc-res.a { display: block; }
.calc-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.calc-row:last-child { border-bottom: none; font-weight: 700; color: var(--primary); font-size: 16px; padding-top: 12px; margin-top: 8px; border-top: 2px solid var(--border); }
.calculadora-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; max-width: 1240px; }
.calculadora-card { padding: 24px; }
.angariacao-card { border-color: rgba(34,211,238,0.28); }
.calc-section-heading { margin-bottom: 20px; }
.calc-section-heading h2 { font-size: 18px; letter-spacing: -0.02em; margin-bottom: 6px; }
.calc-section-heading p, .angariacao-note { color: var(--muted-foreground); font-size: 13px; line-height: 1.45; }
.angariacao-note { margin-top: 14px; }
@media (max-width: 860px) { .calculadora-grid { grid-template-columns: 1fr; } }

.fechamento-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; background: var(--card); box-shadow: var(--shadow); }
.fc-header { background: linear-gradient(180deg, #ffffff 0%, rgba(248,250,252,0.95) 100%); padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.fc-header h3 { font-size: 16px; font-weight: 700; color: var(--foreground); display: flex; align-items: center; gap: 8px; }
.fc-summary { display: flex; gap: 20px; }
.fc-stat { text-align: right; }
.fc-stat span { display: block; font-size: 11px; text-transform: uppercase; color: var(--muted-foreground); font-weight: 600; }
.fc-stat strong { font-size: 15px; color: var(--primary); }
.fechamentos-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fechamentos-month-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-sm); }
.fechamentos-month-summary h3 { grid-column: 1 / -1; font-size: 16px; color: var(--foreground); }
.fechamentos-month-summary p { grid-column: 1 / -1; margin-top: -10px; color: var(--muted-foreground); font-size: 13px; }
.fechamentos-month-stat { padding: 16px; border-radius: 12px; background: var(--secondary); border: 1px solid var(--border); }
.fechamentos-month-stat span { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted-foreground); }
.fechamentos-month-stat strong { display: block; margin-top: 6px; font-size: 24px; color: var(--foreground); }
.fechamentos-month-stat.received strong { color: var(--success); }
.toggle-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); font-size: 12px; font-weight: 600; cursor: pointer; background: var(--card); color: var(--muted-foreground); transition: all 0.2s; }
.toggle-btn.active-client { background: #dcfce7; color: #166534; border-color: #166534; }
.toggle-btn.active-broker { background: #e0e7ff; color: #3730a3; border-color: #3730a3; }

@media(max-width:768px){
  body { background: #f7fbff; }
  body.auth-locked { overflow: hidden; }
  .auth-screen { align-items: flex-start; padding: 14px; }
  .auth-shell { width: 100%; gap: 14px; }
  .auth-hero { display: none; }
  .auth-card { min-height: calc(100svh - 28px); justify-content: center; padding: 22px 18px; border-radius: 20px; }
  .auth-card h2 { font-size: clamp(24px, 8vw, 30px); }
  .auth-card p, .auth-note { font-size: 13px; }
  .auth-row { align-items: flex-start; }
  .auth-check { line-height: 1.35; }
  .auth-alt-actions { grid-template-columns: 1fr; }
  .theme-toggle { min-height: 42px; }
  .fechamentos-actions { width: 100%; }
  .fechamentos-actions .btn { flex: 1 1 180px; justify-content: center; }
  .fechamentos-month-summary { grid-template-columns: 1fr; }
  .fechamentos-month-summary h3, .fechamentos-month-summary p { grid-column: auto; }
  .dashboard-filter { width: 100%; align-items: stretch; }
  .dashboard-filter input, .dashboard-filter select { width: 100%; min-width: 0; }
  .dashboard-status-header { flex-direction:column; }
  .dashboard-status-totals { justify-items:start; }
  .dashboard-status-list { grid-template-columns:1fr; }

  .sb{display:none;}
  .kw { display:block; min-height:100svh; padding-top: 132px; }
  .mb {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 60;
    display: block;
    padding: 12px 14px 10px;
    background: rgba(248, 250, 252, 0.94);
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(16px);
  }
  .mb-top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
  .mb-brand { display:flex; align-items:center; gap:10px; min-width:0; }
  .mb-logo { width: 132px; max-width: 46vw; height:auto; display:block; }
  .mb-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
  .mb-actions .theme-toggle { width:42px; height:42px; padding:0; border-radius:14px; }
  .mb-actions .theme-toggle span { display:none; }
  .mb-nav {
    display:flex;
    gap:8px;
    margin-top:12px;
    padding-bottom:2px;
    overflow-x:auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .mb-nav::-webkit-scrollbar { display:none; }
  .mb-i {
    appearance:none;
    border:1px solid rgba(148, 163, 184, 0.32);
    background:#fff;
    color:#334155;
    border-radius:999px;
    min-height:38px;
    padding:0 13px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    white-space:nowrap;
    font-size:12px;
    font-weight:700;
    box-shadow: var(--shadow-sm);
  }
  .mb-i i { width:15px; height:15px; }
  .mb-i.a { background:var(--primary); color:#fff; border-color:var(--primary); }

  .mn{margin-left:0;max-width:100%;padding:16px 14px 28px;}
  .mh { display:grid; grid-template-columns:1fr; margin-bottom:18px; gap:12px; }
  .mh h1 { font-size: clamp(24px, 8vw, 32px); letter-spacing:-0.04em; line-height:1.05; }
  .mh p { font-size:13px; max-width:100%; }
  .mh .btn, .tt .btn, .fc-header .btn, .sp-footer .btn { width:100%; }
  .btn { min-height:44px; padding:11px 15px; }
  .btn-sm { min-height:40px; }
  .fr{grid-template-columns:1fr;}
  .cg{grid-template-columns:1fr; gap:14px; margin-bottom:20px;}
  .cd { padding:18px; border-radius:14px; }
  .cv { font-size: clamp(24px, 9vw, 30px); }
  .tt{flex-direction:column;align-items:stretch;padding:14px;}
  .tt > div[style*="display:flex"] { flex-direction:column; gap:10px !important; }
  .sb2{min-width:0;}
  .fs { width:100%; min-height:44px; }
  .dash-chart{padding:16px !important;height:auto;min-height:280px;}
  .tw { border-radius:14px; }
  .tw { overflow-x:auto; }
  .tw table { min-width:900px; }
  .commission-section > .tw::before { content: 'Deslize a tabela para ver bônus e ações →'; display: block; position: sticky; left: 0; width: max-content; max-width: 100%; padding: 8px 16px; color: var(--muted-foreground); font-size: 12px; font-weight: 600; }
  .commission-section > .tw { scrollbar-width: thin; }
  .commission-tables { gap: 18px; }
  .commission-inputs { min-width: 380px; }
  .commission-central-config { margin-top: 18px; padding: 16px; }
  .commission-central-config .commission-table-title { gap: 12px; }
  .commission-central-config .commission-table-title .btn { width: auto; }
  .commission-central-config .amil-config-grid { grid-template-columns: 1fr; }
  .amil-config-row { grid-template-columns: 1fr; gap: 8px; }
  th, td { padding:14px 16px; }
  .kanban-board { gap:12px; min-height:auto; padding-bottom:18px; scroll-snap-type:x proximity; }
  .kanban-col { width:82vw; min-width:82vw; max-height:none; scroll-snap-align:start; }
  .notes-grid { grid-template-columns:1fr; }
  .info-carousel { gap:14px; }
  .info-card { min-width:82vw; padding:18px; }
  .fc-header { display:grid; grid-template-columns:1fr; gap:14px; padding:16px; }
  .fc-summary { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
  .fc-stat { text-align:left; background:var(--secondary); border-radius:12px; padding:10px; }
  .side-panel { max-width:none; width:100vw; border-left:0; }
  .sp-header, .sp-body, .sp-footer { padding:18px 16px; }
  .sp-footer { display:grid; grid-template-columns:1fr; }
}

@media(max-width:420px){
  .kw { padding-top: 126px; }
  .mb { padding-inline: 10px; }
  .mb-logo { width: 116px; }
  .mb-i { padding-inline: 11px; font-size:11px; }
  .mn { padding-inline:10px; }
  .auth-card { min-height: calc(100svh - 20px); }
  .auth-row { gap:10px; }
  .fc-summary { grid-template-columns:1fr; }
  .kanban-col, .info-card { width:88vw; min-width:88vw; }
}

body[data-theme="dark"] .mb { background: rgba(8, 16, 29, 0.94); border-bottom-color:#243244; }
body[data-theme="dark"] .mb-i { background:#0f172a; color:#d4deeb; border-color:#243244; }
body[data-theme="dark"] .mb-i.a { background:var(--primary); color:#04111a; border-color:var(--primary); }
/* Cards de apoio das operadoras */
.info-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.info-card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.info-card input.info-title { width:100%; font-size:16px; color:var(--foreground); font-weight:800; letter-spacing:-0.02em; border:none; background:transparent; outline:none; padding:0; margin-bottom:4px; }
.info-card input.info-segment { width:100%; font-size:12px; color:var(--muted-foreground); font-weight:600; border:none; background:transparent; outline:none; padding:0; }
.info-card textarea { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 14px; font-size: 13px; resize: vertical; min-height: 128px; background: #f8fafc; color: #0f172a; transition: border-color 0.2s; line-height: 1.5; font-family: 'Inter', sans-serif;}
.info-card textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); background: #ffffff; color: #0f172a; }
.info-attachments { display: grid; gap: 8px; }
.info-attachment-list { display: grid; gap: 8px; }
.info-attachment { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border:1px solid var(--border); border-radius:12px; background:var(--secondary); }
.info-attachment button { border:0; background:transparent; color:var(--primary); font-weight:800; cursor:pointer; text-align:left; }
.info-file-input { font-size: 12px; color: var(--muted-foreground); }
body[data-theme="dark"] .info-card textarea { background: #f8fafc; color: #0f172a; border-color: #38bdf8; }
body[data-theme="dark"] .info-card textarea:focus { background: #ffffff; color: #0f172a; }



/* ===== KIVORA DESIGN POLISH 2026-08-21 ===== */
:root {
  --surface-glass: rgba(255,255,255,0.82);
  --surface-soft: #f8fbff;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 22px 65px -28px rgba(15, 23, 42, 0.35);
  --shadow-focus: 0 0 0 4px rgba(29, 78, 216, 0.14);
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(29, 78, 216, 0.12), transparent 28%),
    radial-gradient(circle at 86% 14%, rgba(20, 184, 166, 0.12), transparent 24%),
    linear-gradient(180deg, #f4f8ff 0%, #eaf2fb 100%);
}

.auth-screen {
  background:
    radial-gradient(circle at 14% 10%, rgba(56, 189, 248, 0.24), transparent 28%),
    radial-gradient(circle at 88% 80%, rgba(16, 185, 129, 0.18), transparent 30%),
    linear-gradient(135deg, #07111f 0%, #0f172a 48%, #101d33 100%);
}
.auth-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(15,23,42,0.96), rgba(30,41,59,0.90)),
    radial-gradient(circle at 20% 18%, rgba(56,189,248,0.20), transparent 30%);
  box-shadow: 0 34px 90px -34px rgba(0,0,0,0.62);
}
.auth-hero::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  right: -110px;
  bottom: -90px;
  border-radius: 999px;
  background: rgba(56,189,248,0.16);
  filter: blur(18px);
  pointer-events: none;
}
.auth-card {
  background: rgba(255,255,255,0.94);
  box-shadow: 0 28px 80px -36px rgba(15,23,42,0.55), inset 0 1px 0 rgba(255,255,255,0.92);
  border-color: rgba(148, 163, 184, 0.24);
}
.auth-field input,
.fg input, .fg select, .fg textarea,
.sb2 input, .fs,
.dashboard-filter input,
.amil-config-row input,
.info-card textarea,
.note-lead select {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd8e8;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,0.82);
}
.auth-field input::placeholder,
.fg input::placeholder,
.fg textarea::placeholder,
.sb2 input::placeholder,
.info-card textarea::placeholder {
  color: #7c8da3;
}
.auth-field input:focus,
.fg input:focus, .fg select:focus, .fg textarea:focus,
.sb2 input:focus, .fs:focus,
.dashboard-filter input:focus,
.amil-config-row input:focus,
.info-card textarea:focus,
.note-lead select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus), var(--shadow-xs);
  background: #ffffff;
}

.btn, .auth-link-btn, .toggle-btn, .mb-i {
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}
.btn-p {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 52%, #1554c7 100%);
  box-shadow: 0 16px 34px -18px rgba(29,78,216,0.72);
}
.btn-p:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 20px 42px -18px rgba(29,78,216,0.82);
}
.btn-s, .auth-link-btn, .toggle-btn {
  box-shadow: var(--shadow-xs);
}
.btn-s:hover, .auth-link-btn:hover, .toggle-btn:hover {
  box-shadow: 0 14px 30px -22px rgba(15,23,42,0.48);
}

.tw, .cd, .fechamento-card, .k-card, .note-card, .info-card, .side-panel, .calc-res, .dashboard-filter, .fechamentos-month-summary {
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 18px 48px -34px rgba(15,23,42,0.42), inset 0 1px 0 rgba(255,255,255,0.76);
}
.cd, .tw, .fechamento-card, .info-card, .dashboard-filter, .fechamentos-month-summary {
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.96) 100%);
}
.cd:hover, .tw:hover, .fechamento-card:hover, .k-card:hover, .info-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.84);
}
.cd::after {
  opacity: .95;
  background: radial-gradient(circle, rgba(56,189,248,0.18), transparent 68%);
}
.cl-icon {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 12px 28px -18px rgba(15,23,42,.45);
}
.tt, .fc-header, .sp-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.94));
}
.sp-footer {
  background: linear-gradient(180deg, rgba(248,250,252,0.96), rgba(241,245,249,0.98));
}
th {
  background: rgba(248,250,252,0.78);
  color: #526174;
}
td { color: #172033; }
tr:hover td { background: rgba(239,246,255,0.72); }

.sb {
  background:
    radial-gradient(circle at 30% 0%, rgba(56,189,248,0.12), transparent 28%),
    linear-gradient(180deg, #0b1220 0%, #0f172a 58%, #07111f 100%);
  box-shadow: 12px 0 38px -30px rgba(2,6,23,0.72);
}
.sb-brand-wrap, .sb-user {
  background: rgba(255,255,255,0.055);
  border-radius: 18px;
}
.sb-i { position: relative; }
.sb-i.a {
  background: linear-gradient(90deg, rgba(56,189,248,0.18), rgba(56,189,248,0.06));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.sb-i.a::after {
  content: '';
  position: absolute;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: .72;
}

.kanban-col {
  background: rgba(241,245,249,0.78);
  border: 1px solid rgba(203,213,225,0.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}
.k-card {
  border-radius: 14px;
  background: #ffffff;
}
.k-card:hover {
  transform: translateY(-2px);
}
.note-card {
  border-radius: 16px;
  box-shadow: 0 16px 38px -28px rgba(15,23,42,.45);
}
.info-card input.info-title,
.info-card input.info-segment {
  color: #0f172a;
}
.info-attachment {
  background: #f8fafc;
  color: #0f172a;
}

body[data-theme="dark"] {
  --surface-glass: rgba(15,23,42,0.78);
  --surface-soft: #0b1220;
  --shadow-focus: 0 0 0 4px rgba(34, 211, 238, 0.18);
  background:
    radial-gradient(circle at 12% 8%, rgba(34, 211, 238, 0.10), transparent 28%),
    radial-gradient(circle at 86% 14%, rgba(20, 184, 166, 0.09), transparent 24%),
    linear-gradient(180deg, #06101d 0%, #08101d 100%);
}
body[data-theme="dark"] .auth-card,
body[data-theme="dark"] .tw,
body[data-theme="dark"] .cd,
body[data-theme="dark"] .fechamento-card,
body[data-theme="dark"] .side-panel,
body[data-theme="dark"] .dashboard-filter,
body[data-theme="dark"] .fechamentos-month-summary,
body[data-theme="dark"] .info-card {
  background: linear-gradient(180deg, rgba(15,23,42,0.98), rgba(11,18,32,0.96));
  color: #eef4ff;
  border-color: rgba(71,85,105,0.72);
  box-shadow: 0 22px 60px -36px rgba(0,0,0,0.82), inset 0 1px 0 rgba(255,255,255,0.045);
}
body[data-theme="dark"] .auth-hero {
  background:
    linear-gradient(145deg, rgba(2,6,23,0.96), rgba(15,23,42,0.92)),
    radial-gradient(circle at 16% 12%, rgba(34,211,238,0.18), transparent 28%);
}
body[data-theme="dark"] .tt,
body[data-theme="dark"] .sp-header,
body[data-theme="dark"] .sp-footer,
body[data-theme="dark"] .fc-header,
body[data-theme="dark"] .future-gains-month-header,
body[data-theme="dark"] th {
  background: linear-gradient(180deg, #111c2e 0%, #0b1220 100%);
  color: #e5eefb;
  border-color: #243244;
}
body[data-theme="dark"] td,
body[data-theme="dark"] .fg label,
body[data-theme="dark"] .amil-config-row label,
body[data-theme="dark"] .k-card h4,
body[data-theme="dark"] .info-card input.info-title,
body[data-theme="dark"] .commission-name,
body[data-theme="dark"] .fechamentos-month-summary h3,
body[data-theme="dark"] .calc-section-heading h2 {
  color: #eef4ff;
}
body[data-theme="dark"] .auth-field input,
body[data-theme="dark"] .fg input,
body[data-theme="dark"] .fg select,
body[data-theme="dark"] .fg textarea,
body[data-theme="dark"] .sb2 input,
body[data-theme="dark"] .fs,
body[data-theme="dark"] .dashboard-filter input,
body[data-theme="dark"] .amil-config-row input,
body[data-theme="dark"] .note-lead select,
body[data-theme="dark"] .commission-mini-field input {
  background: #07111f;
  color: #f8fbff;
  border-color: #334155;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
body[data-theme="dark"] .auth-field input::placeholder,
body[data-theme="dark"] .fg input::placeholder,
body[data-theme="dark"] .fg textarea::placeholder,
body[data-theme="dark"] .sb2 input::placeholder {
  color: #8fa3bd;
}
body[data-theme="dark"] .auth-field input:focus,
body[data-theme="dark"] .fg input:focus,
body[data-theme="dark"] .fg select:focus,
body[data-theme="dark"] .fg textarea:focus,
body[data-theme="dark"] .sb2 input:focus,
body[data-theme="dark"] .fs:focus,
body[data-theme="dark"] .dashboard-filter input:focus,
body[data-theme="dark"] .amil-config-row input:focus {
  background: #0b1526;
  border-color: #22d3ee;
  box-shadow: var(--shadow-focus);
}
body[data-theme="dark"] .btn-s,
body[data-theme="dark"] .auth-link-btn,
body[data-theme="dark"] .toggle-btn {
  background: #08101d;
  color: #eef4ff;
  border-color: #334155;
}
body[data-theme="dark"] .btn-s:hover,
body[data-theme="dark"] .auth-link-btn:hover,
body[data-theme="dark"] .toggle-btn:hover {
  background: #0b1526;
  color: #67e8f9;
  border-color: #22d3ee;
}
body[data-theme="dark"] .btn-p {
  background: linear-gradient(135deg, #0891b2 0%, #06b6d4 56%, #22d3ee 100%);
  color: #03121a;
}
body[data-theme="dark"] .dash-chart {
  background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
  border-color: #243244;
}
body[data-theme="dark"] .kanban-col,
body[data-theme="dark"] .calc-res,
body[data-theme="dark"] .commission-mini-field,
body[data-theme="dark"] .amil-config-row,
body[data-theme="dark"] .fechamentos-month-stat,
body[data-theme="dark"] .future-gains-month,
body[data-theme="dark"] .info-attachment {
  background: #08101d;
  color: #eef4ff;
  border-color: #243244;
}
body[data-theme="dark"] .k-card {
  background: #0b1220;
  border-color: #243244;
}
body[data-theme="dark"] tr:hover td { background: rgba(34,211,238,0.075); }
body[data-theme="dark"] .bd-neutral { background: #111c2e; color: #cbd5e1; }
body[data-theme="dark"] .bd-success { background: rgba(16,185,129,.16); color: #86efac; }
body[data-theme="dark"] .bd-warning { background: rgba(245,158,11,.16); color: #fcd34d; }
body[data-theme="dark"] .bd-danger { background: rgba(239,68,68,.16); color: #fca5a5; }
body[data-theme="dark"] .bd-info { background: rgba(99,102,241,.20); color: #c4b5fd; }
body[data-theme="dark"] .toggle-btn.active-client { background: rgba(16,185,129,.18); color: #86efac; border-color: #10b981; }
body[data-theme="dark"] .toggle-btn.active-broker { background: rgba(99,102,241,.22); color: #c4b5fd; border-color: #818cf8; }
body[data-theme="dark"] .note-card {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  color: #0f172a;
  border-color: rgba(146,64,14,.22);
}
body[data-theme="dark"] .note-card textarea,
body[data-theme="dark"] .note-card .note-del,
body[data-theme="dark"] .note-card .note-lead select { color: #0f172a; }
body[data-theme="dark"] .info-card textarea {
  background: #07111f;
  color: #f8fbff;
  border-color: #334155;
}
body[data-theme="dark"] .info-card textarea:focus { background: #0b1526; color: #f8fbff; }
body[data-theme="dark"] [style*="background: #fafafa"],
body[data-theme="dark"] [style*="background:#fafafa"],
body[data-theme="dark"] [style*="background: #ffffff"],
body[data-theme="dark"] [style*="background:#ffffff"] {
  background: #0b1220 !important;
  color: #eef4ff !important;
  border-color: #243244 !important;
}
body[data-theme="dark"] [style*="color:var(--foreground)"],
body[data-theme="dark"] [style*="color: var(--foreground)"] {
  color: #eef4ff !important;
}
body[data-theme="dark"] input:-webkit-autofill,
body[data-theme="dark"] input:-webkit-autofill:hover,
body[data-theme="dark"] input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f8fbff;
  box-shadow: 0 0 0 1000px #07111f inset;
  border-color: #334155;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* ===== KIVORA LAYOUT POLISH 2026-08-22 ===== */
/* Ajustes de alinhamento/espacamento: sidebar, botoes, tabelas e acoes */
.sb { width: 276px; padding: 24px 16px; }
.mn { margin-left: 276px; max-width: calc(100% - 276px); }
.sb-user { padding: 14px; gap: 12px; margin: 0 0 12px; border: 1px solid rgba(255,255,255,0.08); }
.sb-user-name { font-size: 14px; line-height: 1.25; }
.sidebar-actions { display: grid; grid-template-columns: 44px minmax(0,1fr) minmax(0,1fr); gap: 8px; align-items: stretch; }
.sidebar-actions .theme-toggle { width: 44px; height: 44px; border-radius: 14px; }
.sidebar-actions .btn-sm { min-width: 0; width: 100%; min-height: 44px; padding: 0 10px; border-radius: 14px; font-size: 12px; line-height: 1.05; text-align: center; white-space: normal; }
.sidebar-actions .btn-sm:hover, .sidebar-actions .theme-toggle:hover { transform: translateY(-1px); }
.sidebar-actions .btn-sm:focus-visible, .sidebar-actions .theme-toggle:focus-visible { outline: 2px solid rgba(34,211,238,.75); outline-offset: 2px; }

.tt { gap: 14px; align-items: center; }
.tt > div:last-child { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sb2 { min-width: min(420px, 100%); }
.fs { min-height: 42px; }

.lead-table { table-layout: fixed; min-width: 980px; }
.lead-table th, .lead-table td { vertical-align: middle; }
.lead-table th { padding: 14px 24px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); white-space: nowrap; }
.lead-table td { padding: 18px 24px; height: 82px; }
.lead-table tbody tr { transition: background .18s ease, transform .18s ease; }
.lead-table tbody tr:hover { background: rgba(56,189,248,.045); }
.lead-client-name, .lead-plan-name { font-weight: 750; color: var(--foreground); line-height: 1.25; overflow-wrap: anywhere; }
.lead-client-phone { font-size: 11px; color: var(--muted-foreground); margin-top: 3px; }
.lead-cell-muted { color: var(--muted-foreground); font-weight: 650; }
.lead-status-cell { text-align: left; }
.lead-actions-cell { text-align: right; width: 148px; }
.lead-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: nowrap; white-space: nowrap; min-width: 132px; }
.lead-actions .btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 11px; border-color: rgba(148,163,184,.18); background: rgba(148,163,184,.06); }
.lead-actions .btn-icon:hover { transform: translateY(-1px); }
.lead-actions .btn-icon.success { color: #14b8a6; }
.lead-actions .btn-icon.danger { color: #ef4444; }
.bdg { white-space: nowrap; }

.commission-actions { gap: 8px; min-width: 92px; }
.commission-actions .btn-icon { width: 34px; height: 34px; padding: 0; }
.fechamentos-actions .btn, .mh .btn { white-space: nowrap; }

body[data-theme="dark"] .lead-table tbody tr:hover { background: rgba(34,211,238,.055); }
body[data-theme="dark"] .lead-actions .btn-icon { background: rgba(15,23,42,.82); border-color: rgba(71,85,105,.65); }
body[data-theme="dark"] .lead-actions .btn-icon:hover { background: rgba(30,41,59,.98); color: #e5f2ff; }
body[data-theme="dark"] .lead-client-name, body[data-theme="dark"] .lead-plan-name { color: #eef4ff; }

@media (max-width: 980px) {
  .sb { width: 100%; }
  .mn { margin-left: 0; max-width: 100%; }
  .lead-table { min-width: 880px; }
  .lead-table td, .lead-table th { padding-left: 16px; padding-right: 16px; }
}


/* ===== KIVORA TABLE COMPACT 2026-08-22 ===== */
/* Densidade mais compacta para remover rolagem horizontal desnecessaria na tabela de clientes */
.lead-table { width: 100%; min-width: 680px; table-layout: fixed; }
.lead-table th { padding: 11px 14px; font-size: 10px; letter-spacing: .06em; }
.lead-table td { padding: 12px 14px; height: 58px; }
.lead-client-name, .lead-plan-name { font-size: 13px; line-height: 1.2; }
.lead-client-phone { font-size: 10px; margin-top: 2px; }
.lead-cell-muted { font-size: 13px; }
.lead-actions-cell { width: 104px; }
.lead-actions { min-width: 96px; gap: 5px; }
.lead-actions .btn-icon { width: 30px; height: 30px; border-radius: 9px; }
.lead-actions .btn-icon svg, .lead-actions .btn-icon i { width: 14px !important; height: 14px !important; }
#pg-leads .tw > div[style*="overflow-x"] { overflow-x: auto; scrollbar-gutter: stable; }
#pg-leads .bdg { font-size: 11px; padding: 7px 10px; }

@media (min-width: 1180px) {
  .lead-table { min-width: 0; }
}
@media (max-width: 980px) {
  .lead-table { min-width: 640px; }
  .lead-table td, .lead-table th { padding-left: 10px; padding-right: 10px; }
  .lead-actions-cell { width: 98px; }
}


/* ===== KIVORA KANBAN COMPACT 2026-08-22 ===== */
/* Fechamentos: somente Venda Efetivada; Kanban mais curto e direto para interação */
.kanban-board { gap: 12px; padding-bottom: 16px; min-height: calc(100vh - 170px); }
.kanban-col { width: 248px; min-width: 248px; border-radius: 16px; max-height: calc(100vh - 185px); overflow: hidden; }
.kc-header { padding: 12px 14px; min-height: 48px; font-size: 13px; gap: 8px; }
.kc-count { min-width: 22px; height: 22px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 12px; }
.kc-body { padding: 12px; gap: 10px; overflow-y: auto; }
.k-card { padding: 12px; border-radius: 13px; }
.k-card h4 { font-size: 13px; margin-bottom: 5px; line-height: 1.2; }
.k-card p { font-size: 11px; line-height: 1.25; gap: 5px; }
.k-card .k-val { font-size: 13px; margin-top: 8px; }
.k-card .k-actions { margin-top: 9px; padding-top: 8px; gap: 6px; }
.k-card .k-actions .btn-icon { width: 30px; height: 30px; padding: 0; border-radius: 9px; }
.k-card .k-actions .btn-icon svg, .k-card .k-actions .btn-icon i { width: 14px !important; height: 14px !important; }
.kanban-empty { text-align:center; font-size:11px; color:var(--muted-foreground); margin:0; border:1px dashed var(--border); padding:10px 8px; border-radius:10px; }
@media (max-width: 980px) {
  .kanban-board { gap: 10px; }
  .kanban-col { width: 78vw; min-width: 78vw; max-height: none; }
}


/* ===== KIVORA FECHAMENTO PIPELINE PREVISTO 2026-08-22 ===== */
.pipeline-preview-card { display:grid; grid-template-columns: minmax(0,1fr) auto; align-items:center; gap:14px; margin:0 0 16px; padding:16px 18px; border:1px solid rgba(34,211,238,.24); border-radius:16px; background:linear-gradient(135deg, rgba(34,211,238,.10), rgba(99,102,241,.08)); box-shadow:0 18px 42px -34px rgba(15,23,42,.55); }
.pipeline-preview-card h3 { display:flex; align-items:center; gap:8px; margin:0; font-size:14px; font-weight:800; color:var(--foreground); }
.pipeline-preview-card p { margin:4px 0 0; font-size:12px; color:var(--muted-foreground); }
.pipeline-preview-value { text-align:right; }
.pipeline-preview-value strong { display:block; font-size:24px; line-height:1.05; color:var(--primary); }
.pipeline-preview-value span { display:block; margin-top:4px; font-size:11px; color:var(--muted-foreground); font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
body[data-theme="dark"] .pipeline-preview-card { background:linear-gradient(135deg, rgba(34,211,238,.12), rgba(99,102,241,.10)); border-color:rgba(34,211,238,.28); }
@media (max-width: 720px) { .pipeline-preview-card { grid-template-columns:1fr; } .pipeline-preview-value { text-align:left; } }


/* ===== KIVORA KANBAN ALIGNMENT 2026-08-22 ===== */
/* Alinhamento fino do funil: colunas/cards com respiro igual e acoes centralizadas */
.kanban-board { gap: 12px; align-items: flex-start; }
.kanban-col { width: 232px; min-width: 232px; border-radius: 15px; }
.kc-header { padding: 11px 12px; min-height: 46px; }
.kc-body { padding: 12px; gap: 10px; min-height: 150px; }
.k-card { min-height: 148px; display: flex; flex-direction: column; justify-content: flex-start; }
.k-card h4 { margin-bottom: 5px; }
.k-card p { margin: 1px 0; }
.k-card .k-val { margin-top: 8px; }
.k-card .k-actions { width: 100%; margin-top: auto; padding-top: 9px; justify-content: center; align-items: center; gap: 14px; }
.k-card .k-actions .btn-icon { flex: 0 0 32px; width: 32px; height: 32px; }
.kanban-empty { min-height: 148px; display: flex; align-items: center; justify-content: center; width: 100%; padding: 0; }
@media (min-width: 1500px) { .kanban-col { width: 240px; min-width: 240px; } }
@media (max-width: 980px) { .kanban-col { width: 76vw; min-width: 76vw; } .k-card, .kanban-empty { min-height: 138px; } }


/* ===== KIVORA KANBAN SIX COLUMNS 2026-08-22 ===== */
/* Forca as 6 colunas do funil a caberem na tela desktop */
.kanban-board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; overflow-x: visible; padding-bottom: 10px; }
.kanban-col { width: auto; min-width: 0; max-width: none; border-radius: 14px; }
.kc-header { padding: 10px 10px; min-height: 42px; font-size: 12px; gap: 6px; }
.kc-header span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-count { min-width: 20px; height: 20px; font-size: 11px; flex: 0 0 auto; }
.kc-body { padding: 9px; gap: 8px; min-height: 132px; }
.k-card { min-height: 126px; padding: 10px; border-radius: 12px; }
.k-card h4 { font-size: 12px; line-height: 1.18; margin-bottom: 4px; overflow-wrap: anywhere; }
.k-card p { font-size: 10px; line-height: 1.2; gap: 4px; overflow-wrap: anywhere; }
.k-card .k-val { font-size: 12px; margin-top: 7px; }
.k-card .k-actions { padding-top: 7px; gap: 10px; }
.k-card .k-actions .btn-icon { flex-basis: 28px; width: 28px; height: 28px; border-radius: 8px; }
.kanban-empty { min-height: 126px; font-size: 10px; }
@media (max-width: 1180px) {
  .kanban-board { gap: 7px; }
  .kc-header { font-size: 11px; padding-left: 8px; padding-right: 8px; }
  .kc-body { padding: 8px; }
  .k-card { padding: 9px; }
}
@media (max-width: 980px) {
  .kanban-board { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; }
  .kanban-col { width: 76vw; min-width: 76vw; max-height: none; scroll-snap-align: start; }
}


/* ===== KIVORA LIFE VALUES + SUPERMED RECEIVED 2026-08-26 ===== */
.life-values-box { margin-top: 10px; padding: 12px; border: 1px dashed var(--border); border-radius: 12px; background: var(--secondary); }
.life-values-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:10px; }
.life-values-head strong { font-size:12px; color:var(--foreground); }
.life-values-head span { font-size:11px; color:var(--muted-foreground); }
.life-values-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap:8px; }
.life-value-field label { font-size:10px; margin-bottom:4px; }
.life-value-field input { padding:9px 10px; }
.supermed-received-box { display:grid; gap:4px; justify-items:center; min-width:130px; }
.supermed-received-box input { width:118px; padding:8px 9px; border:1px solid var(--border); border-radius:8px; background:var(--card); color:var(--foreground); text-align:right; font-weight:700; }
.supermed-received-box span { font-size:10px; color:var(--muted-foreground); }
.supermed-received-box strong { font-size:11px; color:var(--success); }
body[data-theme="dark"] .life-values-box { background:#08101d; border-color:#2b3a4d; }


/* ===== KIVORA FECHAMENTO DATE + MANUAL LIFE FIX 2026-08-26 ===== */
.fechamento-date-input { min-width:118px; width:118px; padding:8px; border:1px solid var(--border); border-radius:8px; background:var(--card); color:var(--foreground); text-align:center; }
.fechamento-date-input.invalid { border-color:var(--danger); box-shadow:0 0 0 3px rgba(239,68,68,.12); }


/* ===== KIVORA MULTI LIFE RECEIVED + CLIENT TOGGLE 2026-08-26 ===== */
.supermed-received-lives { display:grid; gap:6px; justify-items:center; min-width:150px; }
.supermed-received-lives-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(82px,1fr)); gap:6px; width:100%; max-width:230px; }
.supermed-life-input label { display:block; font-size:9px; color:var(--muted-foreground); margin-bottom:3px; text-align:center; }
.supermed-life-input input { width:100%; min-width:78px; padding:7px 8px; border:1px solid var(--border); border-radius:8px; background:var(--card); color:var(--foreground); text-align:right; font-weight:700; }
.supermed-received-lives strong { font-size:11px; color:var(--success); }


/* ===== KIVORA FECHAMENTO VIGENCIA FILTER 2026-08-27 ===== */
.fechamento-vigencia-label { display:block; margin-top:2px; font-size:10px; color:var(--muted-foreground); }
.fechamento-payment-summary-row td { padding: 2px 14px 10px; text-align: center; border-top: 0; color: var(--muted-foreground); font-size: 10px; line-height: 1.35; }
.fechamento-payment-summary-row span { display: inline-block; max-width: 100%; }


/* ===== KIVORA PIPELINE VIGENCIA FILTER LIST 2026-08-27 ===== */
.pipeline-preview-list { margin-top:8px; display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
.pipeline-preview-pill { display:inline-flex; align-items:center; gap:5px; padding:5px 8px; border-radius:999px; background:rgba(37,99,235,.08); color:var(--foreground); border:1px solid rgba(37,99,235,.18); font-size:11px; font-weight:700; }
.pipeline-preview-pill small { color:var(--muted-foreground); font-weight:600; }


/* ===== KIVORA SECOND BOLETO AMIL SECTIONS 2026-08-27 ===== */
.second-boleto-card { margin-top: 22px; border-style: solid; border-color: rgba(245, 158, 11, .38); background: linear-gradient(180deg, rgba(255, 251, 235, .72), var(--card)); }
.second-boleto-card .fc-header { align-items:flex-start; gap:16px; }
.second-boleto-title { display:grid; gap:4px; }
.second-boleto-title p { margin:0; color:var(--muted-foreground); font-size:12px; font-weight:500; }
.second-boleto-body { display:grid; gap:16px; padding:16px; }
body[data-theme="dark"] .second-boleto-card { background: linear-gradient(180deg, rgba(120, 53, 15, .22), #0b1220); border-color: rgba(245, 158, 11, .28); }


/* ===== KIVORA SIDEBAR TOP USER 2026-08-27 ===== */
.app-topbar { position: fixed; top: 0; left: 264px; right: 0; min-height: 64px; z-index: 45; display:flex; align-items:center; justify-content:flex-end; gap:12px; padding:12px 32px; background: rgba(248,250,252,.86); backdrop-filter: blur(16px); border-bottom:1px solid rgba(148,163,184,.24); }
.top-user-pill { display:inline-flex; align-items:center; gap:10px; padding:10px 14px; border-radius:999px; background:var(--card); border:1px solid var(--border); box-shadow:var(--shadow-sm); font-size:13px; font-weight:800; color:var(--foreground); }
.top-user-pill i { width:16px; height:16px; color:var(--primary); }
.top-actions { display:flex; align-items:center; gap:8px; }
.top-actions .theme-toggle { width:42px; height:42px; padding:0; border-radius:14px; }
.mn { padding-top: 92px; }
.sb-user { display:none !important; }
.sb-s { margin-top: 4px; }
.sb-t { display:none; }
body[data-theme="dark"] .app-topbar { background:rgba(2,6,23,.82); border-color:#243244; }
@media (max-width: 820px) {
  .app-topbar { display:none; }
  .mn { padding-top:32px; }
}


/* ===== KIVORA FECHAMENTO SPLIT FUTURE COMMISSIONS 2026-08-29 ===== */
.later-commission-card { margin-top:22px; border-style:solid; border-color:rgba(99,102,241,.30); background:linear-gradient(180deg, rgba(99,102,241,.08), var(--card)); }
.later-commission-card .fc-header { align-items:flex-start; gap:16px; }
.later-commission-title { display:grid; gap:4px; }
.later-commission-title p { margin:0; color:var(--muted-foreground); font-size:12px; font-weight:500; }
.later-commission-body { display:grid; gap:16px; padding:16px; }
.pipeline-preview-values { display:flex; align-items:flex-end; justify-content:flex-end; gap:18px; flex-wrap:wrap; text-align:right; }
.pipeline-preview-subvalue strong { display:block; font-size:18px; line-height:1.05; color:var(--muted-foreground); }
.pipeline-preview-subvalue span { display:block; margin-top:4px; font-size:11px; color:var(--muted-foreground); font-weight:700; text-transform:uppercase; letter-spacing:.05em; }
.pipeline-preview-pill small b { color:var(--primary); font-weight:800; }
body[data-theme="dark"] .later-commission-card { background:linear-gradient(180deg, rgba(99,102,241,.14), #0b1220); border-color:rgba(99,102,241,.28); }
@media (max-width:720px) { .pipeline-preview-values { justify-content:flex-start; text-align:left; } }


/* ===== KIVORA FECHAMENTO REPASSE MONTH GROUPING 2026-08-29 ===== */


/* ===== KIVORA FECHAMENTO BLOCKS + DASHBOARD MONTH 2026-08-29 ===== */
.fechamento-main-block { margin-bottom: 18px; }
.fechamento-empty-block { padding: 28px; text-align:center; color:var(--muted-foreground); border-top:1px solid var(--border); }
.fechamento-block-title { display:grid; gap:4px; }
.fechamento-block-title p { margin:0; color:var(--muted-foreground); font-size:12px; font-weight:500; }
.fechamento-card .fc-header h3 small { display:block; margin-top:4px; color:var(--muted-foreground); font-size:11px; font-weight:600; }

