@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Public+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

  :root{
    --bg: #F6F2E9;
    --panel: #FFFDF8;
    --ink: #24261D;
    --ink-soft: #6B6A5C;
    --pine: #1F3D2B;
    --pine-light: #2E5A3F;
    --gold: #C99A3E;
    --gold-soft: #E9D7AC;
    --terracotta: #B5493D;
    --terracotta-soft: #F3DAD5;
    --line: #E4DCC8;
    --radius: 10px;
  }
  *{box-sizing:border-box;}
  body{
    margin:0;
    background:var(--bg);
    color:var(--ink);
    font-family:'Public Sans', sans-serif;
    -webkit-font-smoothing:antialiased;
  }
  h1,h2,h3, .display{
    font-family:'Fraunces', serif;
    font-weight:600;
    letter-spacing:-0.01em;
  }
  .mono{ font-family:'IBM Plex Mono', monospace; }

  /* HEADER */
  header{
    padding:28px 32px 20px 32px;
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    border-bottom:1px solid var(--line);
    flex-wrap:wrap;
    gap:16px;
  }
  .brand{ display:flex; align-items:center; gap:14px; }
  .logo-img{
    height:48px;
    width:auto;
  }
  header h1{ font-size:26px; margin:0; color:var(--pine); }
  header .sub{ color:var(--ink-soft); font-size:13px; margin-top:2px; }

  .stats{ display:flex; gap:22px; }
  .stat{ text-align:right; }
  .stat .num{ font-family:'Fraunces', serif; font-size:22px; font-weight:600; color:var(--pine); }
  .stat .lbl{ font-size:11px; text-transform:uppercase; letter-spacing:0.06em; color:var(--ink-soft); }

  .toolbar{
    padding:18px 32px;
    display:flex; justify-content:space-between; align-items:center;
    gap:16px; flex-wrap:wrap;
  }
  .btn{
    background:var(--pine); color:#fff; border:none; border-radius:8px;
    padding:10px 18px; font-size:14px; font-weight:600; cursor:pointer;
    font-family:'Public Sans', sans-serif;
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .btn:hover{ background:var(--pine-light); }
  .btn:active{ transform: scale(0.98); }
  .btn.ghost{
    background:transparent; color:var(--pine); border:1px solid var(--pine);
  }
  .btn.ghost:hover{ background: rgba(31,61,43,0.06); }
  .btn.danger{ background:var(--terracotta); }
  .btn.danger:hover{ background:#9c3d32; }

  .filterbar{
    margin: 0 32px 16px 32px;
    background: var(--panel);
    border:1px solid var(--line);
    border-radius: var(--radius);
    padding:12px 16px;
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
  }
  .filterbar input[type="text"]{
    flex: 1 1 220px;
    min-width:160px;
    padding:8px 12px;
    border:1px solid var(--line);
    border-radius:7px;
    font-size:13.5px;
    font-family:'Public Sans', sans-serif;
    background:#FCFAF4;
  }
  .filterbar select{
    padding:8px 10px;
    border:1px solid var(--line);
    border-radius:7px;
    font-size:13.5px;
    font-family:'Public Sans', sans-serif;
    background:#FCFAF4;
    color:var(--ink);
  }
  .filterbar .clear-link{
    font-size:12.5px;
    color: var(--terracotta);
    cursor:pointer;
    font-weight:600;
    white-space:nowrap;
  }
  .filterbar .clear-link:hover{ text-decoration:underline; }
  .filterbar .match-count{
    font-size:12px;
    color:var(--ink-soft);
    font-family:'IBM Plex Mono', monospace;
    white-space:nowrap;
    margin-left:auto;
  }

  .followups-strip{
    margin:0 32px 18px 32px;
    background: var(--terracotta-soft);
    border:1px solid #E3B9AF;
    border-radius: var(--radius);
    padding:12px 18px;
    display:none;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
  }
  .followups-strip.show{ display:flex; }
  .followups-strip .label{
    font-weight:700; color:var(--terracotta); font-size:13px;
    text-transform:uppercase; letter-spacing:0.04em;
  }
  .followup-chip{
    background:#fff; border:1px solid #E3B9AF; border-radius:20px;
    padding:5px 12px; font-size:12.5px; color:var(--ink); cursor:pointer;
  }
  .followup-chip b{ color:var(--terracotta); }

  /* BOARD */
  #board{
    display:flex;
    gap:16px;
    padding:0 32px 32px 32px;
    overflow-x:auto;
  }
  .column{
    flex: 0 0 270px;
    background: var(--panel);
    border-radius: 12px;
    border:1px solid var(--line);
    display:flex;
    flex-direction:column;
    max-height: calc(100vh - 260px);
  }
  .column-head{
    padding:14px 16px 10px 16px;
    display:flex; align-items:center; justify-content:space-between;
    border-bottom:1px dashed var(--line);
  }
  .column-head .title{ font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--pine); }
  .column-head .count{
    font-family:'IBM Plex Mono', monospace; font-size:12px; color:var(--ink-soft);
    background: var(--bg); padding:2px 8px; border-radius:20px;
  }
  .column-body{
    padding:12px; display:flex; flex-direction:column; gap:10px;
    overflow-y:auto; flex:1;
  }
  .column-body:empty::after{
    content:"Nenhum lead aqui.";
    color: var(--ink-soft); font-size:12.5px; text-align:center; padding:20px 0; display:block;
  }

  .card{
    background:#fff;
    border:1px solid var(--line);
    border-radius:10px;
    padding:12px 12px 10px 12px;
    cursor:pointer;
    position:relative;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
  }
  .card:hover{ box-shadow: 0 4px 14px rgba(31,61,43,0.10); transform: translateY(-1px); }
  .card.overdue{ border-color: var(--terracotta); background: linear-gradient(180deg, #fff, #FDF4F2); }
  .card-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
  .card-name{ font-weight:700; font-size:14.5px; color:var(--ink); }
  .cat-seal{
    flex:0 0 auto; width:22px;height:22px;border-radius:50%;
    display:flex;align-items:center;justify-content:center;
    font-size:11px; color:#fff; font-weight:700;
  }
  .cat-imovel{ background: var(--pine); }
  .cat-veiculo{ background: var(--gold); color:#3a2c07; }
  .cat-moto{ background: var(--terracotta); }
  .cat-fgts{ background: #4A6FA5; }
  .cat-financiamento{ background: #7A5C3E; }
  .card-value{ font-family:'IBM Plex Mono', monospace; font-size:13px; color:var(--pine); margin-top:6px; }
  .card-phone{ font-size:12px; color:var(--ink-soft); margin-top:2px; display:flex; align-items:center; justify-content:space-between; gap:8px; }
  .phone-parts{ display:inline-flex; align-items:center; gap:4px; font-family:'IBM Plex Mono', monospace; }
  .phone-part{ padding:1px 5px; border-radius:4px; font-size:11px; }
  .phone-part.country{ background:var(--gold-soft); color:#6b4e0f; }
  .phone-part.ddd{ background:var(--pine); color:#fff; font-weight:700; }
  .phone-part.number{ color:var(--ink-soft); }
  .phone-parts-modal{ display:flex; align-items:center; gap:6px; margin-top:6px; font-family:'IBM Plex Mono', monospace; font-size:12.5px; }
  .phone-parts-modal .phone-part{ padding:3px 8px; font-size:12px; }
  .phone-parts-modal .lbl{ font-size:10px; color:var(--ink-soft); display:block; margin-bottom:2px; text-transform:uppercase; letter-spacing:0.03em; }
  .wa-btn{
    display:inline-flex; align-items:center; gap:5px;
    background:#25D366; color:#fff; border:none; border-radius:6px;
    padding:4px 9px; font-size:11.5px; font-weight:700; cursor:pointer;
    text-decoration:none; flex:0 0 auto;
    font-family:'Public Sans', sans-serif;
    transition: background 0.15s ease;
  }
  .wa-btn:hover{ background:#1EBE57; }
  .wa-btn svg{ width:12px; height:12px; fill:#fff; }
  .card-followup{
    margin-top:8px; font-size:11.5px; padding:4px 8px; border-radius:6px;
    display:inline-block; background: var(--bg); color:var(--ink-soft);
  }
  .card-followup.today{ background: var(--gold-soft); color:#6b4e0f; }
  .card-followup.late{ background: var(--terracotta-soft); color:var(--terracotta); font-weight:700; }
  .docs-icon{
    display:inline-block; margin-top:8px; font-size:11.5px;
    color: var(--pine); text-decoration:none; font-weight:600;
    padding:3px 0;
  }
  .docs-icon:hover{ text-decoration:underline; }
  .card-colab-badge{
    font-size:10.5px; margin-top:8px; padding:3px 8px; border-radius:6px;
    background: var(--bg); color:var(--ink-soft); display:inline-block;
  }
  .card-colab-badge.roleta{ background: var(--gold-soft); color:#6b4e0f; font-weight:600; }
  .card-status-select{
    width:100%; margin-top:9px; padding:6px 8px; border-radius:7px; border:1px solid var(--line);
    background:#FCFAF4; font-size:11.5px; font-family:'Public Sans', sans-serif; color:var(--ink);
    cursor:pointer;
  }
  .col-hint{ font-size:9.5px; text-transform:none; letter-spacing:0; color:var(--ink-soft); font-weight:400; }

  /* MODAL */
  .overlay{
    position:fixed; inset:0; background: rgba(36,38,29,0.45);
    display:none; align-items:center; justify-content:center; z-index:50;
    padding:20px;
  }
  .overlay.show{ display:flex; }
  .modal{
    background:#fff; border-radius:14px; width:100%; max-width:460px;
    padding:26px; max-height:88vh; overflow-y:auto;
  }
  .modal h2{ margin:0 0 18px 0; font-size:20px; color:var(--pine); }
  .field{ margin-bottom:14px; }
  .field label{ display:block; font-size:12px; font-weight:600; color:var(--ink-soft); margin-bottom:5px; text-transform:uppercase; letter-spacing:0.04em; }
  .field input, .field select, .field textarea{
    width:100%; padding:9px 11px; border:1px solid var(--line); border-radius:7px;
    font-size:14px; font-family:'Public Sans', sans-serif; background:#FCFAF4;
  }
  .field textarea{ resize:vertical; min-height:60px; }
  .row2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
  .modal-actions{ display:flex; justify-content:space-between; margin-top:20px; gap:10px; }

  /* ===== COMISSIONAMENTO ===== */
  .commission-hint{
    font-size:12px; color:var(--ink-soft); background:var(--bg); border-radius:8px;
    padding:9px 12px; margin-bottom:16px;
  }
  .commission-section{
    border:1px solid var(--line); border-radius:10px; padding:14px 16px; margin-bottom:16px;
    background:#FCFAF4;
  }
  .commission-section-title{
    display:block; font-size:12px; font-weight:700; color:var(--pine);
    text-transform:uppercase; letter-spacing:0.04em; margin-bottom:10px;
  }
  .commission-type-toggle{ display:flex; gap:8px; margin-bottom:12px; }
  .ct-btn{
    flex:1; padding:8px; border-radius:7px; border:1px solid var(--line);
    background:#fff; color:var(--ink-soft); font-size:13px; font-weight:600; cursor:pointer;
    font-family:'Public Sans', sans-serif;
  }
  .ct-btn.active{ background:var(--pine); color:#fff; border-color:var(--pine); }
  .commission-total-preview{
    font-size:12.5px; color:var(--ink-soft); margin:-6px 0 12px 0; font-family:'IBM Plex Mono', monospace;
  }
  .installments-generator{
    background:#fff; border:1px dashed var(--line); border-radius:8px; padding:12px; margin-bottom:12px;
  }
  .ig-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  .ig-checkbox{
    display:flex; align-items:center; gap:7px; font-size:12.5px; color:var(--ink-soft);
    margin-top:10px; cursor:pointer;
  }
  .ig-checkbox input{ width:auto; }
  .installments-table-wrap{ max-height:220px; overflow-y:auto; }
  .installments-table{ width:100%; border-collapse:collapse; font-size:11.5px; }
  .installments-table th{
    text-align:left; padding:5px 4px; color:var(--ink-soft); font-weight:600;
    border-bottom:1px solid var(--line); position:sticky; top:0; background:#FCFAF4;
  }
  .installments-table td{ padding:4px; border-bottom:1px solid var(--line); }
  .installments-table input[type="number"], .installments-table input[type="date"]{
    width:100%; padding:4px 5px; border:1px solid var(--line); border-radius:5px; font-size:11px;
    font-family:'IBM Plex Mono', monospace;
  }
  .installments-table input[type="checkbox"]{ width:16px; height:16px; }
  .installments-table .rm-btn{
    background:none; border:none; color:var(--terracotta); cursor:pointer; font-size:14px;
  }
  .installments-summary{
    margin-top:10px; font-size:12px; color:var(--ink-soft); display:flex; justify-content:space-between;
    font-family:'IBM Plex Mono', monospace;
  }
  .installments-summary b{ color:var(--pine); }
  .colab-parcela-row{
    display:grid; grid-template-columns:1fr auto auto auto; gap:10px; align-items:center;
    padding:8px 10px; border-bottom:1px solid var(--line); font-size:12.5px;
  }
  .colab-parcela-status{ font-size:10.5px; font-weight:700; padding:2px 8px; border-radius:10px; }
  .colab-parcela-status.recebido{ background:var(--gold-soft); color:#6b4e0f; }
  .colab-parcela-status.pendente{ background:var(--bg); color:var(--ink-soft); }
  .modal-actions .right{ display:flex; gap:8px; }

  .empty-state{
    text-align:center; padding:80px 20px; color:var(--ink-soft);
  }
  .empty-state .display{ font-size:22px; color:var(--pine); margin-bottom:6px; }

  ::-webkit-scrollbar{ width:8px; height:8px; }
  ::-webkit-scrollbar-thumb{ background: var(--gold-soft); border-radius:10px; }

  /* ===== RESPONSIVO — TABLET ===== */
  @media (max-width: 900px){
    header{ padding:20px 20px 16px 20px; }
    .toolbar{ padding:14px 20px; }
    .filterbar{ margin:0 20px 14px 20px; }
    .followups-strip{ margin:0 20px 16px 20px; }
    #board{ padding:0 20px 24px 20px; }
  }

  /* ===== RESPONSIVO — CELULAR ===== */
  @media (max-width: 640px){
    header{
      padding:16px 16px 14px 16px;
      align-items:flex-start;
    }
    .logo-img{ height:36px; }
    header h1{ font-size:20px; }
    header .sub{ font-size:11.5px; }
    .stats{ width:100%; justify-content:space-between; gap:10px; }
    .stat{ text-align:left; }
    .stat .num{ font-size:17px; }
    .stat .lbl{ font-size:9.5px; }

    .toolbar{ padding:12px 16px; flex-direction:column; align-items:stretch; }
    .toolbar > div{ display:flex; flex-direction:column; gap:8px; width:100%; }
    .toolbar .btn{ width:100%; text-align:center; }

    .filterbar{ margin:0 16px 12px 16px; flex-direction:column; align-items:stretch; padding:12px; }
    .filterbar input[type="text"]{ flex:1 1 auto; width:100%; }
    .filterbar select{ width:100%; }
    .filterbar .match-count{ margin-left:0; text-align:right; }
    .filterbar .clear-link{ text-align:center; padding:4px 0; }

    .followups-strip{ margin:0 16px 14px 16px; padding:10px 12px; }

    /* Board vira um carrossel: uma coluna por vez, com deslize (swipe) */
    #board{
      padding:0 16px 24px 16px;
      gap:12px;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
    }
    .column{
      flex: 0 0 88vw;
      scroll-snap-align: start;
      max-height: none;
    }
    .column-body{ max-height: 60vh; }

    /* Modal em tela cheia no celular, mais fácil de usar com teclado */
    .overlay{ padding:0; align-items:flex-end; }
    .modal{
      max-width:100%; width:100%;
      border-radius:16px 16px 0 0;
      max-height:92vh;
      padding:20px 18px 24px 18px;
    }
    .row2{ grid-template-columns:1fr; gap:0; }
    /* Evita zoom automático do iOS ao focar em campos (mínimo 16px) */
    .field input, .field select, .field textarea{ font-size:16px; }

    .cat-seal{ width:20px; height:20px; font-size:10px; }
    .card{ padding:11px; }
  }

  /* ===== TELA DE LOGIN ===== */
  .auth-screen{
    position:fixed; inset:0; background:var(--bg);
    display:flex; align-items:center; justify-content:center;
    z-index:100; padding:20px;
  }
  .auth-box{
    background:var(--panel); border:1px solid var(--line); border-radius:14px;
    padding:36px 32px; width:100%; max-width:380px;
  }
  .auth-box .seal-wrap{ text-align:center; margin-bottom:18px; }
  .auth-box .logo-img{ height:52px; }
  .auth-box h2{ text-align:center; color:var(--pine); font-size:22px; margin:0 0 6px 0; }
  .auth-box .sub{ text-align:center; color:var(--ink-soft); font-size:13px; margin-bottom:24px; }
  .auth-box .field{ margin-bottom:14px; }
  .auth-box .field label{ display:block; font-size:12px; font-weight:600; color:var(--ink-soft); margin-bottom:5px; text-transform:uppercase; letter-spacing:0.04em; }
  .auth-box .field input{
    width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:8px;
    font-size:16px; font-family:'Public Sans', sans-serif; background:#FCFAF4;
  }
  .auth-box .btn{ width:100%; margin-top:6px; padding:12px; font-size:15px; }
  .auth-links{ text-align:center; margin-top:16px; display:flex; flex-direction:column; gap:8px; }
  .auth-links a{ font-size:13px; color:var(--pine); cursor:pointer; text-decoration:underline; }
  .auth-error{ background:var(--terracotta-soft); color:var(--terracotta); padding:10px 12px; border-radius:8px; font-size:13px; margin-bottom:14px; display:none; }
  .auth-error.show{ display:block; }
  .auth-success{ background:var(--gold-soft); color:#6b4e0f; padding:10px 12px; border-radius:8px; font-size:13px; margin-bottom:14px; display:none; }
  .auth-success.show{ display:block; }
  .auth-user-bar{
    position:fixed; top:12px; right:16px; z-index:40;
    font-size:12px; color:var(--ink-soft); display:flex; align-items:center; gap:10px;
    background:var(--panel); border:1px solid var(--line); border-radius:20px; padding:6px 14px;
  }
  .auth-user-bar a{ color:var(--terracotta); cursor:pointer; font-weight:600; text-decoration:none; }
  #appContent{ display:none; }

  /* ===== SIDEBAR + LAYOUT PRINCIPAL ===== */
  #appShell{ display:flex; min-height:100vh; }
  .sidebar{
    flex:0 0 76px; width:76px; background:var(--pine); display:flex; flex-direction:column;
    align-items:center; padding:20px 0; gap:8px; overflow:hidden; position:relative;
    transition:flex-basis .22s ease, width .22s ease; z-index:30;
  }
  .sidebar.sidebar-hovered, .sidebar.sidebar-pinned{ flex:0 0 208px; width:208px; align-items:stretch; }
  .sidebar .sidebar-top{
    display:flex; align-items:center; justify-content:center; width:100%;
    padding:0 12px 14px 12px; margin-bottom:8px; min-height:34px; position:relative;
  }
  .sidebar .sidebar-logo-big{
    max-height:30px; max-width:0; opacity:0; transition:max-width .22s ease, opacity .18s ease;
    object-fit:contain;
  }
  .sidebar.sidebar-hovered .sidebar-logo-big, .sidebar.sidebar-pinned .sidebar-logo-big{
    max-width:150px; opacity:1;
  }
  .sidebar .sidebar-toggle{
    position:absolute; right:10px; top:50%; transform:translateY(-50%);
    background:transparent; border:none; color:#CFE0D4; font-size:16px; cursor:pointer;
    width:26px; height:26px; border-radius:6px; display:flex; align-items:center; justify-content:center;
  }
  .sidebar:not(.sidebar-hovered):not(.sidebar-pinned) .sidebar-toggle{ position:static; margin:0 auto; }
  .sidebar .sidebar-toggle:hover{ background:rgba(255,255,255,0.12); }
  .sidebar .sidebar-toggle.pinned{ color:var(--gold); }
  .sidebar .seal-mini{ width:38px; margin-bottom:18px; }
  .sidebar .nav-btn{
    width:56px; height:56px; border-radius:12px; border:none; background:transparent;
    color:#CFE0D4; display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:4px; font-size:10px; cursor:pointer; font-family:'Public Sans', sans-serif;
    margin:0 auto; transition:width .22s ease, height .22s ease, padding .22s ease;
  }
  .sidebar.sidebar-hovered .nav-btn, .sidebar.sidebar-pinned .nav-btn{
    width:184px; height:44px; flex-direction:row; justify-content:flex-start; gap:12px;
    padding:0 16px; font-size:13px; margin:0 12px;
  }
  .sidebar .nav-btn span.ic{ font-size:19px; }
  .sidebar .nav-btn span.nav-label{
    max-width:0; opacity:0; overflow:hidden; white-space:nowrap; transition:max-width .18s ease, opacity .15s ease;
  }
  .sidebar.sidebar-hovered .nav-btn span.nav-label, .sidebar.sidebar-pinned .nav-btn span.nav-label{
    max-width:140px; opacity:1;
  }
  .sidebar .nav-btn.active{ background:rgba(255,255,255,0.14); color:#fff; }
  .sidebar .nav-btn:hover{ background:rgba(255,255,255,0.08); }
  .main-area{ flex:1; min-width:0; }

  /* ===== AVATAR / MENU DA CONTA ===== */
  .avatar-wrap{ position:fixed; top:14px; right:20px; z-index:45; }
  .avatar-btn{
    width:38px; height:38px; border-radius:50%; border:2px solid var(--gold);
    background:var(--pine); color:#fff; font-weight:700; font-size:14px;
    display:flex; align-items:center; justify-content:center; cursor:pointer;
    overflow:hidden; padding:0;
  }
  .avatar-btn img{ width:100%; height:100%; object-fit:cover; border-radius:50%; }
  .account-popup{
    display:none; position:absolute; top:46px; right:0; min-width:190px;
    background:var(--panel); border:1px solid var(--line); border-radius:10px;
    box-shadow:0 8px 24px rgba(0,0,0,0.18); overflow:hidden; z-index:46;
  }
  .account-popup.show{ display:block; }
  .account-popup-item{
    padding:11px 16px; font-size:13px; cursor:pointer; color:var(--ink);
    border-bottom:1px solid var(--line);
  }
  .account-popup-item:last-child{ border-bottom:none; }
  .account-popup-item:hover{ background:var(--gold-soft); }
  .account-popup-item.danger{ color:var(--terracotta); }

  /* ===== MODAL MINHA CONTA ===== */
  .conta-modal-overlay{
    display:none; position:fixed; inset:0; background:rgba(20,20,15,0.45); z-index:80;
    align-items:center; justify-content:center;
  }
  .conta-modal-overlay.show{ display:flex; }
  .conta-modal-box{
    background:var(--panel); border-radius:14px; padding:28px; width:min(760px,92vw);
    max-height:88vh; overflow:auto; box-shadow:0 16px 40px rgba(0,0,0,0.25);
  }
  .conta-modal-box h2{ margin:0 0 20px 0; color:var(--pine); text-align:center; }
  .conta-cards-grid{
    display:grid; grid-template-columns:1fr 1fr; grid-auto-rows:1fr; gap:18px;
  }
  .conta-card{
    background:#FCFAF4; border:1px solid var(--line); border-radius:10px; padding:18px;
    display:flex; flex-direction:column;
  }
  .conta-card h3{
    margin:0 0 14px 0; font-size:13px; letter-spacing:.03em; text-transform:uppercase;
    color:var(--pine); text-align:center;
  }
  .conta-card-body{ flex:1; display:flex; align-items:center; justify-content:space-between; gap:14px; }
  .conta-card-center{ justify-content:center; text-align:center; position:relative; }
  .conta-card-icon{ font-size:26px; opacity:.65; margin-left:auto; }
  .conta-card-center .conta-card-icon{ position:absolute; right:0; bottom:0; margin-left:0; }
  .conta-perfil-body{ align-items:flex-start; }
  .conta-kv{ font-size:13px; margin-bottom:6px; color:var(--ink); }
  .conta-kv-label{ font-weight:700; color:var(--pine); margin-right:4px; }
  .conta-kv-highlight{ color:var(--terracotta); }
  .conta-hint{ font-size:11px; color:var(--ink-soft); margin:8px 0 0 0; max-width:220px; }
  .conta-toggle-row{ display:flex; flex-direction:column; align-items:center; gap:8px; font-size:13px; }
  .conta-toggle-labels{ display:flex; align-items:center; gap:14px; color:var(--ink-soft); }
  .conta-link{
    color:var(--terracotta); font-weight:600; font-size:13px; cursor:pointer; text-decoration:none;
  }
  .conta-link:hover{ text-decoration:underline; }
  .conta-avatar-preview{
    width:64px; height:64px; border-radius:50%; background:var(--pine); color:#fff;
    display:flex; align-items:center; justify-content:center; font-weight:700; font-size:20px;
    overflow:hidden; border:2px solid var(--gold); cursor:pointer; position:relative; flex-shrink:0;
  }
  .conta-avatar-preview img{ width:100%; height:100%; object-fit:cover; }
  .conta-avatar-edit{
    position:absolute; bottom:-2px; right:-2px; background:var(--gold); color:var(--pine);
    width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    font-size:11px; border:2px solid var(--panel);
  }
  .conta-modal-close{
    float:right; background:transparent; border:none; font-size:18px; cursor:pointer; color:var(--ink-soft);
  }
  .conta-password-box{ width:min(420px,92vw); }
  .conta-password-box h3{ margin:0 0 18px 0; color:var(--pine); }
  .conta-password-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:8px; }
  .btn-secondary{
    background:var(--panel); border:1px solid var(--pine); color:var(--pine); border-radius:7px;
    cursor:pointer; font-family:'Public Sans', sans-serif; font-weight:600; padding:9px 16px;
  }
  .btn-secondary:hover{ background:var(--gold-soft); }
  .toggle-switch{ cursor:pointer; user-select:none; }
  .toggle-switch .track{
    width:38px; height:20px; border-radius:10px; background:var(--line); position:relative; transition:background .15s;
  }
  .toggle-switch .track::after{
    content:''; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%;
    background:#fff; transition:left .15s;
  }
  .toggle-switch.on .track{ background:var(--pine); }
  .toggle-switch.on .track::after{ left:20px; }

  /* ===== MODO ESCURO ===== */
  body.dark-mode{ --panel:#20241f; --ink:#EDEAE0; --ink-soft:#B7B4A8; --line:#3a3f38; background:#14170f; color:#EDEAE0; }
  body.dark-mode .auth-box, body.dark-mode .dash-panel, body.dark-mode .conta-card{ background:#262a22; }
  body.dark-mode input{ background:#1b1e18; color:#EDEAE0; }

  /* ===== DASHBOARD ===== */
  #dashboardView{ padding:28px 32px; }
  .dash-header{ margin-bottom:22px; }
  .dash-header h1{ font-size:24px; color:var(--pine); margin:0 0 4px 0; }
  .dash-header .sub{ color:var(--ink-soft); font-size:13px; }

  .kpi-grid{
    display:grid; grid-template-columns:repeat(6, 1fr);
    gap:14px; margin-bottom:26px;
  }
  @media (max-width: 1200px){
    .kpi-grid{ grid-template-columns:repeat(3, 1fr); }
  }
  @media (max-width: 640px){
    .kpi-grid{ grid-template-columns:repeat(2, 1fr); gap:10px; }
    .kpi-card{ padding:12px 14px; }
    .kpi-card .kpi-val{ font-size:19px; }
    .kpi-card .kpi-lbl{ font-size:9.5px; }
  }
  .kpi-card{
    background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:16px 18px;
    min-width:0;
  }
  .kpi-card .kpi-lbl{ font-size:11px; text-transform:uppercase; letter-spacing:0.05em; color:var(--ink-soft); margin-bottom:6px; }
  .kpi-card .kpi-val{ font-family:'Fraunces', serif; font-size:24px; font-weight:600; color:var(--pine); }
  .kpi-card.gold .kpi-val{ color:#8a6a1f; }
  .kpi-card.terra .kpi-val{ color:var(--terracotta); }

  .dash-header{ position:relative; }
  .dash-header-actions{
    position:absolute; right:0; top:4px; display:flex; gap:14px;
  }
  .reset-layout-link{
    font-size:12px; color:var(--pine);
    cursor:pointer; text-decoration:underline;
  }
  .reset-layout-link.locked{ color:var(--terracotta); font-weight:600; }

  /* ===== WIDGETS ARRASTÁVEIS/REDIMENSIONÁVEIS ===== */
  .dash-widgets{ display:flex; flex-wrap:wrap; gap:16px; align-items:flex-start; }

  .dash-panel{
    background:var(--panel); border:1px solid var(--line); border-radius:12px;
    display:flex; flex-direction:column;
    width:calc(50% - 8px); height:340px; min-width:280px; min-height:220px;
    max-width:100%;
    resize:both; overflow:hidden;
  }
  .dash-panel.wide{ width:100%; height:420px; }
  .dash-panel.dragging{ opacity:0.4; }
  .dash-panel.drop-target{ outline:2px dashed var(--gold); outline-offset:-2px; }

  .dash-panel-header{
    display:flex; align-items:center; gap:8px; padding:14px 16px 10px 16px;
    cursor:grab; flex:0 0 auto; user-select:none;
  }
  .dash-panel-header:active{ cursor:grabbing; }
  .dash-panel-header .grip{ color:var(--ink-soft); font-size:15px; line-height:1; }
  .dash-panel-header h3{ font-size:13px; color:var(--pine); margin:0; text-transform:uppercase; letter-spacing:0.04em; }

  .dash-panel-body{
    flex:1; min-height:0; padding:0 18px 16px 18px; overflow-y:auto; overflow-x:hidden;
    display:flex; flex-direction:column;
  }
  .dash-panel-body canvas{ max-height:100%; }
  .chart-shrink{ max-width:220px; margin:0 auto; width:100%; }

  /* ---- Funil real (trapézios empilhados) ---- */
  .funnel-wrap{ display:flex; flex-direction:column; gap:3px; flex:1; justify-content:center; }
  .funnel-seg{
    position:relative; height:44px; margin:0 auto; display:flex; align-items:center; justify-content:center;
    color:#fff; font-size:12.5px; font-weight:600; text-align:center; transition:width 0.3s ease;
  }
  .funnel-seg .fs-count{ font-family:'Fraunces', serif; font-size:16px; margin-left:6px; }

  /* ---- Listas (hot-list reutilizado por vendas próximas e follow-ups) ---- */
  .hot-list{ display:flex; flex-direction:column; gap:8px; }
  .hot-item{
    display:flex; justify-content:space-between; align-items:center; padding:9px 12px;
    background:var(--bg); border-radius:8px; font-size:13px; cursor:pointer; flex:0 0 auto;
  }
  .hot-item:hover{ background:var(--gold-soft); }
  .hot-item .hi-name{ font-weight:600; }
  .hot-item .hi-meta{ color:var(--ink-soft); font-size:11.5px; }
  .hot-item .hi-val{ font-family:'IBM Plex Mono', monospace; color:var(--pine); font-weight:600; white-space:nowrap; }
  .hot-item .hi-tag{ font-size:10.5px; font-weight:700; padding:2px 7px; border-radius:10px; margin-left:6px; }
  .hot-item .hi-tag.late{ background:var(--terracotta-soft); color:var(--terracotta); }
  .hot-item .hi-tag.today{ background:var(--gold-soft); color:#6b4e0f; }
  .hot-item .hi-tag.soon{ background:var(--bg); color:var(--ink-soft); border:1px solid var(--line); }

  .map-wrap{ display:flex; gap:18px; align-items:center; flex-wrap:wrap; }
  .map-wrap svg{ width:240px; height:auto; flex:0 0 auto; }
  .map-legend{ font-size:12px; color:var(--ink-soft); }
  .map-legend-scale{ display:flex; align-items:center; gap:4px; margin-top:8px; }
  .map-legend-scale .sw{ width:16px; height:12px; border-radius:2px; }
  .map-top-states{ margin-top:10px; display:flex; flex-direction:column; gap:4px; }
  .map-top-states .mts-row{ display:flex; justify-content:space-between; font-size:12px; }

  /* ===== PÁGINA DE COMISSÕES ===== */
  .commission-filter-bar{
    display:flex; align-items:center; gap:12px; margin-bottom:20px; flex-wrap:wrap;
  }
  .commission-month-label{
    font-family:'Fraunces', serif; font-size:18px; color:var(--pine); font-weight:600;
    min-width:180px; text-align:center; text-transform:capitalize;
  }
  .commission-filter-spacer{ flex:1; }
  .commission-month-list{ display:flex; flex-direction:column; gap:16px; }
  .commission-month-group{
    background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:16px 20px;
  }
  .commission-month-group h3{
    font-size:14px; color:var(--pine); margin:0 0 12px 0; text-transform:capitalize;
    display:flex; justify-content:space-between; align-items:center;
  }
  .commission-month-group h3 .cmg-total{ font-family:'IBM Plex Mono', monospace; font-size:13px; color:var(--ink-soft); }
  .commission-row{
    display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:8px;
    background:var(--bg); margin-bottom:6px; font-size:13px; flex-wrap:wrap;
  }
  .commission-row.late{ background:var(--terracotta-soft); }
  .commission-row.received{ opacity:0.6; }
  .commission-row .cr-name{ font-weight:700; flex:1 1 160px; cursor:pointer; }
  .commission-row .cr-name:hover{ text-decoration:underline; }
  .commission-row .cr-parcela{ color:var(--ink-soft); font-size:11.5px; flex:0 0 auto; }
  .commission-row .cr-data{ font-family:'IBM Plex Mono', monospace; font-size:12px; flex:0 0 90px; }
  .commission-row .cr-valor{ font-family:'IBM Plex Mono', monospace; font-weight:600; color:var(--pine); flex:0 0 90px; text-align:right; }
  .commission-row .cr-btn{
    flex:0 0 auto; padding:5px 10px; border-radius:6px; border:1px solid var(--pine);
    background:#fff; color:var(--pine); font-size:11.5px; font-weight:600; cursor:pointer;
  }
  .commission-row .cr-btn.done{ background:var(--pine); color:#fff; }

  .closed-deals-section{ margin-top:28px; }
  .closed-deals-title{ font-size:16px; color:var(--pine); margin:0 0 12px 0; font-family:'Fraunces', serif; }
  .closed-deals-grid{
    display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:12px;
  }
  .closed-deal-card{
    background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:13px 14px;
    cursor:pointer; transition: box-shadow 0.15s ease;
  }
  .closed-deal-card:hover{ box-shadow: 0 4px 14px rgba(31,61,43,0.10); }
  .cdc-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:8px; margin-bottom:6px; }
  .cdc-name{ font-weight:700; font-size:13.5px; }
  .cdc-value{ font-family:'IBM Plex Mono', monospace; font-size:12px; color:var(--pine); margin-bottom:8px; }
  .cdc-progress-bar{ height:6px; background:var(--bg); border-radius:4px; overflow:hidden; margin-bottom:5px; }
  .cdc-progress-fill{ height:100%; background:var(--gold); }
  .cdc-progress-lbl{ font-size:11px; color:var(--ink-soft); display:flex; justify-content:space-between; }
  .closed-deals-empty{ color:var(--ink-soft); font-size:13px; padding:12px 0; }

  /* ===== PÁGINA DE DADOS ===== */
  .dados-table-wrap{
    background:var(--panel); border:1px solid var(--line); border-radius:12px;
    overflow-x:auto; overflow-y:auto; max-height:65vh;
  }
  .dados-table{ width:100%; border-collapse:collapse; font-size:12.5px; white-space:nowrap; }
  .dados-table th{
    text-align:left; padding:10px 12px; background:var(--bg); color:var(--pine);
    font-weight:700; font-size:11px; text-transform:uppercase; letter-spacing:0.03em;
    position:sticky; top:0; border-bottom:1px solid var(--line); z-index:1;
  }
  .dados-table td{ padding:9px 12px; border-bottom:1px solid var(--line); }
  .dados-table tbody tr{ cursor:pointer; }
  .dados-table tbody tr:hover{ background:var(--gold-soft); }
  .dados-table .dt-mono{ font-family:'IBM Plex Mono', monospace; font-size:11.5px; }
  .dados-pagination{
    display:flex; align-items:center; justify-content:center; gap:14px; margin-top:14px; font-size:13px;
  }
  .dados-pagination button:disabled{ opacity:0.4; cursor:default; }
  .dados-table td:first-child, .dados-table th:first-child{ width:32px; text-align:center; }

  .dados-bulk-bar{
    display:flex; align-items:center; gap:10px; flex-wrap:wrap;
    background:var(--gold-soft); border-radius:10px; padding:10px 14px; margin-bottom:14px; font-size:13px;
  }
  .dados-bulk-bar select{
    padding:7px 10px; border-radius:7px; border:1px solid var(--line); background:#fff; font-size:12.5px;
  }

  .colaboradores-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:20px; max-height:220px; overflow-y:auto; }
  .colab-row{
    display:flex; align-items:center; gap:10px; padding:9px 12px; background:var(--bg); border-radius:8px; font-size:13px;
  }
  .colab-row .colab-nome{ font-weight:700; flex:1; }
  .colab-row .colab-pct{ font-family:'IBM Plex Mono', monospace; color:var(--pine); }
  .colab-row .colab-badge{
    font-size:10.5px; padding:2px 8px; border-radius:10px; background:var(--gold-soft); color:#6b4e0f; font-weight:700;
  }
  .colab-row .colab-badge.off{ background:var(--terracotta-soft); color:var(--terracotta); }
  .colab-row button{ background:none; border:none; color:var(--terracotta); cursor:pointer; font-size:13px; }
  .colab-form-title{ font-size:14px; color:var(--pine); margin:18px 0 4px 0; }

  @media (max-width: 640px){
    .dados-table-wrap{ max-height:70vh; }
  }
