  :root{
    --bg:#ffffff;
    --surface:#fafafa;
    --surface-2:#f2f2f2;
    --border:#e6e6e6;
    --black:#0d0d0d;
    --gray-900:#1a1a1a;
    --gray-600:#6e6e6e;
    --gray-400:#a6a6a6;
    --gray-200:#ececec;
    --radius-sm:10px;
    --radius:16px;
    --radius-lg:22px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,.08);
    --shadow-lg: 0 20px 50px rgba(0,0,0,.12);
    --ease: cubic-bezier(.4,0,.2,1);
    --nav-w: 264px;
    --nav-w-collapsed: 84px;
  }
  *{ box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
  html,body{ height:100%; }
  body{
    background: var(--bg);
    color: var(--black);
    font-family:'Inter', system-ui, sans-serif;
    font-size:14px;
    -webkit-font-smoothing:antialiased;
    overflow-x:hidden;
  }
  a{ color:inherit; text-decoration:none; }
  ul{ list-style:none; }
  button{ font-family:inherit; cursor:pointer; border:none; background:none; color:inherit; }
  input,select,textarea{ font-family:inherit; font-size:inherit; color:inherit; }
  ::selection{ background: var(--black); color:#fff; }

  .hidden{ display:none !important; }

  /* ============ SPLASH SCREEN ============ */
  #splash-screen{
    position:fixed; inset:0; background:#fff; z-index:9999;
    display:flex; align-items:center; justify-content:center;
    flex-direction:column; gap:16px;
    transition: opacity .5s ease, visibility .5s ease;
  }
  #splash-screen.hide{ opacity:0; visibility:hidden; pointer-events:none; }
  #splash-screen img{ width:88px; height:auto; }
  #splash-msg{
    font-size:14px; font-weight:600; color:var(--gray-600);
    letter-spacing:.3px; text-align:center;
    min-height:20px;
  }
  /* ============ scrollbars ============ */
  ::-webkit-scrollbar{ width:4px; height:4px; }
  ::-webkit-scrollbar-track{ background:transparent; }
  ::-webkit-scrollbar-thumb{ background:transparent; border-radius:4px; transition:background .2s; }
  *:hover::-webkit-scrollbar-thumb{ background: var(--gray-200); }
  /* Firefox */
  * { scrollbar-width: thin; scrollbar-color: transparent transparent; }
  *:hover { scrollbar-color: var(--gray-200) transparent; }

  /* ==========================================================
     LOGIN
  ========================================================== */
  /* All views hidden by default — JS removes .hidden to show active */
  .view{ display:none; }
  .view:not(.hidden){ display:block; }

  #view-login{
    min-height:100vh;
    display:none;
    align-items:center;
    justify-content:center;
    padding:24px;
    background:
      radial-gradient(circle at 12% 15%, rgba(0,0,0,.035), transparent 40%),
      radial-gradient(circle at 88% 85%, rgba(0,0,0,.035), transparent 40%),
      #ffffff;
  }
  .login-card{
    width:100%; max-width:392px;
    animation: rise .5s var(--ease);
  }
  @keyframes rise{ from{ opacity:0; transform:translateY(14px);} to{opacity:1; transform:translateY(0);} }

  .brand-lockup{
    display:flex; align-items:center; justify-content:center; gap:10px;
    margin:0 auto 26px;
  }
  .brand-lockup .wordmark{ font-size:22px; font-weight:800; letter-spacing:-.4px; color:var(--black); }
  .brand-lockup svg{ width:30px; height:16px; flex-shrink:0; }

  .login-card h1{
    text-align:center; font-size:22px; font-weight:700; letter-spacing:-.2px;
  }
  .login-card .sub{
    text-align:center; color:var(--gray-600); font-size:13.5px; margin-top:6px; margin-bottom:32px;
  }

  .seg{
    display:flex; background: var(--surface-2); border-radius:999px; padding:4px; margin-bottom:24px;
  }
  .seg button{
    flex:1; padding:10px 12px; border-radius:999px; font-size:12.5px; font-weight:600;
    color: var(--gray-600); transition: all .25s var(--ease);
  }
  .seg button.active{ background: var(--black); color:#fff; box-shadow: var(--shadow-sm); }

  .field{ margin-bottom:16px; }
  .field label{ display:block; font-size:12px; font-weight:600; color:var(--gray-600); margin-bottom:7px; }
  .field .input-wrap{
    display:flex; align-items:center; gap:10px;
    border:1.4px solid var(--border); border-radius:12px; padding:13px 14px;
    transition: border-color .2s var(--ease), transform .2s var(--ease);
  }
  .field .input-wrap:focus-within{ border-color: var(--black); transform: translateY(-1px); }
  .field .input-wrap svg{ width:16px; height:16px; color:var(--gray-400); flex-shrink:0; }
  .field input{ border:none; outline:none; width:100%; background:transparent; font-size:14px; }

  .btn-primary{
    width:100%; background: var(--black); color:#fff; padding:14px; border-radius:12px;
    font-weight:700; font-size:14px; margin-top:6px;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), opacity .2s;
    box-shadow: var(--shadow-sm);
  }
  .btn-primary:hover{ transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .btn-primary:active{ transform: translateY(0); }

  .login-foot{ text-align:center; margin-top:20px; font-size:12.5px; color:var(--gray-600); }
  .login-foot a{ font-weight:600; color:var(--black); border-bottom:1px solid var(--black); }
  .login-error{
    background:#fdf2f1; border:1px solid #f0c9c4; color:#a23327; font-size:12.5px; font-weight:600;
    padding:10px 14px; border-radius:10px; margin-bottom:14px; text-align:center;
  }

  /* ==========================================================
     APP SHELL
  ========================================================== */
  #app{ display:none; }
  #app.active{ display:block; }

  .shell{
    display:grid;
    grid-template-columns: var(--nav-w) 1fr;
    min-height:100vh;
    transition: grid-template-columns .3s var(--ease);
  }
  .shell.collapsed{ grid-template-columns: var(--nav-w-collapsed) 1fr; }

  /* ---------- SIDEBAR (desktop) ---------- */
  .sidebar{
    border-right:1px solid var(--border);
    padding:22px 16px;
    display:flex; flex-direction:column;
    position:sticky; top:0; height:100vh;
    overflow-y:auto;
  }
  .side-top{ display:flex; align-items:center; justify-content:center; margin-bottom:26px; padding:0 4px;}
  .side-brand{ display:flex; align-items:center; justify-content:center; overflow:hidden; width:100%; }
  .side-brand img.side-logo-static{ max-width:100%; height:26px; width:auto; object-fit:contain; transition: opacity .2s; display:block; }
  .side-brand img.side-logo-video{ display:none; width:40px; height:40px; object-fit:contain; }
  .shell.collapsed .side-brand img.side-logo-static{ display:none; }
  .shell.collapsed .side-brand img.side-logo-video{ display:block; }
  /* when open, show only static logo */
  .shell:not(.collapsed) .side-brand img.side-logo-video{ display:none !important; }
  .shell:not(.collapsed) .side-brand img.side-logo-static{ display:block !important; }
  .shell.collapsed .side-brand{ position:relative; }
  .shell.collapsed .side-brand::after{
    content:''; width:22px; height:22px; background-image:url('../img/icone-marca.png');
    background-size:contain; background-repeat:no-repeat; background-position:center;
  }
  .side-collapse-wrap{
    display:flex; justify-content:center; padding:14px 0; border-top:1px solid var(--border); margin-top:6px;
  }
  .collapse-btn{
    width:34px; height:34px; border-radius:8px; display:flex; align-items:center; justify-content:center;
    color: var(--black); transition: background .2s, transform .25s var(--ease);
    flex-shrink:0;
  }
  .collapse-btn svg{ width:18px; height:18px; }
  .collapse-btn:hover{ background: var(--surface-2); transform: scale(1.08); }
  .shell.collapsed .collapse-btn svg{ transform: rotate(180deg); }
  .shell.collapsed .side-top{ justify-content:center; }

  .nav-list{ display:flex; flex-direction:column; gap:2px; flex:1; position:relative; }
  .nav-btn{
    display:flex; align-items:center; gap:13px;
    padding:11px 12px; border-radius:11px;
    color: var(--gray-600); font-size:13.5px; font-weight:600;
    transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
    white-space:nowrap; position:relative;
  }
  .nav-btn svg{ width:18px; height:18px; flex-shrink:0; transition: transform .25s var(--ease); }
  .nav-btn:hover{ background: var(--surface-2); color:var(--black); transform: translateX(2px); }
  .nav-btn:hover svg{ transform: scale(1.1); }
  .nav-btn.active{ background: var(--black); color:#fff; }
  .shell.collapsed .nav-btn span{ display:none; }
  .shell.collapsed .nav-btn{ justify-content:center; }

  .side-bottom{ border-top:1px solid var(--border); padding-top:14px; margin-top:10px; }
  .side-user{ display:flex; align-items:center; gap:10px; padding:8px; border-radius:11px; transition: background .2s; }
  .side-user:hover{ background: var(--surface-2); }
  .side-user .av{
    width:34px; height:34px; border-radius:50%; background: var(--black); color:#fff;
    display:flex; align-items:center; justify-content:center; font-weight:700; font-size:12.5px; flex-shrink:0;
  }
  .side-user .who{ overflow:hidden; }
  .side-user .who .n{ font-size:13px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .side-user .who .r{ font-size:11px; color:var(--gray-600); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .shell.collapsed .side-user .who{ display:none; }
  .shell.collapsed .side-user{ justify-content:center; }

  .av-photo{ position:relative; overflow:visible !important; }
  .av-photo img{ width:100%; height:100%; object-fit:cover; border-radius:50%; }
  .av-edit{
    position:absolute; right:-3px; bottom:-3px; width:17px; height:17px; border-radius:50%;
    background: var(--black); color:#fff; display:flex; align-items:center; justify-content:center;
    cursor:pointer; border:2px solid #fff; transition: transform .2s var(--ease);
  }
  .av-edit:hover{ transform: scale(1.15); }
  .av-edit svg{ width:9px; height:9px; }
  .av-edit input{ display:none; }
  .shell.collapsed .av-edit{ display:none; }

  /* ---------- TOPBAR ---------- */
  .topbar{
    display:flex; align-items:center; justify-content:space-between;
    padding:18px 32px; border-bottom:1px solid var(--border);
    position:sticky; top:0; background:rgba(255,255,255,.85); backdrop-filter:blur(8px); z-index:20;
  }
  .topbar .crumb{ font-size:13px; color:var(--gray-600); font-weight:600; }
  .topbar .crumb b{ color:var(--black); }
  .top-actions{ display:flex; align-items:center; gap:14px; }
  .role-demo{
    display:flex; align-items:center; gap:8px; font-size:11.5px; color:var(--gray-600);
    background: var(--surface-2); padding:6px 6px 6px 12px; border-radius:999px;
  }
  .role-demo .seg{ margin:0; padding:3px; background:transparent; }
  .role-demo .seg button{ padding:5px 10px; font-size:11px; }
  .icon-btn{
    width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    transition: background .2s, transform .2s var(--ease);
  }
  .icon-btn:hover{ background: var(--surface-2); transform: scale(1.06); }
  .icon-btn svg{ width:18px; height:18px; }

  .content{ padding:32px; max-width:1280px; margin:0 auto; width:100%; }

  /* ==========================================================
     HOME / WELCOME
  ========================================================== */
  .welcome-wrap{
    display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap;
    padding:6px 2px 26px; animation: fadeUp .5s var(--ease) both;
  }
  @keyframes fadeUp{ from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);} }
  .welcome-wrap h1{
    font-size:26px; font-weight:800; letter-spacing:-.4px;
  }
  .welcome-wrap p{
    color:var(--gray-600); margin-top:5px; font-size:13.5px;
  }
  .welcome-wrap .today-pill{
    font-size:11.5px; font-weight:700; color:var(--gray-600); border:1.2px solid var(--border);
    border-radius:999px; padding:8px 16px; text-transform:capitalize; flex-shrink:0;
  }

  .home-grid{
    display:grid; grid-template-columns: 1fr 1fr; gap:20px; margin-top:8px;
  }

  .card{
    background:#fff; border:1px solid var(--border); border-radius: var(--radius);
    padding:22px; transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s;
  }
  .card:hover{ box-shadow: var(--shadow-md); transform: translateY(-2px); border-color:#d8d8d8; }
  .card-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
  .card-head h2{ font-size:15.5px; font-weight:700; }
  .card-head .link{ font-size:12px; font-weight:600; color:var(--gray-600); transition: color .2s; }
  .card-head .link:hover{ color: var(--black); }

  .bday-section-label{ font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.4px; color:var(--gray-400); margin:14px 0 6px; }
  .bday-section-label:first-child{ margin-top:0; }
  .bday-row{
    display:flex; align-items:center; gap:12px; padding:11px 6px; border-radius:11px;
    transition: background .2s var(--ease);
  }
  .bday-row:hover{ background: var(--surface); }
  .bday-row .av{
    width:38px; height:38px; border-radius:50%; background: var(--surface-2); border:1px solid var(--border);
    display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; flex-shrink:0;
  }
  .bday-row .info .n{ font-size:13px; font-weight:700; }
  .bday-row .info .d{ font-size:11.5px; color:var(--gray-600); }
  .bday-row .tag{
    font-size:11px; font-weight:700; background: var(--black); color:#fff;
    padding:4px 10px; border-radius:999px; flex-shrink:0;
  }
  .bday-row .bday-actions{ display:flex; align-items:center; gap:8px; margin-left:auto; flex-shrink:0; }
  .bday-wa-btn{
    display:flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:50%;
    background:#25D366; border:none; cursor:pointer; flex-shrink:0; transition:transform .15s;
  }
  .bday-wa-btn:hover{ transform:scale(1.08); }
  .bday-wa-btn svg{ width:16px; height:16px; }

  .comm-row{ padding:14px 6px; border-radius:11px; transition: background .2s; border-bottom:1px solid var(--border); }
  .comm-row:last-child{ border-bottom:none; }
  .comm-row:hover{ background: var(--surface); }
  .comm-row .meta{ display:flex; align-items:center; gap:8px; margin-bottom:6px; }
  .comm-row .meta .av{
    width:26px; height:26px; border-radius:50%; background:var(--black); color:#fff; font-size:10.5px; font-weight:700;
    display:flex; align-items:center; justify-content:center;
  }
  .comm-row .meta .author{ font-size:12.5px; font-weight:700; }
  .comm-row .meta .date{ font-size:11px; color:var(--gray-400); margin-left:auto; }
  .comm-row .meta .del-btn{ font-size:10.5px; font-weight:700; color:var(--gray-400); margin-left:8px; cursor:pointer; }
  .comm-row .meta .del-btn:hover{ color:#c0392b; }
  .comm-row .msg{ font-size:13px; color:var(--gray-900); line-height:1.5; }

  /* ==========================================================
     GENERIC PAGE HEADER / BUTTONS
  ========================================================== */
  .page-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; flex-wrap:wrap; gap:14px; }
  .page-head h1{ font-size:22px; font-weight:800; letter-spacing:-.3px; }
  .page-head p{ color:var(--gray-600); font-size:13px; margin-top:4px; }

  .btn-dark{
    display:inline-flex; align-items:center; gap:8px;
    background: var(--black); color:#fff; padding:11px 18px; border-radius:999px;
    font-size:13px; font-weight:700; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  }
  .btn-dark:hover{ transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .btn-dark svg{ width:15px; height:15px; }
  button:disabled, button[disabled]{
    opacity:.45; cursor:not-allowed; filter:grayscale(.3);
  }
  button:disabled:hover{ transform:none !important; box-shadow:none !important; }

  .btn-outline{
    display:inline-flex; align-items:center; gap:8px;
    border:1.4px solid var(--border); padding:10px 16px; border-radius:999px;
    font-size:13px; font-weight:700; transition: border-color .2s, background .2s;
  }
  .btn-outline:hover{ border-color: var(--black); background: var(--surface); }

  .search-bar{
    display:flex; align-items:center; gap:10px; border:1.4px solid var(--border);
    padding:10px 16px; border-radius:999px; width:280px; transition: border-color .2s;
  }
  .search-bar:focus-within{ border-color: var(--black); }
  .search-bar input{ border:none; outline:none; width:100%; background:transparent; }
  .search-bar svg{ width:15px; height:15px; color:var(--gray-400); flex-shrink:0; }

  /* ==========================================================
     LIST TABLE (corretoras / seguradoras / usuarios)
  ========================================================== */
  .list-panel{ border:1px solid var(--border); border-radius: var(--radius); overflow:hidden; }
  .list-toolbar{ display:flex; justify-content:space-between; align-items:center; padding:16px 20px; border-bottom:1px solid var(--border); gap:12px; flex-wrap:wrap; }
  table{ width:100%; border-collapse:collapse; }
  th{ text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.5px; color:var(--gray-600); font-weight:700; padding:12px 20px; border-bottom:1px solid var(--border); background: var(--surface); }
  td{ padding:15px 20px; border-bottom:1px solid var(--border); font-size:13.5px; }
  tbody tr{ transition: background .2s var(--ease); cursor:pointer; }
  tbody tr:hover{ background: var(--surface); }
  tbody tr:last-child td{ border-bottom:none; }
  .cell-strong{ font-weight:700; }
  .cell-sub{ font-size:11.5px; color:var(--gray-600); margin-top:2px; }
  .row-avatar{ display:flex; align-items:center; gap:12px; }
  .row-avatar .av{ width:36px; height:36px; border-radius:50%; background:var(--surface-2); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; }
  .chip{ display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:700; padding:5px 11px; border-radius:999px; border:1.2px solid var(--border); }
  .chip.on::before{ content:''; width:6px; height:6px; border-radius:50%; background:var(--black); }

  /* ==========================================================
     FORM (cadastro de corretora)
  ========================================================== */
  .form-section{ border:1px solid var(--border); border-radius: var(--radius); padding:26px; margin-bottom:20px; }
  .form-section h3{ font-size:15px; font-weight:800; margin-bottom:4px; }
  .form-section .hint{ font-size:12px; color:var(--gray-600); margin-bottom:20px; }
  .form-grid{ display:grid; grid-template-columns: repeat(2,1fr); gap:16px; }
  .form-grid.cols-3{ grid-template-columns: repeat(3,1fr); }
  .f-field label{ display:block; font-size:12px; font-weight:700; color:var(--gray-600); margin-bottom:7px; }
  .f-field input, .f-field select, .f-field textarea{
    width:100%; border:1.4px solid var(--border); border-radius:11px; padding:12px 14px; outline:none;
    transition: border-color .2s var(--ease), transform .2s var(--ease); background:#fff;
  }
  .f-field input:focus, .f-field select:focus, .f-field textarea:focus{ border-color: var(--black); transform: translateY(-1px); }
  .f-field.full{ grid-column: 1 / -1; }

  .chip-check{
    display:flex; flex-wrap:wrap; gap:9px;
  }
  .chip-check label{
    border:1.4px solid var(--border); border-radius:999px; padding:9px 15px; font-size:12.5px; font-weight:600;
    cursor:pointer; transition: all .2s var(--ease); display:flex; align-items:center; gap:7px;
  }
  .chip-check input{ display:none; }
  .chip-check input:checked + span{ font-weight:700; }
  .chip-check label:has(input:checked){ background: var(--chip-cor, var(--black)); color:#fff; border-color: var(--chip-cor, var(--black)); }
  .chip-check label:hover{ border-color: var(--black); }
  .chip-check.locked label{ opacity:.6; cursor:not-allowed; }
  .chip-check.locked label:hover{ border-color: var(--border); }

  .toggle-row{ display:flex; align-items:center; gap:12px; font-size:13px; cursor:pointer; }
  .toggle-row input{ width:38px; height:22px; appearance:none; background: var(--surface-2); border-radius:999px; position:relative; outline:none; cursor:pointer; transition: background .2s; flex-shrink:0; }
  .toggle-row input::after{ content:''; position:absolute; top:2px; left:2px; width:18px; height:18px; background:#fff; border-radius:50%; transition: transform .2s; box-shadow:0 1px 3px rgba(0,0,0,.3); }
  .toggle-row input:checked{ background: var(--black); }
  .toggle-row input:checked::after{ transform: translateX(16px); }
  .toggle-row input:disabled{ opacity:.5; cursor:not-allowed; }

  .team-row{ display:grid; grid-template-columns: 1.4fr 1fr 1.4fr 1fr 1fr auto; gap:14px; align-items:center; margin-bottom:12px; }
  .team-row.team-row-seguradora{ grid-template-columns: 1.2fr 1fr 1.2fr 1fr 1fr 1fr auto; }
  .team-row-header.team-row-seguradora{ grid-template-columns: 1.2fr 1fr 1.2fr 1fr 1fr 1fr auto; }
  .team-row input{ min-width:0; }
  .team-row-header{ display:grid; grid-template-columns: 1.4fr 1fr 1.4fr 1fr 1fr auto; gap:14px; margin-bottom:8px; }
  .team-row-header span{ font-size:11px; font-weight:700; color:var(--gray-600); text-transform:uppercase; letter-spacing:.3px; }
  .team-row input{ border:1.4px solid var(--border); border-radius:10px; padding:10px 12px; outline:none; width:100%; transition:border-color .2s; }
  .team-row input:focus{ border-color:var(--black); }
  .icon-x{ width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--gray-400); transition: background .2s, color .2s; }
  .icon-x:hover{ background: var(--surface-2); color:var(--black); }

  .dropzone{
    border:1.6px dashed var(--border); border-radius: var(--radius); padding:36px; text-align:center;
    color:var(--gray-600); font-size:13px; transition: border-color .2s, background .2s;
  }
  .dropzone:hover{ border-color: var(--black); background: var(--surface); }
  .dropzone svg{ width:26px; height:26px; margin-bottom:10px; }

  .form-actions{ display:flex; justify-content:flex-end; gap:12px; margin-top:6px; }

  /* ==========================================================
     CRM KANBAN
  ========================================================== */
  .kanban{ display:grid; grid-template-columns: repeat(3, 1fr); gap:18px; align-items:start; }
  .kcol{ background: var(--surface); border-radius: var(--radius); padding:16px; min-height:120px; transition: background .2s; }
  .kcol.dragover{ background: var(--surface-2); }
  .kcol-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; padding:0 4px; }
  .kcol-head h3{ font-size:12.5px; text-transform:uppercase; letter-spacing:.6px; font-weight:800; color:var(--gray-600); }
  .kcol-head .count{ font-size:11px; background:#fff; border:1px solid var(--border); padding:2px 8px; border-radius:999px; font-weight:700; }
  .kcard{
    background:#fff; border:1px solid var(--border); border-radius:13px; padding:14px; margin-bottom:12px;
    cursor:grab; transition: box-shadow .2s var(--ease), transform .2s var(--ease);
  }
  .kcard:hover{ box-shadow: var(--shadow-md); transform: translateY(-2px); }
  .kcard:active{ cursor:grabbing; }
  .kcard .t{ font-size:13px; font-weight:700; margin-bottom:6px; }
  .kcard .m{ font-size:11.5px; color:var(--gray-600); }
  .kcard .tags{ display:flex; gap:6px; margin-top:10px; }
  .kcard .tags span{ font-size:10px; font-weight:700; background: var(--surface-2); padding:3px 8px; border-radius:999px; }
  .kcard-membros{ display:flex; gap:5px; margin-top:10px; }
  .kcard-avatar{
    width:24px; height:24px; border-radius:50%; background:var(--black); color:#fff;
    display:flex; align-items:center; justify-content:center; font-size:9.5px; font-weight:800;
    border:2px solid #fff; box-shadow:0 0 0 1px var(--border);
  }
  .add-card-btn{
    width:100%; text-align:left; padding:10px 12px; border-radius:11px; font-size:12.5px; font-weight:700; color:var(--gray-600);
    border:1.4px dashed var(--border); transition: border-color .2s, color .2s;
  }
  .add-card-btn:hover{ border-color: var(--black); color: var(--black); }

  /* ---- FUNIL DE RENOVAÇÕES (pipeline) ---- */
  .kanban-funil{
    display:grid; grid-auto-flow:column; grid-auto-columns:minmax(230px,1fr);
    gap:14px; align-items:start; overflow-x:auto; padding-bottom:6px;
  }
  .kanban-funil .kcol{ min-width:230px; border-top:4px solid var(--kcol-cor, var(--border)); }
  .kanban-funil .kcol-head .count{ background: color-mix(in srgb, var(--kcol-cor, var(--gray-600)) 15%, #fff); color: var(--kcol-cor, var(--gray-600)); border-color: color-mix(in srgb, var(--kcol-cor, var(--gray-600)) 30%, #fff); }
  .kcol-total{ font-size:11px; font-weight:700; color:var(--kcol-cor, var(--gray-600)); padding:0 4px; margin:-8px 0 12px; }
  .kanban-funil .kcard{ border-left:3px solid var(--kcol-cor, var(--border)); }
  .kanban-funil .kcard .m{ margin-top:2px; }
  .kanban-funil .kcard .tags span{ background:transparent; padding:0; font-weight:800; }
  .kcard-valor{ display:inline-block; font-size:11px; font-weight:800; background:var(--surface-2); padding:2px 8px; border-radius:999px; margin-top:8px; }

  /* ---- CAMPANHAS ---- */
  .campanha-card{
    background:#fff; border:1px solid var(--border); border-radius:16px; padding:20px;
    cursor:pointer; transition: box-shadow .2s, transform .15s;
  }
  .campanha-card:hover{ box-shadow: var(--shadow-md); transform: translateY(-2px); }
  .progress-track{ width:100%; height:9px; border-radius:999px; background: var(--surface-2); overflow:hidden; }
  .progress-fill{ height:100%; border-radius:999px; background: var(--black); transition: width .3s var(--ease); }
  .progress-fill.warn{ background:#b45309; }
  .progress-fill.danger{ background:#dc2626; }
  .progress-fill.ok{ background:#15803d; }
  .meta-row{ display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid var(--border); }
  .meta-row:last-child{ border-bottom:none; }
  .meta-row .nome{ flex:0 0 160px; font-size:12.5px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .meta-row .bar{ flex:1; }
  .meta-row .pct{ flex:0 0 52px; text-align:right; font-size:12px; font-weight:800; }
  .campanha-status-chip{ font-size:10.5px; font-weight:800; padding:4px 10px; border-radius:999px; text-transform:uppercase; letter-spacing:.4px; }
  .campanha-status-chip.agendada{ background:#eef2ff; color:#4338ca; }
  .campanha-status-chip.ativa{ background:#ecfdf5; color:#15803d; }
  .campanha-status-chip.encerrada{ background:var(--surface-2); color:var(--gray-600); }

  .wa-btn{
    display:flex; align-items:center; justify-content:center; gap:6px; width:100%; margin-top:10px;
    padding:8px; border-radius:9px; border:1.2px solid rgba(37,211,102,.35); font-size:11.5px; font-weight:700;
    transition: background .2s, color .2s, border-color .2s, transform .15s;
  }
  .wa-btn svg{ width:13px; height:13px; }
  .wa-btn:hover{ background: var(--black); color:#fff; border-color:var(--black); transform: translateY(-1px); }

  .attach-list{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
  .attach-list:empty{ display:none; }
  .attach-list span{
    display:inline-flex; align-items:center; gap:4px; font-size:10.5px; font-weight:700;
    background: var(--surface-2); padding:4px 9px; border-radius:999px; max-width:140px;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  .attach-chip-list{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
  .attach-chip-list .chip-file{
    display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:600;
    background: var(--surface-2); padding:6px 10px 6px 12px; border-radius:999px; max-width:220px;
  }
  .attach-chip-list .chip-file span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .attach-chip-list .chip-file button{ color:var(--gray-600); font-weight:800; line-height:1; }
  .attach-chip-list .chip-file button:hover{ color:#c0392b; }
  .kcard{ cursor:pointer; }

  /* ==========================================================
     MATERIAL / FILES GRID
  ========================================================== */
  .files-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap:16px; }
  .file-card{
    border:1px solid var(--border); border-radius: var(--radius); padding:18px; text-align:center;
    transition: box-shadow .25s var(--ease), transform .25s var(--ease); position:relative;
  }
  .file-card:hover{ box-shadow: var(--shadow-md); transform: translateY(-3px); }
  .file-card .ext{
    width:46px; height:46px; border-radius:12px; background: var(--black); color:#fff; font-size:11px; font-weight:800;
    display:flex; align-items:center; justify-content:center; margin:0 auto 12px;
  }
  .file-card .name{ font-size:12.5px; font-weight:700; }
  .file-card .meta{ font-size:11px; color:var(--gray-600); margin-top:4px; }
  .file-card .del-file{ position:absolute; top:8px; right:10px; font-size:11px; font-weight:700; color:var(--gray-400); cursor:pointer; }
  .file-card .del-file:hover{ color:#c0392b; }

  .material-seguradora-block{ margin-bottom:32px; }
  .material-seguradora-head{ display:flex; align-items:center; gap:12px; margin-bottom:16px; }
    .material-seguradora-head .logo{
    width:80px; height:36px; border-radius:8px; background:#fff; border:1px solid var(--border);
    display:flex; align-items:center; justify-content:center;
    color:var(--gray-600); font-size:11px; font-weight:800; flex-shrink:0; overflow:hidden;
  }
  .material-seguradora-head .logo img{ width:100%; height:100%; object-fit:contain; padding:2px; }
  .material-seguradora-head h3{ font-size:15px; font-weight:800; margin:0; }
  .material-seguradora-head .count{ font-size:11.5px; color:var(--gray-600); }

  .crop-square-wrap{
    width:280px; height:280px; margin:0 auto; border-radius:16px; overflow:hidden;
    border:1.4px solid var(--border); cursor:grab; touch-action:none; background:var(--surface-2);
  }
  .crop-square-wrap:active{ cursor:grabbing; }
  .crop-square-wrap canvas{ width:280px; height:280px; display:block; }

  /* ==========================================================
     PRODUCAO
  ========================================================== */
  .filters-row{ display:flex; align-items:center; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
  .select-pill{
    border:1.4px solid var(--border); border-radius:999px; padding:9px 16px; font-size:12.5px; font-weight:700;
    display:flex; align-items:center; gap:8px; transition: border-color .2s;
  }
  .select-pill select{ border:none; outline:none; background:transparent; font-weight:700; }
  .kpis-row{ display:grid; grid-template-columns: repeat(4,1fr); gap:16px; margin-bottom:22px; }
  .kpi-mini{ border:1px solid var(--border); border-radius: var(--radius); padding:18px; transition: box-shadow .2s, transform .2s; }
  .kpi-mini:hover{ box-shadow: var(--shadow-md); transform: translateY(-2px); }
  .kpi-mini .l{ font-size:11.5px; color:var(--gray-600); margin-bottom:8px; }
  .kpi-mini .v{ font-size:24px; font-weight:800; }
  .bars{ display:flex; align-items:flex-end; gap:10px; height:150px; padding:20px 4px 0; }
  .bar{ flex:1; background: var(--surface-2); border-radius:8px 8px 3px 3px; position:relative; transition: background .2s, transform .3s var(--ease); }
  .bar:hover{ background: var(--black); transform: scaleY(1.02); }
  .bar span{ position:absolute; bottom:100%; left:50%; transform:translateX(-50%); font-size:10.5px; font-weight:700; margin-bottom:6px; white-space:nowrap; }
  .bar em{ position:absolute; top:100%; left:50%; transform:translateX(-50%); margin-top:8px; font-size:10.5px; color:var(--gray-600); font-style:normal; }

  /* ==========================================================
     MOBILE BOTTOM NAV + APP FEEL
  ========================================================== */
  .bottom-nav{
    display:none;
    position:fixed; bottom:0; left:0; right:0; z-index:50;
    background:rgba(255,255,255,.92); backdrop-filter:blur(14px);
    border-top:1px solid var(--border);
    padding:8px 6px calc(8px + env(safe-area-inset-bottom));
    justify-content:space-around;
  }
  .bn-item{
    display:flex; flex-direction:column; align-items:center; gap:4px; padding:6px 10px; border-radius:14px;
    color: var(--gray-400); font-size:10.5px; font-weight:700; transition: color .2s, transform .15s;
    flex:1;
  }
  .bn-item svg{ width:21px; height:21px; transition: transform .2s var(--ease); }
  .bn-item.active{ color: var(--black); }
  .bn-item:active svg{ transform: scale(.85); }

  .sheet-overlay{
    display:none; position:fixed; inset:0; background:rgba(0,0,0,.35); z-index:60;
    animation: fadeIn .2s var(--ease);
  }
  @keyframes fadeIn{ from{opacity:0;} to{opacity:1;} }
  .sheet{
    position:fixed; left:0; right:0; bottom:0; background:#fff; border-radius:22px 22px 0 0; z-index:61;
    padding:10px 20px calc(24px + env(safe-area-inset-bottom));
    transform: translateY(100%); transition: transform .32s var(--ease);
    max-height:70vh; overflow-y:auto;
  }
  .sheet.open{ transform: translateY(0); }
  .sheet .handle{ width:38px; height:4px; background: var(--gray-200); border-radius:99px; margin:8px auto 18px; }
  .sheet .nav-btn{ padding:14px 10px; font-size:14px; }

  /* ==========================================================
     MODAL GENÉRICO
  ========================================================== */
  .modal-overlay{
    display:none; position:fixed; inset:0; background:rgba(10,10,10,.45); z-index:80;
    align-items:center; justify-content:center; padding:20px; animation: fadeIn .2s var(--ease);
  }
  .modal-overlay.open{ display:flex; }
  #modal-custom-alert{ z-index:300; }
  #modal-custom-alert .modal-box{ text-align:center; }
  #modal-custom-alert .custom-alert-icone{ font-size:32px; margin-bottom:10px; }
  #modal-custom-alert p{ font-size:14px; line-height:1.6; white-space:pre-wrap; color:var(--black); margin:0 0 20px; }
  .modal-box{
    background:#fff; border-radius:20px; width:100%; max-width:460px; padding:26px;
    max-height:88vh; overflow-y:auto; box-shadow: var(--shadow-lg);
    animation: rise .3s var(--ease);
  }
  .modal-box h3{ font-size:17px; font-weight:800; margin-bottom:18px; }
  .modal-box .f-field{ margin-bottom:14px; }
  .modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }
  .modal-close{
    position:absolute; }

  .modal-box-lg{ max-width:600px; }
  .modal-box-xl{ max-width:880px; }

  /* ---- Seletor múltiplo com busca (substitui <select multiple> nativo) ---- */
  .ms-box{ position:relative; border:1.4px solid var(--border); border-radius:11px; padding:8px 10px; background:#fff; }
  .ms-chips{ display:flex; flex-wrap:wrap; gap:6px; }
  .ms-chips:not(:empty){ margin-bottom:6px; }
  .ms-chip{ display:inline-flex; align-items:center; gap:6px; background:var(--black); color:#fff; padding:4px 6px 4px 10px; border-radius:999px; font-size:12px; font-weight:600; max-width:220px; }
  .ms-chip span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .ms-chip button{ background:rgba(255,255,255,.2); border:none; color:#fff; border-radius:50%; width:16px; height:16px; font-size:10px; cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; line-height:1; flex-shrink:0; }
  .ms-search{ width:100%; border:none; outline:none; font-size:13px; font-family:inherit; padding:4px 2px; }
  .ms-dropdown{ position:absolute; top:100%; left:0; right:0; background:#fff; border:1.4px solid var(--border); border-radius:11px; margin-top:4px; max-height:220px; overflow-y:auto; box-shadow:var(--shadow-lg); z-index:80; }
  .ms-option{ padding:9px 14px; font-size:13px; cursor:pointer; }
  .ms-option:hover{ background:var(--surface-2); }
  .ms-option-empty{ padding:9px 14px; font-size:12.5px; color:var(--gray-600); }
  .tab-strip{ display:flex; gap:4px; border-bottom:1px solid var(--border); margin-bottom:20px; }
  /* Mantém o tamanho da janela fixo ao trocar de aba (Tarefas/Pipeline) — sem
     isso, a aba "Anexos"/"Histórico" (mais curtas) faziam o modal encolher. */
  .tab-pane{ min-height:420px; }
  .tab-strip button{
    padding:9px 14px; font-size:12.5px; font-weight:700; color:var(--gray-600);
    border-bottom:2px solid transparent; margin-bottom:-1px; transition: color .15s, border-color .15s;
  }
  .tab-strip button:hover{ color:var(--black); }
  .tab-strip button.active{ color:var(--black); border-bottom-color:var(--black); }
  .tab-pane.hidden{ display:none; }

  .history-list{ display:flex; flex-direction:column; gap:14px; max-height:340px; overflow-y:auto; }
  .history-item{ display:flex; gap:12px; }
  .history-item .dot-col{ display:flex; flex-direction:column; align-items:center; }
  .history-item .dot{ width:8px; height:8px; border-radius:50%; background:var(--black); margin-top:5px; flex-shrink:0; }
  .history-item .line{ width:1px; flex:1; background:var(--border); margin-top:4px; }
  .history-item .txt{ font-size:12.5px; padding-bottom:2px; }
  .history-item .txt .when{ font-size:10.5px; color:var(--gray-600); display:block; margin-top:2px; }

  /* checkbox list (contatos de marketing) */
  .contact-row{ display:flex; align-items:center; gap:12px; padding:12px 6px; border-bottom:1px solid var(--border); }
  .contact-row:last-child{ border-bottom:none; }
  .contact-row input[type="checkbox"]{ width:17px; height:17px; accent-color: var(--black); }
  .contact-row .name{ font-weight:700; font-size:13px; }
  .contact-row .num{ font-size:11.5px; color:var(--gray-600); }

  /* pílula de status de assinatura — preto e branco, distinguidos por peso/textura */
  .sub-pill{ display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:800; padding:5px 12px; border-radius:999px; border:1.2px solid var(--border); white-space:nowrap; }
  .sub-pill.ok{ background:#fff; color:var(--black); border-color:var(--border); }
  .sub-pill.ok::before{ content:''; width:6px; height:6px; border-radius:50%; background:var(--black); }
  .sub-pill.warn{ background:var(--black); color:#fff; border-color:var(--black); }
  .sub-pill.warn::before{ content:''; width:6px; height:6px; border-radius:50%; background:#fff; }
  .sub-pill.expired{ background:#fff; color:var(--black); border:1.4px dashed var(--black); }
  .sub-pill.expired::before{ content:''; width:6px; height:6px; border-radius:50%; background:var(--black); }
  .sub-pill.suspended{ background:var(--surface-2); color:var(--gray-600); border-color:var(--border); }
  .sub-pill.suspended::before{ content:''; width:6px; height:6px; border-radius:50%; background:var(--gray-400); }

  .access-btn, .btn-sm{
    font-size:11.5px; font-weight:700; padding:7px 13px; border-radius:999px; border:1.2px solid var(--border);
    transition: all .2s var(--ease); white-space:nowrap;
  }
  .access-btn:hover, .btn-sm:hover{ border-color: var(--black); background: var(--surface); }
  .btn-sm.primary{ background:var(--black); color:#fff; border-color:var(--black); }
  .btn-sm.primary:hover{ opacity:.85; background:var(--black); }

  .checklist{ display:flex; flex-wrap:wrap; gap:8px; }
  .chk-item{
    display:flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600;
    padding:7px 12px; border-radius:999px; border:1.2px solid var(--border); cursor:pointer;
  }
  .chk-item input{ margin:0; }

  .perm-list{ border:1.4px solid var(--border); border-radius:14px; overflow:hidden; }
  .perm-row{ display:flex; align-items:center; gap:12px; padding:12px 16px; cursor:pointer; border-bottom:1px solid var(--border); transition:background .15s; }
  .perm-row:last-child{ border-bottom:none; }
  .perm-row:hover{ background:var(--surface-2); }
  .perm-row-icon{ display:flex; width:19px; height:19px; color:var(--gray-600); flex-shrink:0; }
  .perm-row-icon svg{ width:100%; height:100%; }
  .perm-row-label{ flex:1; font-size:13.5px; font-weight:600; }
  .perm-row input[type=checkbox]{
    width:38px; height:22px; appearance:none; background:var(--surface-2); border-radius:999px;
    position:relative; outline:none; cursor:pointer; transition:background .2s; flex-shrink:0; margin:0;
  }
  .perm-row input[type=checkbox]::after{ content:''; position:absolute; top:2px; left:2px; width:18px; height:18px; background:#fff; border-radius:50%; transition:transform .2s; box-shadow:0 1px 3px rgba(0,0,0,.3); }
  .perm-row input[type=checkbox]:checked{ background:var(--black); }
  .perm-row input[type=checkbox]:checked::after{ transform:translateX(16px); }

  .permissoes-layout{ display:grid; grid-template-columns:280px 1fr; gap:20px; align-items:start; }
  .permissoes-users{ border:1.4px solid var(--border); border-radius:14px; overflow:hidden; }
  .permissoes-user-row{ display:flex; align-items:center; gap:10px; padding:13px 16px; cursor:pointer; border-bottom:1px solid var(--border); transition:background .15s; }
  .permissoes-user-row:last-child{ border-bottom:none; }
  .permissoes-user-row:hover{ background:var(--surface-2); }
  .permissoes-user-row.active{ background:var(--black); color:#fff; }
  .permissoes-user-row.active .hint{ color:rgba(255,255,255,.7); }
  .permissoes-detail{ border:1.4px solid var(--border); border-radius:14px; padding:24px; min-height:320px; }
  @media (max-width:760px){ .permissoes-layout{ grid-template-columns:1fr; } }

  .tag-list{ display:flex; flex-wrap:wrap; gap:9px; margin-bottom:14px; min-height:2px; }
  .tag-chip{
    display:inline-flex; align-items:center; gap:9px; padding:8px 8px 8px 16px;
    border-radius:999px; background:var(--black); color:#fff; font-size:13px; font-weight:600;
    letter-spacing:.1px; animation: tagPop .18s ease;
  }
  .tag-chip button{
    display:flex; align-items:center; justify-content:center; width:20px; height:20px;
    border-radius:50%; background:rgba(255,255,255,.16); color:#fff; border:none; cursor:pointer;
    font-size:12px; line-height:1; transition:background .15s ease;
  }
  .tag-chip button:hover{ background:rgba(255,255,255,.32); }
  @keyframes tagPop{ from{ transform:scale(.85); opacity:0; } to{ transform:scale(1); opacity:1; } }
  .tag-add-row{ display:flex; gap:10px; }
  .tag-add-row input{
    flex:1; padding:11px 14px; border-radius:10px; border:1.4px solid var(--border);
    font-size:13.5px; font-family:inherit;
  }
  .tag-add-row input:focus{ outline:none; border-color:var(--black); }
  .tag-empty-hint{ font-size:12.5px; color:var(--gray-600); margin:0 0 12px; }

  .comp-picker{ display:flex; flex-direction:row; gap:8px; align-items:center; }
  .comp-picker > select{
    flex:1; padding:11px 14px; border-radius:12px; border:1.6px solid var(--border);
    font-size:13.5px; font-family:inherit; font-weight:700; background:#fff;
    appearance:none; -webkit-appearance:none; cursor:pointer;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e6e' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 12px center;
    padding-right:32px;
    transition:border-color .2s, box-shadow .2s;
  }
  .comp-picker > select:focus{ outline:none; border-color:var(--black); box-shadow:0 0 0 3px rgba(0,0,0,.07); }
  .comp-picker > select:hover{ border-color:var(--gray-400); }
  .comp-picker > input[type=month]{ display:none; }

  .seg-picker-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(112px,1fr)); gap:10px; margin-bottom:18px; }
  .seg-card{
    display:flex; flex-direction:column; align-items:stretch; gap:8px; padding:10px;
    border:1.6px solid var(--border); border-radius:12px; background:#fff; cursor:pointer;
    font-family:inherit; transition:border-color .15s, transform .1s, box-shadow .15s;
  }
  .seg-card:hover{ border-color:var(--gray-400); }
  .seg-card.active{ border-color:var(--black); box-shadow:0 0 0 1.5px var(--black); }
  .seg-card:active{ transform:scale(.97); }
  .seg-card-logo{
    width:100%; height:44px; border-radius:8px; background:#fff;
    border:1px solid var(--border);
    overflow:hidden;
    display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:800; color:var(--gray-600);
    flex-shrink:0;
  }
  .seg-card-logo img{ width:100%; height:100%; object-fit:contain; padding:4px; }
  .seg-card-name{ font-size:11.5px; font-weight:700; text-align:center; line-height:1.25; }

  .logo-upload-row{ display:flex; align-items:center; gap:16px; }
  .logo-preview{
    width:160px; height:54px; border-radius:10px; background:#fff; overflow:hidden; flex-shrink:0;
    display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:800; color:var(--gray-600);
    border:1.4px solid var(--border);
  }
  .logo-preview img{ width:100%; height:100%; object-fit:contain; padding:5px; }

  .status-dot{ display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:7px; vertical-align:middle; }
  .status-dot.ok{ background:#22c55e; }
  .status-dot.warn{ background:#f59e0b; }
  .status-dot.expired{ background:#ef4444; }

  .ind-badge{
    display:inline-flex; align-items:center; justify-content:center; width:21px; height:21px;
    border-radius:50%; font-size:10px; font-weight:800; margin-right:4px;
    background:var(--surface-2); color:var(--gray-400); border:1px solid var(--border);
  }
  .ind-badge.active{ background:var(--black); color:#fff; border-color:var(--black); }

  /* billing notification banner */
  .notice-banner{
    display:flex; align-items:center; gap:12px; background: var(--black); color:#fff;
    padding:14px 20px; border-radius: var(--radius); margin-bottom:22px;
  }
  .notice-banner svg{ width:18px; height:18px; flex-shrink:0; }
  .notice-banner .txt{ font-size:13px; font-weight:600; flex:1; }
  .notice-banner a{ font-size:12px; font-weight:700; text-decoration:underline; flex-shrink:0; }
  .notice-banner.hidden{ display:none; }

  /* linhas de cobrança por corretora */
  .billing-row{
    border:1px solid var(--border); border-radius: var(--radius); padding:18px 20px; margin-bottom:14px;
    transition: box-shadow .2s var(--ease), border-color .2s;
  }
  .billing-row:hover{ box-shadow: var(--shadow-md); border-color:#d8d8d8; }
  .billing-row-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
  .billing-row-top .bname{ font-weight:800; font-size:14px; }
  .billing-row-top .bsub{ font-size:11.5px; color:var(--gray-600); margin-top:3px; }
  .billing-row-actions{ display:flex; gap:8px; margin-top:14px; flex-wrap:wrap; align-items:center; }
  .billing-row-actions input{
    flex:1; min-width:220px; border:1.4px solid var(--border); border-radius:9px; padding:9px 12px;
    font-size:12.5px; outline:none; transition: border-color .2s;
  }
  .billing-row-actions input:focus{ border-color: var(--black); }
  .billing-history{
    margin-top:12px; padding-top:12px; border-top:1px dashed var(--border);
    font-size:11px; color:var(--gray-600); display:flex; flex-direction:column; gap:4px;
  }
  .task-box{
    display:flex; align-items:center; gap:10px; background: var(--black); color:#fff;
    padding:11px 15px; border-radius:11px; margin-top:14px; font-size:12.5px;
  }
  .task-box svg{ width:16px; height:16px; flex-shrink:0; }
  .task-box b{ font-weight:800; }

  /* ==========================================================
     RESPONSIVE
  ========================================================== */
  /* ─── 980 px: tablets ─── */
  /* ════════════════════════════════════════════
     TABLET  ≤ 980 px
  ════════════════════════════════════════════ */
  @media (max-width: 980px){
    .home-grid,
    .kanban,
    .form-grid,
    .form-grid.cols-3{ grid-template-columns:1fr; }
    .files-grid{ grid-template-columns:repeat(2,1fr); }
    .kpis-row{ grid-template-columns:repeat(2,1fr) !important; gap:12px; }
    .producao-rankings-grid,
    #producao-rankings{ grid-template-columns:1fr !important; }
    .rank-grid{ grid-template-columns:1fr !important; }
  }

  /* ════════════════════════════════════════════
     MOBILE / iPHONE  ≤ 760 px
     Base: iPhone 14 = 390 px logical width
  ════════════════════════════════════════════ */
  @media (max-width: 760px){

    /* ── Shell & layout ── */
    .sidebar{ display:none !important; }
    .shell, .shell.collapsed{ grid-template-columns:1fr !important; }
    .role-demo{ display:none; }
    /* safe-area-inset-bottom for iPhone home bar */
    .content{
      padding: 14px 14px calc(90px + env(safe-area-inset-bottom));
      max-width:100%; overflow-x:hidden;
    }

    /* ── Topbar ── */
    .topbar{
      padding:12px 14px 12px;
      gap:8px;
    }
    .topbar .crumb{ font-size:11.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:160px; }
    .top-actions{ gap:6px; }
    .icon-btn{ width:34px; height:34px; }

    /* ── Bottom nav ── */
    .bottom-nav.show{ display:flex; }
    .bn-item{ gap:3px; padding:4px 6px; }
    .bn-item svg{ width:19px; height:19px; }

    /* ── PAGE HEAD ── */
    .page-head{
      flex-direction:column; align-items:stretch;
      gap:10px; margin-bottom:14px;
    }
    .page-head > div:first-child h1{ font-size:17px; letter-spacing:-.2px; }
    .page-head > div:first-child p{ font-size:11.5px; }
    /* Button container inside page-head → full width, wrap */
    .page-head > div:not(:first-child),
    .page-head > button,
    .page-head > a{
      display:flex; flex-wrap:wrap; gap:7px; width:100%;
    }
    .page-head > div:not(:first-child) > button,
    .page-head > div:not(:first-child) > a,
    .page-head > button,
    .page-head > a{
      flex:1; min-width:0; justify-content:center; text-align:center; font-size:12.5px; padding:10px 10px;
    }
    .producao-btns{ width:100%; flex-wrap:wrap; }
    .producao-btns > button{ flex:1; min-width:calc(50% - 4px); font-size:12px; padding:9px 8px; }

    /* ── HOME ── */
    .welcome-wrap{ flex-direction:column; align-items:flex-start; padding:0 0 14px; gap:6px; }
    .welcome-wrap h1{ font-size:19px; }
    .welcome-wrap .today-pill{ font-size:11px; padding:5px 11px; }
    .home-grid{ grid-template-columns:1fr; gap:10px; }
    .card{ padding:16px; }
    /* Quick access grid: 3 per row on iPhone */
    #quick-access-grid{ grid-template-columns:repeat(3,1fr) !important; gap:8px !important; }
    .qa-card{ padding:12px 6px; }
    .qa-name{ font-size:10.5px; }

    /* ── FORMS ── */
    .form-grid, .form-grid.cols-3{ grid-template-columns:1fr !important; gap:10px; }
    .f-field input, .f-field select, .f-field textarea{ padding:11px 12px; font-size:14px; }
    .form-section{ padding:14px; margin-bottom:14px; }
    .form-section h3{ font-size:14px; }
    /* Team row: stacks vertically */
    .team-row{ grid-template-columns:1fr 1fr; gap:7px; }
    .team-row input:nth-child(3),
    .team-row input:nth-child(4),
    .team-row input:nth-child(5){ grid-column: span 1; }
    .team-row .icon-x{ grid-column: span 2; justify-self:end; }
    /* Form actions: always full width on mobile */
    .form-actions{ flex-direction:column; gap:8px; }
    .form-actions button{ width:100%; justify-content:center; }

    /* ── SEARCH / TOOLBAR / FILTERS ── */
    .search-bar{ width:100%; border-radius:12px; }
    .list-toolbar{
      flex-direction:column; align-items:stretch;
      gap:8px; padding:10px 12px;
    }
    .list-toolbar > .search-bar{ flex:none; }
    .list-toolbar > button{ align-self:stretch; justify-content:center; }
    .filters-row{ flex-direction:column; align-items:stretch; gap:7px; }
    .filters-row .select-pill{
      width:100%; border-radius:12px; padding:10px 14px;
    }
    .filters-row .select-pill select{ width:100%; min-width:0; }
    .filters-row > button{ align-self:stretch; justify-content:center; }

    /* ── TABLES ── */
    .list-panel{ overflow:hidden; border-radius:12px; }
    .list-panel table{
      display:block; overflow-x:auto; -webkit-overflow-scrolling:touch;
      width:100%; min-width:480px;
    }
    table th{ padding:10px 14px; font-size:10.5px; }
    table td{ padding:12px 14px; font-size:13px; }
    .list-table-wrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
    /* access buttons in user table: smaller */
    .access-btn{ font-size:11.5px; padding:5px 9px; }

    /* ── MODALS — full-width bottom sheet (iOS feel) ── */
    .modal-overlay{ padding:0 !important; align-items:flex-end !important; }
    .modal-box{
      max-width:100% !important; width:100% !important;
      border-radius:22px 22px 0 0 !important;
      max-height:94vh !important;
      padding:20px 16px calc(20px + env(safe-area-inset-bottom));
      overflow-y:auto;
    }
    .modal-box-lg{ max-width:100% !important; width:100% !important; }
    .tab-pane{ min-height:0; }
    .modal-box h3{ font-size:15px; }
    .modal-actions{ flex-wrap:wrap; gap:8px; margin-top:14px; }
    .modal-actions button,
    .modal-actions .btn{ flex:1; min-width:0; justify-content:center; text-align:center; }
    /* Tab strip inside modals */
    .tab-strip{ overflow-x:auto; -webkit-overflow-scrolling:touch; flex-wrap:nowrap; }
    .tab-strip button{ flex-shrink:0; }

    /* ── KANBAN / TAREFAS ── */
    .kanban{ grid-template-columns:1fr; gap:10px; }
    .kcol{ padding:12px; }
    /* Member picker: contained, not absolute */
    #card-membros-picker{
      position:relative !important; width:100% !important;
      max-height:180px; overflow-y:auto;
    }

    /* ── KPIs ── */
    .kpis-row{ grid-template-columns:repeat(2,1fr) !important; gap:8px; margin-bottom:12px; }
    .kpi-mini{ padding:12px; }
    .kpi-mini .v{ font-size:17px; }
    .kpi-mini .l{ font-size:10.5px; margin-bottom:4px; }

    /* ── PRODUÇÃO rankings ── */
    .producao-rankings-grid,
    #producao-rankings{ grid-template-columns:1fr !important; gap:10px; }
    .bars{ height:100px; gap:6px; padding:10px 2px 0; }
    .bar span{ font-size:9.5px; }
    .bar em{ font-size:9.5px; margin-top:4px; }

    /* ── CONTATOS: filter pills stack ── */
    #view-contatos .filters-row{ flex-direction:column; }
    #view-contatos .select-pill{ width:100%; }

    /* ── MARKETING ── */
    #view-marketing .seg{ flex-wrap:wrap; }
    #view-marketing .form-actions{ flex-direction:column; }
    #view-marketing .form-actions button{ width:100%; justify-content:center; }

    /* ── RELATÓRIOS ── */
    /* cards de modelos: 1 col */
    .relatorio-modelos-grid{ grid-template-columns:1fr !important; gap:10px; }
    /* header bar: empilha */
    .relatorio-header-bar{
      flex-direction:column !important; gap:10px;
      align-items:flex-start !important; padding:12px 14px !important;
      border-radius:12px !important;
    }
    .relatorio-export-btns{ width:100%; display:flex !important; gap:8px; }
    .relatorio-export-btns button{ flex:1; font-size:11.5px; padding:8px 6px; }
    /* filtros: 1 col */
    .relatorio-filtros-grid{ grid-template-columns:1fr !important; }
    /* ação dos filtros: empilha */
    .relatorio-filtros-actions{
      flex-direction:column !important; align-items:stretch !important; gap:8px;
    }
    .relatorio-filtros-actions > div:first-child{ font-size:11px; }
    .relatorio-filtros-actions > div:last-child{ display:flex; gap:8px; }
    .relatorio-filtros-actions > div:last-child button{ flex:1; }
    /* KPIs resultado: 2 col */
    .relatorio-kpis-grid{ grid-template-columns:repeat(2,1fr) !important; gap:8px !important; }
    /* tabela resultado: scroll */
    #relatorio-consulta-area .list-panel{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
    /* inline grids */
    [style*="repeat(5,1fr)"]{ grid-template-columns:repeat(2,1fr) !important; }
    [style*="repeat(3,1fr)"]{ grid-template-columns:1fr !important; }
    [style*="repeat(4,1fr)"]{ grid-template-columns:repeat(2,1fr) !important; }
    .relatorio-kpis-grid [style*="repeat(4,1fr)"]{ grid-template-columns:repeat(2,1fr) !important; }

    /* ── CORRETORAS: form ── */
    #view-seguradora-form .form-section{ padding:12px; }
    .logo-upload-row{ flex-direction:column; gap:10px; }

    /* ── USUARIOS ── */
    #usuarios-tbody td:last-child{
      display:flex; flex-wrap:wrap; gap:4px; padding:8px 14px;
    }

    /* ── BILLING ── */
    .billing-row-top{ flex-direction:column; }
    .billing-row-actions{ flex-direction:column; gap:8px; }
    .billing-row-actions input{ min-width:0; width:100%; }

    /* ── PERMISSÕES ── */
    .permissoes-layout{ grid-template-columns:1fr !important; }

    /* ── LOGS ── */
    .log-field-grid{ grid-template-columns:1fr !important; }
    .logs-tab-btn{ padding:7px 10px; font-size:11.5px; }

    /* ── FILES / MATERIAL ── */
    .files-grid{ grid-template-columns:repeat(2,1fr) !important; gap:10px; }
    .file-card{ padding:14px; }

    /* ── CROP DE FOTO / LOGO ── */
    .crop-square-wrap{ width:240px; height:240px; }
    .crop-square-wrap canvas{ width:240px; height:240px; }
    #logo-crop-canvas{ width:100% !important; height:auto !important; }

    /* ── SELETOR DE CONTATOS ── */
    #modal-selecionar-contatos .modal-box{
      display:flex; flex-direction:column;
    }
    #seletor-contatos-list{ flex:1; }
    /* filtros do seletor */
    #modal-selecionar-contatos [style*="grid-template-columns:1fr 1fr"]{
      grid-template-columns:1fr !important;
    }

    /* ── SEGURADORA responsáveis picker ── */
    #seguradora-responsaveis-picker{ max-height:160px; }

    /* ── COMUNICADOS ── */
    .comm-row{ flex-direction:column; align-items:flex-start; gap:8px; }
    .comm-row .meta{ flex-wrap:wrap; }

    /* ── CARDS de aniversariantes ── */
    .bday-row .bday-actions{ flex-direction:column; gap:4px; }

    /* ── CORRETORAS: esconde coluna Cidade, mantém status clicável e compacto ── */
    .col-cidade{ display:none !important; }
    #corretoras-tbody td, #corretoras-tbody th{ padding:9px 10px; font-size:12px; }
    #corretoras-tbody .chip{ padding:4px 9px; font-size:10.5px; }

    /* ── SEGURADORAS: esconde coluna Cor e botão Excluir ── */
    .col-cor, .col-excluir{ display:none !important; }

    /* ── USUÁRIOS: esconde e-mail, ações em grade 2x2 compacta ── */
    .col-email{ display:none !important; }
    #usuarios-tbody td, #usuarios-tbody th{ padding:9px 10px; font-size:12px; }
    .usuarios-actions-cell{
      display:flex !important; flex-wrap:wrap; gap:5px; padding:8px 10px !important;
    }
    .usuarios-actions-cell .access-btn{
      flex:1; min-width:calc(50% - 3px); font-size:10.5px; padding:6px 4px;
      justify-content:center; text-align:center; white-space:nowrap;
    }

    /* ── RELATÓRIOS: espremer mais ── */
    .relatorio-header-bar{ padding:10px 12px !important; }
    .relatorio-header-bar #relatorio-modelo-titulo{ font-size:13px !important; }
    .relatorio-export-btns button{ font-size:10.5px !important; padding:7px 4px !important; }
    .relatorio-filtros-grid .log-field label,
    #relatorio-consulta-area .card label{ font-size:10.5px; }
    #relatorio-consulta-area .card{ padding:12px !important; }
    .relatorio-kpis-grid{ gap:6px !important; }
    .kpi-mini{ padding:9px !important; }
    .kpi-mini .v{ font-size:14px !important; }
    .kpi-mini .l{ font-size:9.5px !important; }
    #relatorio-tbody td, #relatorio-tbody th{ padding:8px 9px; font-size:11.5px; }
    #relatorio-tbody { }
    #relatorio-consulta-area table thead th{ padding:8px 9px; font-size:10px; }
    .relatorio-modelos-grid .card{ padding:12px !important; }
  }

  /* ── iPhone SE / very narrow ≤ 375 px ── */
  @media (max-width: 375px){
    .content{ padding:12px 10px calc(86px + env(safe-area-inset-bottom)); }
    .page-head > div:first-child h1{ font-size:15px; }
    .kpi-mini .v{ font-size:15px; }
    .btn-dark, .btn-outline{ font-size:12px; padding:9px 10px; }
    #quick-access-grid{ grid-template-columns:repeat(3,1fr) !important; gap:6px !important; }
  }

  .fab{ display:none !important; }

  /* ===== QUICK ACCESS ===== */
  .qa-card{
    display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;
    padding:16px 10px;border:1.5px solid var(--border);border-radius:14px;
    text-decoration:none;color:var(--black);cursor:pointer;
    transition:box-shadow .18s, transform .15s, border-color .2s;background:#fff;
  }
  .qa-card:hover{box-shadow:0 4px 14px rgba(0,0,0,.09);transform:translateY(-2px);border-color:var(--qa-c,#132728);}
  .qa-icon-wrap{width:40px;height:40px;border-radius:10px;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--qa-c,#132728) 12%,white);}
  .qa-icon-wrap svg{width:18px;height:18px;color:var(--qa-c,#132728);}
  .qa-name{font-size:12px;font-weight:700;line-height:1.3;}
  /* sidebar active indicator moves with JS */
  .nav-items{position:relative;}
  /* nav-active-bar removed */
  /* prevent text selection on double-click sidebar */
  .sidebar{user-select:none;-webkit-user-select:none;}
  .logs-tab-btn{
    padding:8px 18px;font-size:12.5px;font-weight:700;border-radius:8px;
    background:transparent;border:none;color:var(--gray-600);
    transition:background .15s,color .15s;
  }
  .logs-tab-btn.active{background:#fff;color:var(--black);box-shadow:var(--shadow-sm);}
  .log-field{display:flex;flex-direction:column;gap:5px;}
  .log-field label{font-size:11px;font-weight:700;color:var(--gray-600);text-transform:uppercase;letter-spacing:.3px;}
  .log-input,.log-field select{
    border:1.4px solid var(--border);border-radius:10px;padding:9px 12px;
    font-size:13px;font-family:inherit;outline:none;background:#fff;
    transition:border-color .2s;
  }
  .log-input:focus,.log-field select:focus{border-color:var(--black);}
  .log-table{width:100%;border-collapse:collapse;}
  .log-table th{
    background:var(--surface-2);padding:11px 14px;font-size:11px;font-weight:800;
    color:var(--gray-600);text-transform:uppercase;letter-spacing:.4px;
    text-align:left;border-bottom:1.4px solid var(--border);white-space:nowrap;
  }
  .log-table td{padding:12px 14px;font-size:12.5px;border-bottom:1px solid var(--border);vertical-align:middle;}
  .log-table tr:last-child td{border-bottom:none;}
  .log-table tbody tr{transition:background .12s;}
  .log-table tbody tr:hover{background:var(--surface);}
  .log-role-badge{font-size:10px;font-weight:800;padding:3px 9px;border-radius:20px;text-transform:uppercase;letter-spacing:.3px;background:var(--surface-2);color:var(--gray-600);border:1px solid var(--border);}
  .log-role-badge.badge-admin{background:var(--black);color:#fff;border-color:var(--black);}
  @media(max-width:760px){
    .log-table thead{display:none;}
    .log-table,.log-table tbody,.log-table tr,.log-table td{display:block;width:100%;}
    .log-table tr{margin-bottom:8px;border:1px solid var(--border);border-radius:10px;overflow:hidden;padding:2px 0;}
    .log-table td{border-bottom:none;padding:3px 12px;display:flex;justify-content:space-between;align-items:center;gap:8px;text-align:right;}
    .log-table td::before{content:attr(data-label);font-size:9.5px;font-weight:800;color:var(--gray-500);text-transform:uppercase;letter-spacing:.3px;text-align:left;flex-shrink:0;}
    /* Compacta: Data/Hora + Usuário ficam lado a lado numa única linha; Papel some; Ação/Detalhes ficam embaixo, discretos */
    .log-table td[data-label="Data/Hora"]{
      display:inline-flex; width:auto; font-size:10.5px; color:var(--gray-500); padding:6px 8px 2px 12px;
    }
    .log-table td[data-label="Usuário"]{
      display:inline-flex; width:auto; font-size:11.5px; padding:6px 12px 2px 4px; flex:1; justify-content:flex-end;
    }
    .log-table td[data-label="Papel"]{ display:none; }
    .log-table td[data-label="Ação"]{
      padding:2px 12px 7px; font-size:12px; font-weight:600;
    }
    .log-table td[data-label="Detalhes"], .log-table td[data-label="IP"]{
      padding:0 12px 7px; font-size:10.5px; color:var(--gray-400);
    }
    .log-table td[data-label="Ação"]::before, .log-table td[data-label="Detalhes"]::before, .log-table td[data-label="IP"]::before{
      display:none;
    }
  }
  @media(max-width:760px){.log-field-grid{grid-template-columns:1fr!important;}}
