:root{
    --bg:#14161c;
    --surface:#1b1e27;
    --surface-2:#20232e;
    --border:#2a2e3a;
    --text:#edeff3;
    --muted:#8b90a0;
    --muted-2:#5c6070;
    --ember:#ff6b35;
    --ember-dim:#ff6b3522;
    --warm:#f2b84b;
    --cold:#5b9dd6;
    --win:#34d399;
    --radius:14px;
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  body{
    background:var(--bg);
    color:var(--text);
    font-family:'Inter',sans-serif;
    height:100vh;
    overflow:hidden;
    -webkit-font-smoothing:antialiased;
  }
  .shell{display:flex; height:100vh;}

  /* SIDEBAR */
  .sidebar{
    width:64px; flex-shrink:0; background:var(--surface);
    border-right:1px solid var(--border);
    display:flex; flex-direction:column; align-items:center;
    padding:16px 0; gap:6px;
    overflow-y:auto; overflow-x:hidden;
  }
  .sidebar::-webkit-scrollbar{width:0; display:none;}
  .side-mark{
    width:32px; height:32px; border-radius:9px; margin-bottom:14px;
    background:linear-gradient(135deg, var(--ember), var(--warm));
    display:flex; align-items:center; justify-content:center;
    font-family:'Fraunces',serif; font-weight:600; font-size:15px; color:#14161c;
  }
  .nav-item{
    width:42px; height:42px; border-radius:11px;
    display:flex; align-items:center; justify-content:center;
    color:var(--muted-2); cursor:pointer; position:relative;
    transition:.15s;
  }
  .nav-item:hover{color:var(--muted); background:var(--surface-2);}
  .nav-item.active{color:var(--ember); background:var(--ember-dim);}
  .nav-label{
    position:absolute; left:52px; top:50%; transform:translateY(-50%);
    background:var(--surface-2); border:1px solid var(--border);
    padding:4px 9px; border-radius:7px; font-size:11px; white-space:nowrap;
    opacity:0; pointer-events:none; transition:.15s; z-index:20;
  }
  .nav-item:hover .nav-label{opacity:1;}

  .app{display:flex; flex-direction:column; height:100vh; flex:1; min-width:0;}
  .view{display:none; flex-direction:column; height:100%; min-height:0;}
  .view.active{display:flex;}

  /* TOP BAR */
  .topbar{
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 22px;
    border-bottom:1px solid var(--border);
    background:var(--surface);
    flex-shrink:0;
  }
  .brand{display:flex; align-items:center; gap:10px;}
  .brand-mark{
    width:30px; height:30px; border-radius:8px;
    background:linear-gradient(135deg, var(--ember), var(--warm));
    display:flex; align-items:center; justify-content:center;
    font-family:'Fraunces',serif; font-weight:600; font-size:15px; color:#14161c;
  }
  .brand-name{font-family:'Fraunces',serif; font-weight:600; font-size:19px; letter-spacing:-0.01em;}
  .brand-sub{font-size:11px; color:var(--muted-2); margin-left:8px; padding-left:8px; border-left:1px solid var(--border);}
  .topbar-right{display:flex; align-items:center; gap:16px;}
  .search{
    display:flex; align-items:center; gap:8px;
    background:var(--surface-2); border:1px solid var(--border);
    border-radius:10px; padding:7px 12px; width:220px;
  }
  .search input{background:none; border:none; outline:none; color:var(--text); font-size:13px; width:100%;}
  .search svg{flex-shrink:0; opacity:0.5;}
  .avatar{
    width:32px; height:32px; border-radius:50%;
    background:linear-gradient(135deg,#5b9dd6,#8b90a0);
    display:flex; align-items:center; justify-content:center;
    font-size:12px; font-weight:600;
  }

  /* BOARD HEADER */
  .board-header{
    padding:18px 22px 4px;
    display:flex; align-items:baseline; justify-content:space-between;
    flex-shrink:0;
  }
  .board-title{font-family:'Fraunces',serif; font-size:22px; font-weight:600;}
  .board-meta{font-size:12px; color:var(--muted); font-family:'JetBrains Mono',monospace;}
  .legend{display:flex; gap:14px; margin-top:2px;}
  .legend-item{display:flex; align-items:center; gap:5px; font-size:11px; color:var(--muted);}
  .dot{width:7px; height:7px; border-radius:50%;}

  /* BOARD */
  .board{
    flex:1;
    display:flex;
    gap:14px;
    padding:16px 22px 22px;
    overflow-x:auto;
    overflow-y:hidden;
  }
  .column{
    min-width:270px;
    max-width:270px;
    display:flex;
    flex-direction:column;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius);
    overflow:hidden;
  }
  .col-head{
    padding:12px 14px 10px;
    display:flex; align-items:center; justify-content:space-between;
    border-bottom:1px solid var(--border);
  }
  .col-title{font-size:13px; font-weight:600;}
  .col-count{
    font-size:11px; color:var(--muted); font-family:'JetBrains Mono',monospace;
    background:var(--surface-2); padding:2px 7px; border-radius:20px;
  }
  .col-body{
    flex:1; overflow-y:auto; padding:10px; display:flex; flex-direction:column; gap:8px;
  }
  .col-body::-webkit-scrollbar{width:5px;}
  .col-body::-webkit-scrollbar-thumb{background:var(--border); border-radius:10px;}

  .card{
    background:var(--surface-2);
    border:1px solid var(--border);
    border-radius:10px;
    padding:11px 12px;
    cursor:pointer;
    transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;
    touch-action:manipulation;
    user-select:none;
    -webkit-user-select:none;
  }
  .card:hover{
    transform:translateY(-2px);
    border-color:#3a3f4e;
    box-shadow:0 8px 20px -8px rgba(0,0,0,0.5);
  }
  .card-top{display:flex; align-items:center; justify-content:between; gap:8px; margin-bottom:7px;}
  .card-name{font-size:13px; font-weight:600; flex:1;}
  .temp{width:8px; height:8px; border-radius:50%; flex-shrink:0;}
  .card-msg{font-size:12px; color:var(--muted); line-height:1.4; margin-bottom:8px;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;}
  .card-foot{display:flex; align-items:center; justify-content:space-between;}
  .tag{
    font-size:10px; padding:2px 7px; border-radius:5px;
    background:var(--ember-dim); color:var(--ember); font-weight:500;
  }
  .card-time{font-size:10px; color:var(--muted-2); font-family:'JetBrains Mono',monospace;}
  .unread{
    width:16px; height:16px; border-radius:50%; background:var(--ember);
    font-size:9px; color:#14161c; font-weight:700; display:flex; align-items:center; justify-content:center;
  }

  .add-card{
    padding:9px; text-align:center; font-size:12px; color:var(--muted-2);
    border:1px dashed var(--border); border-radius:10px; cursor:pointer;
  }
  .add-card:hover{color:var(--muted); border-color:var(--muted-2);}

  .card.dragging{opacity:0.35;}
  .col-body.drag-over{background:var(--ember-dim); outline:2px dashed var(--ember); outline-offset:-4px; border-radius:10px;}

  .automation-badge{
    display:flex; align-items:center; gap:4px; font-size:9.5px; color:var(--ember);
    background:var(--ember-dim); padding:2px 7px; border-radius:20px; font-weight:500;
    margin-top:4px; width:fit-content; cursor:pointer; transition:.12s;
  }
  .automation-badge:hover{filter:brightness(1.15);}

  /* TOAST */
  .toast-wrap{position:fixed; bottom:22px; left:50%; transform:translateX(-50%); z-index:50; display:flex; flex-direction:column; gap:8px; align-items:center;}
  .toast{
    display:flex; align-items:center; gap:10px;
    background:var(--surface); border:1px solid var(--border);
    box-shadow:0 12px 30px -8px rgba(0,0,0,0.6);
    padding:10px 16px; border-radius:12px; font-size:12.5px;
    opacity:0; transform:translateY(12px); transition:all .3s cubic-bezier(.2,.8,.2,1);
    max-width:340px;
  }
  .toast.show{opacity:1; transform:translateY(0);}
  .toast-icon{
    width:26px; height:26px; border-radius:50%; background:var(--ember-dim);
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
  }
  .toast b{color:var(--text);}
  .toast span.muted{color:var(--muted); display:block; font-size:11px; margin-top:1px;}

  /* AGENDA VIEW */
  .page-head{padding:18px 22px 4px; flex-shrink:0;}
  .page-title{font-family:'Fraunces',serif; font-size:22px; font-weight:600;}
  .page-sub{font-size:12px; color:var(--muted); margin-top:2px;}
  .page-body{flex:1; overflow-y:auto; padding:16px 22px 30px;}

  .agenda-grid{display:grid; grid-template-columns:340px 1fr; gap:16px; align-items:start;}
  .panel{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px;}
  .panel-title{font-size:13px; font-weight:600; margin-bottom:12px; display:flex; align-items:center; justify-content:space-between;}

  .mini-cal{display:grid; grid-template-columns:repeat(7,1fr); gap:4px;}
  .mini-cal .dow{font-size:10px; color:var(--muted-2); text-align:center; padding-bottom:6px; font-family:'JetBrains Mono',monospace;}
  .mini-cal .day{
    aspect-ratio:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
    border-radius:8px; font-size:12px; color:var(--muted); cursor:pointer; position:relative;
  }
  .mini-cal .day:hover{background:var(--surface-2);}
  .mini-cal .day.today{background:var(--ember); color:#1a0e07; font-weight:700;}
  .mini-cal .day.has-appt::after{
    content:''; width:4px; height:4px; border-radius:50%; background:var(--ember); position:absolute; bottom:5px;
  }
  .mini-cal .day.today.has-appt::after{background:#1a0e07;}
  .mini-cal .day.empty{visibility:hidden;}

  .notif-toggle{display:flex; align-items:center; justify-content:space-between; padding:9px 0; border-top:1px solid var(--border); font-size:12.5px; gap:10px;}
  .notif-toggle span:first-child{flex:1; min-width:0;}
  .notif-toggle:first-of-type{border-top:none;}
  .switch{width:34px; height:19px; border-radius:20px; background:var(--surface-2); border:1px solid var(--border); position:relative; cursor:pointer; flex-shrink:0;}
  .switch.on{background:var(--ember); border-color:var(--ember);}
  .switch::after{content:''; width:14px; height:14px; border-radius:50%; background:#fff; position:absolute; top:2px; left:2px; transition:.2s;}
  .switch.on::after{left:17px;}

  .appt-list{display:flex; flex-direction:column; gap:10px;}
  .appt-card{
    background:var(--surface); border:1px solid var(--border); border-radius:12px;
    padding:13px 15px; display:flex; align-items:center; gap:13px;
  }
  .appt-time{
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    width:52px; flex-shrink:0; font-family:'JetBrains Mono',monospace;
  }
  .appt-time b{font-size:15px;}
  .appt-time span{font-size:9px; color:var(--muted-2);}
  .appt-divider{width:1px; align-self:stretch; background:var(--border);}
  .appt-info{flex:1; min-width:0;}
  .appt-name{font-size:13px; font-weight:600;}
  .appt-proc{font-size:11.5px; color:var(--muted); margin-top:1px;}
  .appt-status{
    font-size:10px; padding:3px 9px; border-radius:20px; font-weight:600; flex-shrink:0;
  }
  .appt-status.confirmado{background:#34d39922; color:var(--win);}
  .appt-status.pendente{background:var(--ember-dim); color:var(--ember);}
  .appt-wa{
    width:30px; height:30px; border-radius:8px; background:var(--surface-2);
    display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; color:var(--muted);
  }
  .appt-wa:hover{color:var(--ember); background:var(--ember-dim);}

  .feed-item{display:flex; gap:10px; padding:9px 0; border-top:1px solid var(--border); font-size:12px;}
  .feed-item:first-child{border-top:none;}
  .feed-dot{width:6px; height:6px; border-radius:50%; background:var(--ember); margin-top:5px; flex-shrink:0;}
  .feed-item span.time{display:block; color:var(--muted-2); font-size:10px; margin-top:2px; font-family:'JetBrains Mono',monospace;}

  /* IA VIEW */
  .ia-grid{display:grid; grid-template-columns:1fr 340px; gap:16px; align-items:start;}
  .field-label{font-size:11.5px; color:var(--muted); margin-bottom:6px; display:block; font-weight:500;}
  .field-input, .field-select, .field-textarea{
    width:100%; background:var(--surface-2); border:1px solid var(--border); border-radius:9px;
    padding:9px 12px; font-size:13px; color:var(--text); outline:none; font-family:'Inter',sans-serif;
  }
  .field-input:focus, .field-select:focus, .field-textarea:focus{border-color:var(--ember);}
  .field-textarea{resize:vertical; line-height:1.5;}
  .field-group{margin-bottom:14px;}
  .field-row{display:flex; gap:10px;}
  .field-row > div{flex:1;}
  .key-input-wrap{position:relative;}
  .key-toggle{position:absolute; right:10px; top:50%; transform:translateY(-50%); cursor:pointer; color:var(--muted); font-size:11px;}
  .key-status{display:flex; align-items:center; gap:6px; font-size:11px; color:var(--win); margin-top:6px;}
  .key-status .dot{width:6px; height:6px; border-radius:50%; background:var(--win);}

  .stage-toggle-row{display:flex; align-items:center; justify-content:space-between; padding:9px 0; border-top:1px solid var(--border);}
  .stage-toggle-row:first-of-type{border-top:none;}
  .stage-toggle-row .name{font-size:12.5px;}

  .btn-primary{
    background:var(--ember); color:#1a0e07; border:none; border-radius:9px;
    padding:10px 18px; font-size:13px; font-weight:600; cursor:pointer;
  }
  .btn-primary:hover{filter:brightness(1.08);}
  .btn-secondary{
    background:none; color:var(--muted); border:1px solid var(--border); border-radius:9px;
    padding:10px 18px; font-size:13px; font-weight:600; cursor:pointer;
  }
  .btn-secondary:hover{color:var(--text); border-color:var(--muted-2);}

  /* MODAL */
  .modal-overlay{
    position:fixed; inset:0; background:rgba(10,11,14,0.6);
    display:flex; align-items:center; justify-content:center;
    opacity:0; pointer-events:none; transition:opacity .2s ease; z-index:40; padding:20px;
  }
  .modal-overlay.open{opacity:1; pointer-events:auto;}
  .modal{
    background:var(--surface); border:1px solid var(--border); border-radius:16px;
    width:420px; max-width:100%; max-height:88vh; overflow-y:auto;
    transform:translateY(14px); transition:transform .2s ease;
  }
  .modal-overlay.open .modal{transform:translateY(0);}
  .modal-head{
    display:flex; align-items:center; justify-content:space-between;
    padding:16px 18px; border-bottom:1px solid var(--border);
  }
  .modal-title{font-family:'Fraunces',serif; font-size:16px; font-weight:600;}
  .modal-close{cursor:pointer; color:var(--muted); display:flex;}
  .modal-close:hover{color:var(--text);}
  .modal-body{padding:18px;}
  .modal-foot{display:flex; justify-content:flex-end; gap:8px; padding:14px 18px; border-top:1px solid var(--border);}

  .seq-step{display:flex; gap:8px; padding:11px 0; border-top:1px solid var(--border);}
  .seq-step:first-of-type{border-top:none; padding-top:4px;}
  .seq-step-num{
    width:20px; height:20px; border-radius:50%; background:var(--ember-dim); color:var(--ember);
    font-size:10px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:2px;
  }
  .seq-step-body{flex:1;}

  .col-row{display:flex; align-items:center; gap:8px; padding:8px 0; border-top:1px solid var(--border);}
  .col-row:first-of-type{border-top:none;}
  .col-row-arrows{display:flex; flex-direction:column; gap:2px; flex-shrink:0;}
  .col-row-arrow{
    width:18px; height:14px; display:flex; align-items:center; justify-content:center;
    color:var(--muted-2); cursor:pointer; font-size:10px; border-radius:3px;
  }
  .col-row-arrow:hover{color:var(--ember); background:var(--ember-dim);}
  .col-row-count{font-size:10px; color:var(--muted-2); font-family:'JetBrains Mono',monospace; white-space:nowrap; flex-shrink:0;}
  .rem-del.disabled{opacity:.3; cursor:not-allowed;}

  .qr-row{display:flex; align-items:center; gap:10px; padding:9px 0; border-top:1px solid var(--border);}
  .qr-row:first-of-type{border-top:none;}
  .qr-row-icon{width:28px; height:28px; border-radius:8px; background:var(--surface-2); display:flex; align-items:center; justify-content:center; font-size:13px; flex-shrink:0;}
  .qr-row-body{flex:1; min-width:0;}
  .qr-row-label{font-size:12px; font-weight:600;}
  .qr-row-preview{font-size:11px; color:var(--muted); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}

  .ia-test{display:flex; flex-direction:column; height:420px;}
  .ia-test-thread{flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:8px; margin-bottom:10px;}
  .ia-test-input{display:flex; gap:6px;}

  /* AGENTES (multi-agente) */
  .agent-tabs{display:flex; gap:10px; margin-bottom:16px; flex-wrap:wrap;}
  .agent-tab{
    display:flex; align-items:center; gap:9px; padding:9px 13px; border-radius:12px;
    border:1px solid var(--border); background:var(--surface); cursor:pointer; transition:.15s;
  }
  .agent-tab:hover{border-color:#3a3f4e;}
  .agent-tab.selected{border-color:var(--ember); background:var(--ember-dim);}
  .agent-tab-icon{
    width:30px; height:30px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0;
  }
  .agent-tab-name{font-size:12.5px; font-weight:600;}
  .agent-tab-role{font-size:10px; color:var(--muted); margin-top:1px;}
  .agent-tab-status{width:7px; height:7px; border-radius:50%; background:var(--win); flex-shrink:0; margin-left:2px;}
  .agent-tab-status.off{background:var(--muted-2);}
  .agent-tab-add{
    display:flex; align-items:center; gap:7px; padding:9px 14px; border-radius:12px;
    border:1px dashed var(--border); cursor:pointer; color:var(--muted); font-size:12px;
  }
  .agent-tab-add:hover{color:var(--ember); border-color:var(--ember);}

  .routing-row{
    display:flex; align-items:flex-start; gap:9px; padding:10px 0; border-top:1px solid var(--border);
  }
  .routing-row:first-of-type{border-top:none;}
  .routing-agent-icon{width:26px; height:26px; border-radius:7px; display:flex; align-items:center; justify-content:center; font-size:12px; flex-shrink:0; margin-top:2px;}
  .routing-body{flex:1;}
  .routing-agent-name{font-size:12px; font-weight:600; margin-bottom:4px;}
  .routing-keywords{width:100%; background:var(--surface-2); border:1px solid var(--border); border-radius:7px; padding:6px 9px; font-size:11.5px; color:var(--text);}

  /* EQUIPE */
  .member-row{
    display:flex; align-items:center; gap:12px; padding:12px 0; border-top:1px solid var(--border);
  }
  .member-row:first-of-type{border-top:none;}
  .member-avatar{
    width:38px; height:38px; border-radius:50%; flex-shrink:0;
    background:linear-gradient(135deg, var(--cold), var(--muted-2));
    display:flex; align-items:center; justify-content:center; font-weight:600; font-size:13px; color:#fff;
  }
  .member-body{flex:1; min-width:0;}
  .member-name{font-size:13px; font-weight:600; display:flex; align-items:center; gap:7px; flex-wrap:wrap;}
  .member-email{font-size:11.5px; color:var(--muted); margin-top:1px;}
  .role-badge{font-size:9.5px; padding:2px 8px; border-radius:20px; font-weight:600;}
  .role-badge.admin{background:var(--ember-dim); color:var(--ember);}
  .role-badge.gestor{background:var(--violet-dim); color:var(--violet);}
  .role-badge.atendente{background:#5b9dd622; color:var(--cold);}
  .member-status{font-size:9.5px; padding:2px 8px; border-radius:20px; background:var(--surface-2); color:var(--muted);}
  .member-status.pending{background:var(--ember-dim); color:var(--warm);}
  .member-actions{display:flex; gap:4px; flex-shrink:0;}

  /* FATURAMENTO */
  .billing-grid{display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px;}
  .plan-name{font-family:'Fraunces',serif; font-size:20px; font-weight:600;}
  .plan-price{font-size:13px; color:var(--muted); margin-top:2px;}
  .plan-price b{color:var(--text); font-size:16px;}
  .seats-track{height:9px; background:var(--surface-2); border-radius:5px; overflow:hidden; margin:10px 0 6px;}
  .seats-fill{height:100%; background:var(--ember); border-radius:5px;}
  .card-visual{
    background:linear-gradient(135deg, #1f2430, #14161c); border:1px solid var(--border); border-radius:12px;
    padding:16px; font-family:'JetBrains Mono',monospace; margin-bottom:10px;
  }
  .card-visual .num{font-size:15px; letter-spacing:2px; margin-bottom:10px;}
  .card-visual .meta{display:flex; justify-content:space-between; font-size:10px; color:var(--muted);}
  .invoice-row{display:flex; align-items:center; gap:10px; padding:10px 0; border-top:1px solid var(--border); font-size:12px;}
  .invoice-row:first-of-type{border-top:none;}
  .invoice-status{font-size:9.5px; padding:2px 8px; border-radius:20px; flex-shrink:0;}
  .invoice-status.pago{background:#34d39922; color:var(--win);}
  .invoice-status.pendente{background:var(--ember-dim); color:var(--warm);}
  .plan-tier{
    border:1px solid var(--border); border-radius:12px; padding:14px; cursor:pointer; transition:.15s;
  }
  .plan-tier:hover{border-color:#3a3f4e;}
  .plan-tier.current{border-color:var(--ember); background:var(--ember-dim);}
  .plan-tier-name{font-size:13px; font-weight:700;}
  .plan-tier-price{font-family:'Fraunces',serif; font-size:22px; font-weight:600; margin:4px 0;}
  .plan-tier-feat{font-size:11px; color:var(--muted); line-height:1.6;}
  .plan-tiers-grid{grid-template-columns:1fr 1fr 1fr;}

  /* LOGIN / DEFINIR SENHA */
  .login-screen{
    position:fixed; inset:0; z-index:100; background:var(--bg);
    display:none; align-items:center; justify-content:center; padding:20px;
    background-image:radial-gradient(circle at 30% 20%, #ff6b3512, transparent 50%), radial-gradient(circle at 80% 80%, #a78bfa10, transparent 50%);
  }
  .login-screen.open{display:flex;}
  .login-card{width:360px; max-width:100%;}
  .login-mark{
    width:44px; height:44px; border-radius:12px; margin:0 auto 16px;
    background:linear-gradient(135deg, var(--ember), var(--warm));
    display:flex; align-items:center; justify-content:center;
    font-family:'Fraunces',serif; font-weight:600; font-size:20px; color:#14161c;
  }
  .login-title{font-family:'Fraunces',serif; font-size:22px; font-weight:600; text-align:center;}
  .login-sub{font-size:12px; color:var(--muted); text-align:center; margin-top:4px; margin-bottom:26px;}
  .login-tenant{
    display:flex; align-items:center; justify-content:center; gap:6px; font-size:11px; color:var(--muted-2);
    margin-bottom:22px; padding-bottom:18px; border-bottom:1px solid var(--border);
  }
  .login-field{margin-bottom:14px;}
  .login-forgot{display:block; text-align:right; font-size:11px; color:var(--muted); margin-top:6px; cursor:pointer;}
  .login-forgot:hover{color:var(--ember);}
  .login-btn{
    width:100%; background:var(--ember); color:#1a0e07; border:none; border-radius:9px;
    padding:12px; font-size:13px; font-weight:700; cursor:pointer; margin-top:6px;
  }
  .login-btn:hover{filter:brightness(1.08);}
  .login-switch{text-align:center; font-size:11.5px; color:var(--muted); margin-top:18px;}
  .login-switch a{color:var(--ember); cursor:pointer; font-weight:600;}
  .sidebar-login-trigger{
    margin-top:auto; width:38px; height:38px; border-radius:11px;
    display:flex; align-items:center; justify-content:center; color:var(--muted-2); cursor:pointer;
  }
  .sidebar-login-trigger:hover{color:var(--ember); background:var(--ember-dim);}

  /* SUPER ADMIN (FalconAds) — gerencia os clientes/tenants do white-label */
  .superadmin-screen{
    position:fixed; inset:0; z-index:100; background:var(--bg); display:none; flex-direction:column;
  }
  .superadmin-screen.open{display:flex;}
  .sa-topbar{
    padding:16px 24px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:12px; flex-shrink:0;
  }
  .sa-badge{
    background:var(--violet-dim); color:var(--violet); font-size:10px; font-weight:700; padding:3px 9px; border-radius:20px;
    letter-spacing:.03em;
  }
  .sa-body{flex:1; overflow-y:auto; padding:22px 24px;}
  .sa-client-row{
    display:flex; align-items:center; gap:14px; padding:14px 16px;
    background:var(--surface); border:1px solid var(--border); border-radius:12px; margin-bottom:10px;
  }
  .sa-client-mark{
    width:38px; height:38px; border-radius:10px; flex-shrink:0;
    background:linear-gradient(135deg, var(--cold), var(--violet));
    display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; color:#fff;
  }
  .sa-client-body{flex:1; min-width:0;}
  .sa-client-name{font-size:13.5px; font-weight:600;}
  .sa-client-domain{font-size:11px; color:var(--muted); font-family:'JetBrains Mono',monospace; margin-top:1px;}
  .sa-client-meta{font-size:10.5px; color:var(--muted-2); margin-top:3px;}

  /* CONTATOS */
  .contacts-table{width:100%; border-collapse:collapse; font-size:12px;}
  .contacts-table thead th{
    text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:.03em; color:var(--muted-2);
    padding:8px 10px; border-bottom:1px solid var(--border); white-space:nowrap;
  }
  .contacts-table tbody td{
    padding:10px; border-bottom:1px solid var(--border); white-space:nowrap; color:var(--text);
  }
  .contacts-table tbody tr:hover{background:var(--surface-2);}
  .contacts-table tbody tr:last-child td{border-bottom:none;}

  /* MARCA / WHITE-LABEL */
  .brand-grid{display:grid; grid-template-columns:1fr 1fr; gap:16px;}
  .logo-upload-box{
    width:100%; aspect-ratio:2.5; border:1.5px dashed var(--border); border-radius:12px;
    display:flex; align-items:center; justify-content:center; cursor:pointer; overflow:hidden;
    background:var(--surface-2); transition:.15s;
  }
  .logo-upload-box:hover{border-color:var(--ember);}
  .logo-upload-box img{max-width:100%; max-height:100%; object-fit:contain;}
  .favicon-upload-box{
    width:56px; height:56px; border:1.5px dashed var(--border); border-radius:10px;
    display:flex; align-items:center; justify-content:center; cursor:pointer; overflow:hidden;
    background:var(--surface-2); flex-shrink:0;
  }
  .favicon-upload-box:hover{border-color:var(--ember);}
  .favicon-upload-box img{max-width:100%; max-height:100%; object-fit:contain;}
  .color-swatch-row{display:flex; align-items:center; gap:10px;}
  .color-swatch-row input[type=color]{
    width:38px; height:38px; border-radius:9px; border:1px solid var(--border); background:none; cursor:pointer; padding:2px;
  }
  .domain-row{display:flex; gap:8px;}
  .cname-box{
    background:var(--surface-2); border:1px solid var(--border); border-radius:9px; padding:10px 12px;
    font-family:'JetBrains Mono',monospace; font-size:11px; display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:8px;
  }
  .copy-btn{color:var(--muted); cursor:pointer; flex-shrink:0;}
  .copy-btn:hover{color:var(--ember);}

  /* REMINDER RULE BUILDER */
  .panel-subtitle{font-size:10.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted-2); margin:14px 0 8px; font-weight:600;}
  .panel-subtitle:first-of-type{margin-top:0;}
  .reminder-row{display:flex; align-items:center; gap:6px; margin-bottom:7px;}
  .reminder-row .field-input, .reminder-row .field-select{padding:7px 9px; font-size:12px;}
  .rem-value{width:52px; flex-shrink:0; text-align:center;}
  .rem-unit{flex:1;}
  .rem-target{flex:1;}
  .rem-del{
    width:26px; height:26px; border-radius:7px; flex-shrink:0; display:flex; align-items:center; justify-content:center;
    color:var(--muted-2); cursor:pointer;
  }
  .rem-del:hover{color:var(--ember); background:var(--ember-dim);}
  .add-reminder{
    font-size:11.5px; color:var(--ember); cursor:pointer; display:flex; align-items:center; gap:5px;
    margin-top:4px; font-weight:500;
  }
  .add-reminder:hover{opacity:0.8;}

  /* DASHBOARD */
  .kpi-row{display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:16px;}
  .kpi-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:15px 16px;}
  .kpi-label{font-size:11px; color:var(--muted); margin-bottom:8px;}
  .kpi-value{font-family:'Fraunces',serif; font-size:26px; font-weight:600;}
  .kpi-delta{font-size:11px; margin-top:5px; display:flex; align-items:center; gap:4px;}
  .kpi-delta.up{color:var(--win);}
  .kpi-delta.down{color:#ef4444;}

  .dash-grid{display:grid; grid-template-columns:1.4fr 1fr; gap:16px; align-items:start; margin-bottom:16px;}

  .funnel-row{display:flex; align-items:center; gap:10px; margin-bottom:10px;}
  .funnel-label{width:100px; flex-shrink:0; font-size:12px; color:var(--muted);}
  .funnel-bar-track{flex:1; height:26px; background:var(--surface-2); border-radius:7px; overflow:hidden; position:relative;}
  .funnel-bar-fill{height:100%; border-radius:7px; display:flex; align-items:center; padding:0 10px; font-size:11px; font-weight:600; color:#1a0e07;}
  .funnel-conv{width:44px; flex-shrink:0; text-align:center; font-size:10.5px; color:var(--muted-2); font-family:'JetBrains Mono',monospace;}

  .origin-row{display:flex; align-items:center; gap:10px; margin-bottom:9px; font-size:12px;}
  .origin-label{width:86px; flex-shrink:0; color:var(--muted);}
  .origin-track{flex:1; height:9px; background:var(--surface-2); border-radius:5px; overflow:hidden;}
  .origin-fill{height:100%; background:var(--ember); border-radius:5px;}
  .origin-val{width:30px; flex-shrink:0; text-align:right; font-family:'JetBrains Mono',monospace; font-size:11px; color:var(--muted);}

  .temp-bar{display:flex; height:14px; border-radius:7px; overflow:hidden; margin:10px 0 10px;}
  .temp-legend{display:flex; gap:16px;}

  .msg-chart{display:flex; align-items:flex-end; gap:8px; height:130px; padding-top:10px;}
  .msg-col{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:2px;}
  .msg-seg{width:100%; border-radius:3px;}
  .msg-day-label{font-size:9.5px; color:var(--muted-2); margin-top:6px; font-family:'JetBrains Mono',monospace;}
  .msg-legend{display:flex; gap:14px; margin-top:14px; justify-content:center;}

  /* CHAT VIEW (full page) */
  .chat-shell{flex:1; display:flex; min-height:0;}

  .chat-list{width:290px; flex-shrink:0; border-right:1px solid var(--border); overflow-y:auto; background:var(--surface);}
  .chat-list-search{padding:12px; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--surface);}
  .chat-item{
    display:flex; gap:10px; padding:11px 14px; cursor:pointer; border-bottom:1px solid var(--border);
    align-items:flex-start; transition:.12s;
  }
  .chat-item:hover{background:var(--surface-2);}
  .chat-item.active{background:var(--ember-dim); border-left:2px solid var(--ember);}
  .chat-item-avatar{
    width:36px; height:36px; border-radius:50%; flex-shrink:0;
    background:linear-gradient(135deg, var(--ember), var(--warm));
    display:flex; align-items:center; justify-content:center; font-weight:600; font-size:12px; color:#14161c;
  }
  .chat-item-body{flex:1; min-width:0;}
  .chat-item-top{display:flex; align-items:center; justify-content:space-between; gap:6px;}
  .chat-item-name{font-size:12.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .chat-item-time{font-size:9.5px; color:var(--muted-2); flex-shrink:0; font-family:'JetBrains Mono',monospace;}
  .chat-item-msg{font-size:11.5px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px;}
  .chat-item-foot{display:flex; align-items:center; gap:6px; margin-top:5px;}

  .chat-tabs{
    display:flex; gap:4px; padding:10px 12px; border-bottom:1px solid var(--border);
    position:sticky; top:0; background:var(--surface); z-index:2;
  }
  .chat-tab{
    flex:1; text-align:center; font-size:11px; padding:7px 6px; border-radius:8px;
    color:var(--muted); cursor:pointer; display:flex; align-items:center; justify-content:center; gap:5px;
  }
  .chat-tab:hover{background:var(--surface-2);}
  .chat-tab.active{background:var(--ember-dim); color:var(--ember); font-weight:600;}
  .chat-tab-count{
    background:var(--ember); color:#1a0e07; font-size:9px; font-weight:700;
    padding:1px 6px; border-radius:20px; min-width:14px;
  }
  .chat-item{position:relative;}
  .chat-item-archive{
    position:absolute; top:9px; right:10px; width:22px; height:22px; border-radius:6px;
    display:flex; align-items:center; justify-content:center; color:var(--muted-2); cursor:pointer;
  }
  .chat-item-archive:hover{color:var(--ember); background:var(--ember-dim);}
  .chat-item-empty{padding:30px 16px; text-align:center; font-size:12px; color:var(--muted-2); line-height:1.6;}
  .chat-item-stage{font-size:9px; color:var(--muted-2); background:var(--surface-2); padding:1px 7px; border-radius:20px;}

  .chat-main{flex:1; display:flex; flex-direction:column; min-width:0; background:var(--bg);}
  .chat-main-head{
    padding:13px 18px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:12px; flex-shrink:0;
  }
  .chat-main-avatar{
    width:38px; height:38px; border-radius:50%; flex-shrink:0;
    background:linear-gradient(135deg, var(--ember), var(--warm));
    display:flex; align-items:center; justify-content:center; font-weight:600; font-size:13px; color:#14161c;
  }
  .chat-main-name{font-size:14px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .chat-main-phone{font-size:11px; color:var(--muted); font-family:'JetBrains Mono',monospace; margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .chat-main-info{flex:1; min-width:0;}
  .chat-stage-select{margin-left:auto;}
  .chat-head-icons{display:flex; gap:4px;}

  .chat-thread{flex:1; overflow-y:auto; padding:18px 22px; display:flex; flex-direction:column; gap:10px;}
  .chat-thread::-webkit-scrollbar{width:5px;}
  .chat-thread::-webkit-scrollbar-thumb{background:var(--border); border-radius:10px;}

  .chat-info{
    width:280px; flex-shrink:0; border-left:1px solid var(--border); background:var(--surface); padding:18px; overflow-y:auto;
    position:relative; transition:width .2s ease, padding .2s ease, opacity .15s ease;
  }
  .quick-actions-grid{display:grid; grid-template-columns:1fr 1fr; gap:7px;}
  .quick-action-btn{
    display:flex; align-items:center; justify-content:center; gap:5px;
    padding:9px 6px; border-radius:9px; border:1px solid var(--border);
    background:var(--surface-2); color:var(--text); font-size:11px; font-weight:500;
    cursor:pointer; transition:.12s; text-align:center;
  }
  .quick-action-btn:hover{border-color:var(--ember); background:var(--ember-dim); color:var(--ember);}
  .quick-action-btn.danger:hover{border-color:#ef4444; background:#ef444422; color:#ef4444;}
  .info-avatar-wrap{text-align:center; margin-bottom:14px;}
  .info-avatar{
    width:58px; height:58px; border-radius:50%; margin:0 auto 10px;
    background:linear-gradient(135deg, var(--ember), var(--warm));
    display:flex; align-items:center; justify-content:center; font-weight:600; font-size:18px; color:#14161c;
  }
  .info-name{font-size:14px; font-weight:600;}
  .info-phone{font-size:11px; color:var(--muted); font-family:'JetBrains Mono',monospace; margin-top:2px;}
  .info-section{margin-top:16px; padding-top:14px; border-top:1px solid var(--border);}
  .info-section-title{font-size:10.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted-2); font-weight:600; margin-bottom:9px;}
  .temp-picker{display:flex; gap:8px;}
  .temp-opt{
    flex:1; text-align:center; padding:7px 4px; border-radius:8px; border:1px solid var(--border);
    font-size:10.5px; cursor:pointer; color:var(--muted); display:flex; flex-direction:column; align-items:center; gap:4px;
  }
  .temp-opt .dot{width:8px; height:8px; border-radius:50%;}
  .temp-opt.selected{border-color:var(--ember); background:var(--ember-dim); color:var(--text);}
  .info-tags{display:flex; flex-wrap:wrap; gap:6px;}
  .info-note{
    width:100%; background:var(--surface-2); border:1px solid var(--border); border-radius:9px;
    padding:9px 10px; font-size:12px; color:var(--text); resize:none; font-family:'Inter',sans-serif;
  }
  .tag.removable{display:inline-flex; align-items:center; gap:5px;}
  .tag-x{cursor:pointer; opacity:0.6; font-size:12px; line-height:1;}
  .tag-x:hover{opacity:1;}
  .icon-btn.ia-on{color:var(--ember); background:var(--ember-dim);}
  .icon-btn.recording{color:#fff; background:#ef4444; animation:mic-pulse 1.2s infinite;}
  @keyframes mic-pulse{
    0%{box-shadow:0 0 0 0 rgba(239,68,68,.55);}
    70%{box-shadow:0 0 0 9px rgba(239,68,68,0);}
    100%{box-shadow:0 0 0 0 rgba(239,68,68,0);}
  }

  /* FLOW BUILDER */
  :root{ --violet:#a78bfa; --violet-dim:#a78bfa22; --teal:#2dd4bf; --teal-dim:#2dd4bf22; }
  .flow-topbar{
    padding:12px 18px; border-bottom:1px solid var(--border);
    display:flex; align-items:center; gap:10px; flex-shrink:0;
  }
  .flow-select{max-width:220px;}
  .flow-body{flex:1; display:flex; min-height:0;}

  .flow-palette{width:190px; flex-shrink:0; border-right:1px solid var(--border); background:var(--surface); padding:14px 12px; overflow-y:auto;}
  .palette-title{font-size:10.5px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted-2); font-weight:600; margin-bottom:10px;}
  .palette-item{
    display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:9px;
    border:1px solid var(--border); margin-bottom:7px; cursor:pointer; font-size:12px; background:var(--surface-2);
    transition:.12s;
  }
  .palette-item:hover{border-color:var(--ember); transform:translateX(2px);}
  .palette-icon{width:22px; height:22px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:12px; flex-shrink:0;}

  .flow-canvas-wrap{
    flex:1; overflow:auto; position:relative;
    background-color:var(--bg);
    background-image:radial-gradient(var(--border) 1px, transparent 1px);
    background-size:22px 22px;
  }
  .flow-canvas{position:relative; width:1500px; height:1150px;}
  .flow-links{position:absolute; top:0; left:0; width:100%; height:100%; pointer-events:none;}

  .flow-node{
    position:absolute; width:196px; background:var(--surface); border:1px solid var(--border);
    border-radius:11px; box-shadow:0 6px 18px -8px rgba(0,0,0,.5); cursor:grab; user-select:none; touch-action:none;
  }
  .flow-node.selected{border-color:var(--ember); box-shadow:0 0 0 2px var(--ember-dim), 0 10px 24px -8px rgba(0,0,0,.6);}
  .flow-node.linking-source{border-color:var(--violet); box-shadow:0 0 0 2px var(--violet-dim);}
  .flow-node-head{
    display:flex; align-items:center; gap:7px; padding:8px 10px; border-bottom:1px solid var(--border);
    border-radius:11px 11px 0 0;
  }
  .flow-node-icon{width:20px; height:20px; border-radius:6px; display:flex; align-items:center; justify-content:center; font-size:11px; flex-shrink:0;}
  .flow-node-title{font-size:11.5px; font-weight:600; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .flow-node-del{width:16px; height:16px; color:var(--muted-2); cursor:pointer; flex-shrink:0; display:flex;}
  .flow-node-del:hover{color:var(--ember);}
  .flow-node-body{padding:9px 10px; font-size:11.5px; color:var(--muted); line-height:1.4; max-height:54px; overflow:hidden;}
  .flow-node-opts{padding:0 10px 9px; display:flex; flex-wrap:wrap; gap:4px;}
  .flow-node-opt{font-size:9.5px; background:var(--surface-2); border:1px solid var(--border); padding:2px 7px; border-radius:20px; color:var(--muted);}
  .node-handle-out{
    position:absolute; bottom:-8px; left:50%; transform:translateX(-50%);
    width:16px; height:16px; border-radius:50%; background:var(--ember); border:2px solid var(--surface);
    cursor:crosshair; z-index:5;
  }
  .node-handle-out:hover{transform:translateX(-50%) scale(1.2);}

  .flow-props{width:270px; flex-shrink:0; border-left:1px solid var(--border); background:var(--surface); padding:16px; overflow-y:auto;}
  .flow-props-empty{font-size:12px; color:var(--muted-2); text-align:center; margin-top:40px; line-height:1.6;}
  .flow-hint-banner{
    margin:10px 18px 0; padding:8px 12px; background:var(--violet-dim); border:1px solid #a78bfa44;
    border-radius:9px; font-size:11px; color:var(--violet); display:none; align-items:center; gap:7px;
  }
  .flow-hint-banner.show{display:flex;}

  .chat-back-btn{
    display:none; align-items:center; justify-content:center;
    width:30px; height:30px; border-radius:8px; color:var(--muted); cursor:pointer; flex-shrink:0;
  }
  .chat-info-close{
    display:flex; align-items:center; justify-content:center;
    width:26px; height:26px; border-radius:7px; color:var(--muted); cursor:pointer;
    position:absolute; top:14px; right:14px;
  }
  .chat-info-close:hover{background:var(--surface-2); color:var(--text);}

  @media (min-width: 881px){
    .chat-info.info-collapsed{
      width:0; padding:0; opacity:0; border-left:none; overflow:hidden; pointer-events:none;
    }
  }

  /* RESPONSIVO — telas estreitas (celular) */
  @media (max-width: 880px){
    .sidebar{ width:56px; }
    .nav-item{ width:38px; height:38px; }

    .board{ padding:12px 14px 18px; gap:10px; }
    .column{ min-width:78vw; max-width:78vw; }

    .chat-shell{ position:relative; overflow:hidden; }
    .chat-list{ width:100%; }
    .chat-main{ display:none; width:100%; }
    .chat-shell.conversation-open .chat-list{ display:none; }
    .chat-shell.conversation-open .chat-main{ display:flex; }

    .chat-back-btn{ display:flex; }
    .chat-stage-select{ display:none; }

    .chat-info{
      position:fixed; top:0; right:0; height:100vh; width:82vw; max-width:300px;
      transform:translateX(100%); transition:transform .25s ease; z-index:25;
      box-shadow:-14px 0 34px rgba(0,0,0,.5);
    }
    .chat-info.open{ transform:translateX(0); }

    .dash-grid{ grid-template-columns:1fr; }
    .agenda-grid{ grid-template-columns:1fr; }
    .kpi-row{ grid-template-columns:1fr 1fr; }
    .ia-grid{ grid-template-columns:1fr; }
    .billing-grid{ grid-template-columns:1fr; }
    .brand-grid{ grid-template-columns:1fr; }
    .plan-tiers-grid{ grid-template-columns:1fr; }

    /* Formulários de duas colunas empilham em vez de espremer e cortar texto */
    .field-row{ flex-direction:column; }
    .field-row > div{ width:100%; }

    /* Linhas densas de listas (equipe, clientes, faturas, agendamentos) quebram em vez de cortar */
    .sa-client-row{ flex-wrap:wrap; row-gap:8px; }
    .sa-client-row .btn-secondary{ width:100%; margin-top:4px; }
    .member-row{ flex-wrap:wrap; row-gap:8px; }
    .member-actions{ margin-left:auto; }
    .invoice-row{ flex-wrap:wrap; row-gap:4px; }
    .appt-card{ flex-wrap:wrap; row-gap:8px; }
    .col-row{ flex-wrap:wrap; row-gap:6px; }
    .col-row input.field-input{ width:100%; }
    .routing-row{ flex-wrap:wrap; }
    .domain-row{ flex-direction:column; }
    .color-swatch-row{ flex-wrap:wrap; }
    .cname-box{ flex-direction:column; align-items:flex-start; gap:8px; }

    /* Modais mais compactos em telas estreitas */
    .modal{ width:100%; }
    .modal-body{ padding:14px; }
    .modal-head, .modal-foot{ padding:14px; }

    /* Board header e demais cabeçalhos com botão não estouram mais a largura */
    .board-header{ flex-wrap:wrap; row-gap:8px; }
    .page-head{ flex-wrap:wrap; row-gap:10px; }

    .reminder-row{ flex-wrap:wrap; row-gap:6px; }
    .reminder-row .rem-unit, .reminder-row .rem-target{ flex:1 1 100px; }

    .composer{ padding:10px 10px 14px; gap:5px; }
    .composer-icons{ gap:2px; }
    .icon-btn{ width:28px; height:28px; }
    .icon-btn svg{ width:16px; height:16px; }

    .sa-topbar{ flex-wrap:wrap; row-gap:8px; padding:14px; }
    .flow-topbar{ flex-wrap:wrap; row-gap:8px; }
    .flow-select{ max-width:160px; }

    .flow-palette{
      position:fixed; top:0; left:0; height:100vh; width:78vw; max-width:260px;
      transform:translateX(-100%); transition:transform .25s ease; z-index:25;
      box-shadow:14px 0 34px rgba(0,0,0,.5);
    }
    .flow-palette.open{transform:translateX(0);}
    .flow-props{
      position:fixed; top:0; right:0; height:100vh; width:82vw; max-width:290px;
      transform:translateX(100%); transition:transform .25s ease; z-index:25;
      box-shadow:-14px 0 34px rgba(0,0,0,.5);
    }
    .flow-props.open{transform:translateX(0);}
    .flow-mobile-toggle{display:flex !important;}
  }
  .flow-mobile-toggle{display:none;}

  /* CHAT DRAWER */
  .overlay{
    position:fixed; inset:0; background:rgba(10,11,14,0.55);
    opacity:0; pointer-events:none; transition:opacity .25s ease;
    z-index:10;
  }
  .overlay.open{opacity:1; pointer-events:auto;}

  .drawer{
    position:fixed; top:0; right:0; height:100vh; width:420px; max-width:100vw;
    background:var(--surface); border-left:1px solid var(--border);
    display:flex; flex-direction:column;
    transform:translateX(100%);
    transition:transform .3s cubic-bezier(.2,.8,.2,1);
    z-index:11;
  }
  .drawer.open{transform:translateX(0);}

  .drawer-head{
    padding:16px 18px; border-bottom:1px solid var(--border);
    display:flex; align-items:center; gap:12px;
  }
  .drawer-avatar{
    width:38px; height:38px; border-radius:50%;
    background:linear-gradient(135deg, var(--ember), var(--warm));
    display:flex; align-items:center; justify-content:center; font-weight:600; font-size:13px; color:#14161c;
  }
  .drawer-name{font-size:14px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .drawer-stage{font-size:11px; color:var(--muted); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .drawer-info{flex:1; min-width:0;}
  .drawer-close{margin-left:auto; cursor:pointer; opacity:0.6;}
  .drawer-close:hover{opacity:1;}

  .thread{flex:1; overflow-y:auto; padding:16px 18px; display:flex; flex-direction:column; gap:10px;}
  .thread::-webkit-scrollbar{width:5px;}
  .thread::-webkit-scrollbar-thumb{background:var(--border); border-radius:10px;}
  .day-sep{
    text-align:center; font-size:10px; color:var(--muted-2);
    font-family:'JetBrains Mono',monospace; margin:6px 0;
  }
  .bubble{max-width:78%; padding:9px 12px; border-radius:12px; font-size:13px; line-height:1.45;}
  .bubble.in{background:var(--surface-2); align-self:flex-start; border-bottom-left-radius:3px;}
  .bubble.out{background:var(--ember); color:#1a0e07; align-self:flex-end; border-bottom-right-radius:3px; font-weight:500;}
  .bubble-time{font-size:9px; opacity:0.55; margin-top:3px; display:block; font-family:'JetBrains Mono',monospace;}
  .msg-link{color:inherit; text-decoration:underline; word-break:break-all;}

  /* Linha de mensagem enviada (com ações de editar/excluir que aparecem no hover) */
  .msg-row{display:flex; align-items:center; gap:4px; max-width:100%;}
  .msg-row.own{align-self:flex-end; flex-direction:row-reverse;}
  .msg-row.own .bubble.out{align-self:auto;}
  .msg-row.own .audio-bubble, .msg-row.own .file-bubble, .msg-row.own .image-bubble{align-self:auto;}
  .msg-actions{display:flex; gap:2px; opacity:0; transition:.15s; flex-shrink:0;}
  .msg-row:hover .msg-actions{opacity:1;}
  .msg-action-btn{
    width:22px; height:22px; border-radius:6px; display:flex; align-items:center; justify-content:center;
    cursor:pointer; color:var(--muted); font-size:12px; background:var(--surface);
  }
  .msg-action-btn:hover{background:var(--surface-2); color:var(--ember);}
  .msg-edit-box{display:flex; align-items:center; gap:6px; max-width:78%;}
  .msg-edit-input{
    background:var(--surface-2); border:1px solid var(--ember); border-radius:20px;
    padding:8px 12px; font-size:13px; color:var(--text); outline:none; min-width:160px;
  }
  .msg-actions.editing-actions{opacity:1;}

  .audio-bubble{
    display:flex; align-items:center; gap:8px; background:var(--surface-2);
    align-self:flex-start; padding:8px 10px; border-radius:12px; border-bottom-left-radius:3px; width:200px;
  }
  .play-btn{
    width:26px; height:26px; border-radius:50%; background:var(--ember);
    display:flex; align-items:center; justify-content:center; flex-shrink:0; cursor:pointer;
  }
  .waveform{flex:1; display:flex; align-items:center; gap:2px; height:20px;}
  .waveform div{width:2px; background:var(--muted); border-radius:2px;}
  .audio-speed-btn{
    font-size:10px; font-weight:600; font-family:'JetBrains Mono',monospace; cursor:pointer;
    padding:2px 5px; border-radius:5px; flex-shrink:0;
  }
  .audio-speed-btn:hover{background:rgba(0,0,0,0.12);}

  .file-bubble{
    display:flex; align-items:center; gap:9px; background:var(--surface-2);
    padding:9px 11px; border-radius:12px; border-bottom-right-radius:3px; width:210px; cursor:pointer; transition:.12s;
  }
  .file-bubble:hover{background:var(--surface); border:1px solid var(--ember);}
  .file-icon{
    width:32px; height:32px; border-radius:8px; background:var(--ember-dim);
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
  }
  .file-name{font-size:12px; font-weight:500;}
  .file-size{font-size:10px; color:var(--muted); font-family:'JetBrains Mono',monospace;}
  .file-download-icon{color:var(--muted-2); flex-shrink:0; margin-left:auto; display:flex;}
  .file-bubble:hover .file-download-icon{color:var(--ember);}

  .image-bubble{
    position:relative; max-width:220px; border-radius:12px; border-bottom-right-radius:3px; overflow:hidden; cursor:pointer;
  }
  .image-bubble img{display:block; width:100%; height:auto;}
  .image-download-icon{
    position:absolute; top:6px; right:6px; width:26px; height:26px; border-radius:50%;
    background:rgba(0,0,0,0.55); display:flex; align-items:center; justify-content:center;
    opacity:0; transition:.15s;
  }
  .image-bubble:hover .image-download-icon{opacity:1;}

  .image-lightbox{
    position:fixed; inset:0; z-index:120; background:rgba(10,11,14,0.92);
    display:none; align-items:center; justify-content:center; padding:40px;
    opacity:0; transition:opacity .2s ease;
  }
  .image-lightbox.open{display:flex; opacity:1;}
  .image-lightbox img{max-width:100%; max-height:100%; border-radius:8px; object-fit:contain;}
  .image-lightbox-actions{position:absolute; top:18px; right:18px; display:flex; gap:8px;}
  .image-lightbox-actions .icon-btn{background:rgba(255,255,255,0.1); color:#fff;}
  .image-lightbox-actions .icon-btn:hover{background:rgba(255,255,255,0.2);}

  /* ATALHO "/" pra respostas rápidas, direto no composer */
  .slash-menu{
    position:absolute; bottom:calc(100% + 6px); left:14px; right:14px; z-index:16;
    background:var(--surface); border:1px solid var(--border); border-radius:12px;
    box-shadow:0 12px 30px -8px rgba(0,0,0,0.6); max-height:260px; overflow-y:auto;
    display:none; padding:6px;
  }
  .slash-menu.open{display:block;}
  .slash-menu-item{
    display:flex; align-items:center; gap:9px; padding:8px 9px; border-radius:8px; cursor:pointer;
  }
  .slash-menu-item:hover, .slash-menu-item.active{background:var(--ember-dim);}
  .slash-menu-icon{font-size:14px; flex-shrink:0; width:22px; text-align:center;}
  .slash-menu-body{flex:1; min-width:0;}
  .slash-menu-label{font-size:12px; font-weight:600;}
  .slash-menu-preview{font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px;}
  .slash-menu-empty{font-size:11.5px; color:var(--muted-2); padding:10px 8px; text-align:center;}
  .slash-menu-hint{
    font-size:9.5px; color:var(--muted-2); padding:6px 8px 2px; border-top:1px solid var(--border); margin-top:4px;
  }

  /* QUICK REPLIES */
  .quick-replies-row{
    display:flex; align-items:center; gap:8px; padding:8px 12px 8px 18px;
    border-top:1px solid var(--border);
  }
  .quick-replies{ flex:1; display:flex; gap:6px; overflow-x:auto; }
  .qr-chip{
    font-size:11px; white-space:nowrap; padding:6px 11px; display:flex; align-items:center; gap:5px;
    background:var(--surface-2); border:1px solid var(--border); border-radius:20px;
    cursor:pointer; color:var(--muted); transition:.15s; flex-shrink:0;
  }
  .qr-chip:hover{color:var(--text); border-color:var(--ember); background:var(--ember-dim);}
  .qr-manage-btn{
    width:28px; height:28px; border-radius:8px; flex-shrink:0; display:flex; align-items:center; justify-content:center;
    color:var(--muted); cursor:pointer; background:var(--surface-2);
  }
  .qr-manage-btn:hover{color:var(--ember); background:var(--ember-dim);}

  .composer{
    padding:12px 14px 16px; display:flex; align-items:flex-end; gap:8px; position:relative;
  }
  .composer-icons{display:flex; gap:4px; flex-shrink:0; position:relative;}
  .emoji-picker{
    position:absolute; bottom:40px; left:0; z-index:15;
    background:var(--surface); border:1px solid var(--border); border-radius:12px;
    padding:8px; box-shadow:0 12px 30px -8px rgba(0,0,0,0.6);
    display:none; grid-template-columns:repeat(7, 1fr); gap:2px; width:216px;
  }
  .emoji-picker.open{display:grid;}
  .emoji-picker-btn{
    width:28px; height:28px; display:flex; align-items:center; justify-content:center;
    font-size:16px; border-radius:6px; cursor:pointer;
  }
  .emoji-picker-btn:hover{background:var(--surface-2);}
  .icon-btn{
    width:32px; height:32px; border-radius:8px; display:flex; align-items:center; justify-content:center;
    color:var(--muted); cursor:pointer; transition:.15s; flex-shrink:0;
  }
  .icon-btn:hover{background:var(--surface-2); color:var(--text);}
  .composer-input{
    flex:1; min-width:0; background:var(--surface-2); border:1px solid var(--border); border-radius:20px;
    padding:9px 14px; font-size:13px; color:var(--text); outline:none;
  }
  .send-btn{
    width:34px; height:34px; border-radius:50%; background:var(--ember);
    display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0;
  }
