:root{
  --bg:#f5f7fb;
  --bg2:#ffffff;
  --panel:#ffffff;
  --panel2:#f8fafc;
  --line:#e2e8f0;
  --text:#0f172a;
  --muted:#64748b;
  --blue:#2563eb;
  --indigo:#4f46e5;
  --purple:#7c3aed;
  --green:#16a34a;
  --cyan:#0ea5e9;
  --yellow:#f59e0b;
  --orange:#f97316;
  --red:#ef4444;
  --card:#ffffff;
  --input:#ffffff;
  --shadow:0 16px 40px rgba(15,23,42,.07);
  --shadow-sm:0 8px 22px rgba(15,23,42,.06);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text);font-size:14px}
a{text-decoration:none;color:inherit}.app{display:flex;min-height:100vh}
.sidebar{width:276px;background:#fff;border-right:1px solid var(--line);padding:22px 18px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;box-shadow:10px 0 30px rgba(15,23,42,.03);z-index:20}.brand{display:flex;gap:12px;align-items:center;margin-bottom:28px}.brand-icon{width:48px;height:48px;border-radius:15px;background:linear-gradient(135deg,var(--blue),var(--purple));display:grid;place-items:center;font-weight:400;color:white;box-shadow:0 12px 24px rgba(79,70,229,.22)}.brand strong{display:block;font-size:28px;letter-spacing:-1px;color:#111827}.brand strong b{color:var(--indigo)}.brand span{font-size:12px;color:var(--muted)}.nav-title{font-size:11px;text-transform:uppercase;color:#94a3b8;margin:8px 0 10px;font-weight:400;letter-spacing:.06em}.menu{display:grid;gap:6px}.menu a{color:#243044;padding:5px 5px;border-radius:12px;display:flex;gap:10px;align-items:center;font-weight:400;font-size:14px;transition:.18s ease}.menu a span{width:24px;text-align:center;color:#52617a}.menu a.active{background:linear-gradient(135deg,#eef2ff,#f5f3ff);color:var(--indigo);box-shadow:inset 3px 0 0 var(--indigo)}.menu a.active span{color:var(--indigo)}.menu a:hover{background:#f1f5f9;color:var(--indigo)}.sidebar-footer{font-size:12px}
.brand-logo{display:block;margin-bottom:24px}.brand-logo img{display:block;width:190px;max-width:100%;height:auto}.mobile-header .brand-logo{margin:0}.mobile-header .brand-logo img{width:150px}.login-logo{display:block;width:250px;max-width:100%;height:auto;margin:0 auto 4px}
.main{flex:1;padding:22px 24px;max-width:calc(100vw - 276px)}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px 20px;box-shadow:var(--shadow-sm)}.topbar h1{margin:0;font-size:27px;letter-spacing:-.6px}.topbar p{margin:6px 0 0;color:var(--muted)}.toolbar{display:flex;gap:10px;align-items:center}.btn,button{border:0;background:linear-gradient(135deg,var(--blue),var(--indigo));color:#fff;border-radius:10px;padding:11px 15px;font-weight:400;cursor:pointer;display:inline-flex;align-items:center;gap:8px;box-shadow:0 10px 18px rgba(37,99,235,.18);transition:.16s ease}.btn:hover,button:hover{transform:translateY(-1px)}.btn.secondary{background:#fff;color:#334155;border:1px solid var(--line);box-shadow:var(--shadow-sm)}.btn.danger{background:var(--red)}.btn.success{background:var(--green)}input,select,textarea{width:100%;border:1px solid #d8e0ec;border-radius:10px;padding:11px 13px;background:var(--input);color:var(--text);font-size:14px;outline:none;transition:.16s ease}input:focus,select:focus,textarea:focus{border-color:var(--blue);box-shadow:0 0 0 4px rgba(37,99,235,.10)}label{font-size:13px;color:#475569;display:grid;gap:7px;font-weight:600}.form label,.compact-form label{margin-bottom:14px}.form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.form-grid label{margin-bottom:0}.span-2{grid-column:span 2}.span-3{grid-column:span 3}.cards{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:16px;margin-bottom:18px}.metric{background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px;box-shadow:var(--shadow);position:relative;overflow:hidden}.metric:after{content:"";position:absolute;right:18px;top:18px;width:48px;height:48px;background:linear-gradient(135deg,#eff6ff,#dbeafe);border-radius:14px}.metric.ok:after{background:linear-gradient(135deg,#ecfdf5,#dcfce7)}.metric.warn:after{background:linear-gradient(135deg,#fffbeb,#fef3c7)}.metric.danger:after{background:linear-gradient(135deg,#fef2f2,#fee2e2)}.metric span{font-size:13px;color:var(--muted);font-weight:400}.metric strong{display:block;font-size:25px;margin-top:8px;letter-spacing:-.5px;color:#0f172a}.metric small{color:var(--green);font-weight:400}.metric.warn small{color:var(--yellow)}.metric.danger small{color:var(--red)}.panel{background:#fff;border:1px solid var(--line);border-radius:20px;padding:20px;box-shadow:var(--shadow);margin-bottom:18px}.panel h2{margin:0 0 16px;font-size:20px}.panel h3{margin:14px 0 10px}.grid{display:grid;gap:18px}.grid.two{grid-template-columns:1fr 1fr}.grid.side{grid-template-columns:1.2fr .8fr}.module-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.module-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:16px;display:flex;gap:12px;align-items:center;box-shadow:var(--shadow-sm)}.module-card i{font-style:normal;width:42px;height:42px;border-radius:13px;background:linear-gradient(135deg,#eff6ff,#eef2ff);color:var(--indigo);display:grid;place-items:center;font-size:20px}.section-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:14px}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:14px;background:#fff}table{width:100%;border-collapse:collapse;background:#fff}th,td{text-align:left;border-bottom:1px solid var(--line);padding:12px;font-size:14px;white-space:nowrap}th{color:#64748b;font-size:12px;text-transform:uppercase;background:#f8fafc;font-weight:400}tr:hover td{background:#f8fafc}.tag{display:inline-block;padding:6px 10px;border-radius:999px;font-size:12px;background:#f1f5f9;color:#475569;font-weight:400}.tag.ok{background:#dcfce7;color:#166534}.tag.info{background:#dbeafe;color:#1d4ed8}.tag.warn{background:#fef3c7;color:#92400e}.tag.danger{background:#fee2e2;color:#b91c1c}.tag.muted{background:#e2e8f0;color:#475569}.alert{background:#fef2f2;color:#b91c1c;border:1px solid #fecaca;border-radius:12px;padding:11px;margin-bottom:12px}.notice{background:#ecfdf5;color:#166534;border:1px solid #bbf7d0;border-radius:12px;padding:11px;margin-bottom:12px}.login-body{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#eff6ff,#f8fafc 45%,#eef2ff)}.login-card{width:390px;background:#fff;color:#0f172a;border-radius:24px;padding:30px;display:grid;gap:13px;box-shadow:0 24px 80px rgba(15,23,42,.16);border:1px solid var(--line)}.login-card input{background:#fff;color:#0f172a}.login-card p,.login-card small{color:#475569}.login-card h1{margin:4px 0 0}.chart-bars{height:250px;display:flex;gap:14px;align-items:end;padding:18px 8px 6px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#fff,#f8fafc)}.bar-item{flex:1;text-align:center;height:100%;display:flex;flex-direction:column;justify-content:end;gap:8px}.bar-wrap{height:190px;display:flex;align-items:end;justify-content:center}.bar-wrap span{display:block;width:70%;border-radius:10px 10px 0 0;background:linear-gradient(180deg,#60a5fa,var(--blue));box-shadow:0 10px 24px rgba(37,99,235,.20)}.bar-item small{font-size:11px;color:var(--muted);font-weight:400}.donut-box{display:flex;gap:18px;align-items:center}.donut{width:180px;height:180px;border-radius:50%;display:grid;place-items:center;position:relative}.donut:after{content:"";position:absolute;inset:34px;background:#fff;border-radius:50%;box-shadow:inset 0 0 0 1px var(--line)}.donut strong,.donut span{position:relative;z-index:1;text-align:center}.donut strong{font-size:28px}.donut span{display:block;margin-top:32px;color:var(--muted);font-size:12px}.legend{flex:1}.legend p{display:flex;align-items:center;gap:8px;justify-content:space-between;color:#334155;font-weight:600}.legend b{width:10px;height:10px;border-radius:50%;display:inline-block;margin-right:auto}.checkgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:8px 0 14px}.checkgrid label{display:flex;align-items:center;gap:8px;background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:9px}.checkgrid input,.perm-table input{width:auto}.perm-table{overflow:auto;border:1px solid var(--line);border-radius:12px}.actions{display:flex;gap:6px}.mobile-header,.mobile-menu-toggle,.mobile-menu-close,.mobile-menu-title,.mobile-menu-overlay{display:none}.empty{color:var(--muted);padding:12px}.filters{display:flex;gap:10px;flex-wrap:wrap}.filters select,.filters input{max-width:220px}
@media(max-width:1100px){.cards,.module-grid{grid-template-columns:repeat(2,1fr)}.grid.two,.grid.side{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr 1fr}.span-3{grid-column:1/-1}.main{padding:18px}}
@media(max-width:768px){body{background:#f8fafc}.mobile-header{display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:9999;background:#fff;border-bottom:1px solid var(--line);padding:12px 14px;box-shadow:var(--shadow-sm)}.mobile-header .brand{margin:0}.mobile-header .brand-icon{width:42px;height:42px;border-radius:12px}.mobile-header .brand strong{font-size:22px}.mobile-menu-toggle{display:grid;place-items:center;width:44px;height:44px;padding:0;background:#fff;color:#111827;border:1px solid var(--line);box-shadow:var(--shadow-sm);font-size:22px}.app{display:block}.sidebar{position:fixed;z-index:10002;left:0;top:0;height:100vh;width:84vw;max-width:330px;transform:translateX(-105%);transition:.25s ease;box-shadow:24px 0 70px rgba(15,23,42,.28);overflow:auto}.sidebar.is-open{transform:translateX(0)}.mobile-menu-overlay{display:block;position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:10001;opacity:0;pointer-events:none;transition:.2s}.mobile-menu-overlay.is-open{opacity:1;pointer-events:auto}.mobile-menu-close{display:grid;place-items:center;margin-bottom:14px;background:#f8fafc;color:#0f172a;border:1px solid var(--line);box-shadow:none;width:100%}.mobile-menu-title{display:block;color:#fff;margin-bottom:8px}.main{max-width:100%;padding:14px}.topbar{display:block;padding:16px;margin-bottom:14px}.topbar h1{font-size:22px}.toolbar{margin-top:12px}.cards,.module-grid,.form-grid{grid-template-columns:1fr}.span-2,.span-3{grid-column:auto}.checkgrid{grid-template-columns:1fr}.metric strong{font-size:22px}.panel{padding:16px;border-radius:16px}.donut-box{display:block}.donut{margin:auto}.table-wrap{margin-left:-2px;margin-right:-2px}.filters select,.filters input{max-width:none}.btn,button{width:auto}body.menu-open{overflow:hidden}}


/* =========================================================
   LOCX V5 - CORREÇÃO RESPONSIVA GLOBAL
   Mantém o layout claro aprovado e corrige overflow no celular.
   ========================================================= */
html,body{width:100%;max-width:100%;overflow-x:hidden}
.app,.main,.topbar,.panel,.card,.metric,.module-card,.grid,.form-grid,.table-wrap,.login-card{min-width:0;max-width:100%}
img,svg,canvas,video{max-width:100%;height:auto}
input,select,textarea{display:block;width:100%;max-width:100%;min-width:0}
label{min-width:0;max-width:100%}
.form-grid>*{min-width:0}
.table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
table{min-width:680px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.mobile-menu-toggle{touch-action:manipulation}

@media(max-width:768px){
  body{width:100%;max-width:100%;overflow-x:hidden;background:#f8fafc}
  .mobile-header{display:flex!important;width:100%;max-width:100%;min-width:0}
  .app{display:block!important;width:100%;max-width:100%;min-width:0;overflow:hidden}
  .main{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;padding:14px!important;overflow:hidden}
  .topbar{width:100%;max-width:100%;min-width:0;display:block!important;margin:0 0 14px!important;padding:16px!important;border-radius:16px}
  .toolbar{display:flex;flex-wrap:wrap;gap:8px;width:100%;max-width:100%}
  .toolbar .btn,.toolbar button{width:100%;justify-content:center}
  .panel{width:100%;max-width:100%;min-width:0;margin:0 0 14px!important;padding:16px!important;border-radius:16px;overflow:hidden}
  .cards,.module-grid,.grid,.grid.two,.grid.side,.form-grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;width:100%;max-width:100%;min-width:0;gap:14px!important}
  .span-2,.span-3{grid-column:1/-1!important}
  .metric,.module-card{width:100%;max-width:100%;min-width:0}
  label{width:100%;max-width:100%;min-width:0;display:grid;gap:7px;margin-bottom:0!important}
  input,select,textarea{width:100%!important;max-width:100%!important;min-width:0!important}
  textarea{min-height:92px}
  .btn,button{max-width:100%;white-space:normal}
  .section-head{display:block}.section-head .btn{margin-top:10px;width:100%;justify-content:center}
  .filters{display:grid;grid-template-columns:1fr;width:100%;gap:8px}.filters select,.filters input{width:100%;max-width:100%}
  .checkgrid{display:grid!important;grid-template-columns:1fr!important}
  .donut-box{display:block!important}.donut{max-width:180px;max-height:180px;margin:0 auto 12px}
  .chart-bars{min-width:520px}.panel:has(.chart-bars){overflow-x:auto;-webkit-overflow-scrolling:touch}
  .table-wrap{overflow-x:auto;width:100%;max-width:100%}
  th,td{font-size:12px;padding:10px}
  .sidebar{position:fixed!important;left:0!important;top:0!important;height:100dvh!important;width:min(86vw,330px)!important;max-width:330px!important;transform:translateX(-110%)!important;transition:transform .25s ease!important;z-index:10002!important;overflow-y:auto!important;overflow-x:hidden!important}
  .sidebar.is-open,.sidebar.open{transform:translateX(0)!important}
  .mobile-menu-overlay{display:block!important;position:fixed!important;inset:0!important;background:rgba(15,23,42,.45)!important;z-index:10001!important;opacity:0;pointer-events:none;transition:.2s}
  .mobile-menu-overlay.is-open{opacity:1!important;pointer-events:auto!important}
  body.menu-open{overflow:hidden!important}
}

.client-shell{min-height:100vh;background:#f5f7fb}
.client-header{display:flex;justify-content:space-between;align-items:center;gap:18px;background:#fff;border-bottom:1px solid var(--line);padding:16px 24px;position:sticky;top:0;z-index:10;box-shadow:var(--shadow-sm)}
.client-header .brand-logo{margin:0}.client-header .brand-logo img{width:170px}
.client-header-user{display:flex;align-items:center;gap:12px;color:#475569}.client-header-user strong{color:#0f172a}.client-header-user span{font-size:13px}
.client-main{max-width:1180px;margin:0 auto;padding:24px}
.client-title{display:flex;justify-content:space-between;align-items:center;gap:18px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:20px;margin-bottom:18px;box-shadow:var(--shadow-sm)}
.client-title h1{margin:0;font-size:28px;letter-spacing:0}.client-title p,.muted{margin:6px 0 0;color:var(--muted)}
.client-invoices{display:grid;gap:14px}.invoice-card{border:1px solid var(--line);border-radius:16px;padding:16px;background:#fff}.invoice-card.is-paid{background:#f8fafc}
.invoice-main{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}.invoice-main strong{display:block;font-size:16px}.invoice-main span{display:block;color:var(--muted);font-size:13px;margin-top:4px}
.invoice-values{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}.invoice-values span{display:grid;gap:4px;color:var(--muted);font-size:12px;background:#f8fafc;border:1px solid #eef2f7;border-radius:12px;padding:10px}.invoice-values b{color:#0f172a;font-size:14px}
.client-pix{display:grid;grid-template-columns:auto minmax(0,1fr);gap:14px;align-items:center;background:#f8fafc;border:1px solid var(--line);border-radius:14px;padding:12px}.client-pix .pix-qr{width:128px;height:128px}.client-pix .pix-code{display:block;white-space:normal;word-break:break-all;margin-bottom:10px;max-height:92px;overflow:auto}
.client-notices{display:grid;gap:10px}.client-notice{border:1px solid var(--line);border-left:4px solid #94a3b8;border-radius:12px;padding:12px;background:#fff}.client-notice strong{display:block;color:#0f172a;margin-bottom:4px}.client-notice span{display:block;color:#475569;line-height:1.45}.client-notice.ok{border-left-color:var(--green)}.client-notice.warn{border-left-color:var(--yellow)}.client-notice.danger{border-left-color:var(--red)}
.client-data{display:grid;gap:10px}.client-data span{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid #eef2f7;padding-bottom:9px;color:#64748b}.client-data b{color:#0f172a;text-align:right}
.client-chat-widget{position:fixed;right:22px;bottom:22px;z-index:10020;display:grid;justify-items:end;gap:12px}.chat-fab{border-radius:999px;padding:9px 14px 9px 9px;box-shadow:0 18px 42px rgba(15,23,42,.22);background:#128c7e;color:#fff}.chat-fab small{display:block;font-size:11px;font-weight:400;opacity:.9}.chat-avatar{width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.18);display:grid;place-items:center;color:#fff;font-weight:700;box-shadow:inset 0 0 0 1px rgba(255,255,255,.22);flex:0 0 auto;overflow:hidden}.chat-avatar.image img{width:100%;height:100%;object-fit:cover;display:block}
.client-chat-popup{display:none;width:min(360px,calc(100vw - 28px));max-height:min(560px,calc(100vh - 112px));overflow:hidden;background:#efe7dc;border:1px solid #d7cfc3;border-radius:18px;box-shadow:0 28px 80px rgba(15,23,42,.30);padding:0}.client-chat-popup.is-open{display:grid;grid-template-rows:auto minmax(0,1fr) auto}.chat-head{display:flex;gap:10px;align-items:center;margin:0;padding:10px 12px;background:#075e54;color:#fff;border-radius:17px 17px 0 0}.chat-head .chat-avatar{width:40px;height:40px;background:#fff;box-shadow:0 8px 18px rgba(0,0,0,.18)}.chat-head h2{margin:0;font-size:17px;color:#fff}.chat-head p{margin:2px 0 0;color:rgba(255,255,255,.82);line-height:1.2;font-size:11px}.chat-close{margin-left:auto;width:32px;height:32px;padding:0;border-radius:50%;background:rgba(255,255,255,.16);color:#fff;box-shadow:none;font-size:22px;justify-content:center}
.chat-thread{display:grid;gap:8px;padding:12px;overflow:auto;align-content:start}.chat-row{display:flex;gap:8px;align-items:flex-end}.chat-row.cliente{justify-content:flex-end}.chat-row.is-pending .chat-bubble{opacity:.62}.chat-mini-avatar{width:26px;height:26px;border-radius:50%;overflow:hidden;flex:0 0 auto}.chat-mini-avatar img{width:100%;height:100%;object-fit:cover;display:block}.chat-bubble{position:relative;max-width:84%;background:#fff;color:#0f172a;border-radius:8px 8px 8px 2px;padding:8px 10px;line-height:1.32;box-shadow:0 1px 1px rgba(15,23,42,.08);white-space:pre-wrap;font-size:13px}.chat-row.cliente .chat-bubble{background:#dcf8c6;border-radius:8px 8px 2px 8px}.chat-sender{display:block;margin-bottom:2px;color:#075e54;font-size:11px;font-weight:700}.chat-bubble time{display:block;margin-top:3px;text-align:right;color:#64748b;font-size:10px}.chat-typing{display:none;gap:4px;width:max-content;background:#fff;border-radius:999px;padding:7px 9px;box-shadow:0 1px 1px rgba(15,23,42,.08);margin-left:34px}.chat-typing span{width:6px;height:6px;border-radius:50%;background:#64748b;animation:chatDot 1s infinite ease-in-out}.chat-typing span:nth-child(2){animation-delay:.15s}.chat-typing span:nth-child(3){animation-delay:.3s}@keyframes chatDot{0%,80%,100%{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.chat-form{display:grid;gap:8px;padding:0 10px 10px}.chat-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:calc(100% - 34px);margin-left:34px;padding:0;transition:.2s ease}.chat-options.is-hidden{display:none}.chat-options>span{grid-column:1/-1;font-size:11px;color:#475569}.quick-reply{border:1px solid #b7d8d3;background:#fff;color:#075e54;border-radius:999px;padding:8px 10px;font-size:11px;line-height:1.15;white-space:normal;cursor:pointer;min-height:34px;text-align:center;box-shadow:0 1px 1px rgba(15,23,42,.05)}.quick-reply.is-selected{background:#dcf8c6;border-color:#8fcf8b;color:#0f5132}.chat-compose{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:end}.chat-compose textarea{border-radius:18px;min-height:40px;max-height:120px;overflow-y:auto;resize:none;font-size:13px;padding:10px 12px}.chat-compose button{height:40px;border-radius:18px;padding:0 13px}.chat-end-btn{justify-self:center;background:transparent;color:#b91c1c;box-shadow:none;border:0;padding:2px 8px;font-size:11px}
.chat-form button[disabled]{opacity:.55;cursor:not-allowed;transform:none}
.chat-history{border-top:1px solid rgba(15,23,42,.08);padding:12px 14px 14px;background:rgba(255,255,255,.38);display:grid;gap:9px;align-content:start;margin-top:0}.chat-history>strong{font-size:13px}.chat-history article{background:#dcf8c6;border-radius:8px 8px 2px 8px;padding:10px;box-shadow:0 1px 1px rgba(15,23,42,.08)}.chat-history article span{display:flex;gap:8px;align-items:center;flex-wrap:wrap;color:#475569}.chat-history article p{margin:7px 0;color:#0f172a;line-height:1.4}.chat-history article small{color:#64748b}
@media(max-width:768px){
  .client-header{display:block;padding:14px}.client-header-user{display:grid;grid-template-columns:1fr;align-items:start;margin-top:10px}
  .client-main{padding:14px}.client-title{display:block;padding:16px}.client-title .btn{margin-top:12px;width:100%;justify-content:center}
  .invoice-values{grid-template-columns:1fr 1fr}.client-pix{grid-template-columns:1fr}.client-pix .pix-qr{width:150px;height:150px}
  .client-chat-widget{right:14px;bottom:14px;left:14px}.chat-fab{justify-self:end}.client-chat-popup{width:100%;max-height:calc(100vh - 102px)}.chat-head{align-items:flex-start}.chat-options{display:grid;grid-template-columns:1fr}.chat-options .btn{justify-content:center}
}

/* =========================================================
   LOCX V6.2 - FORMULÁRIO EM CIMA / LISTAGEM EMBAIXO
   Mantém os campos do formulário no layout original.
   Apenas remove o bloco lateral direito das páginas de cadastro.
   ========================================================= */
.grid.side{
  grid-template-columns:minmax(0,1fr)!important;
  width:100%;
}
.grid.side > .panel{
  width:100%;
  max-width:100%;
  min-width:0;
}

/* =========================================================
   LOCX V6.3 - DASHBOARD EXECUTIVO: 4 GRÁFICOS EM 1 LINHA
   RECEITA | STATUS | RECEBIDO | OPERAÇÃO
   ========================================================= */
.kpi-row{margin-bottom:18px}
.chart-row.four{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
  margin-bottom:18px;
}
.chart-card{
  min-height:382px;
  padding:18px;
  overflow:hidden;
}
.chart-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:16px;
}
.chart-head span{
  display:block;
  color:#64748b;
  font-size:11px;
  line-height:1;
  font-weight:400;
  letter-spacing:.08em;
  text-transform:uppercase;
  margin-bottom:7px;
}
.chart-head h2{
  margin:0;
  font-size:17px;
  letter-spacing:-.2px;
  color:#0f172a;
}
.chart-head strong{
  font-size:15px;
  color:#0f172a;
  font-weight:400;
  white-space:nowrap;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  border-radius:999px;
  padding:7px 10px;
}
.donut-premium{
  display:grid;
  grid-template-rows:auto 1fr;
  gap:16px;
  align-items:center;
}
.donut-premium-chart{
  width:172px;
  height:172px;
  border-radius:50%;
  margin:0 auto;
  position:relative;
  box-shadow:inset 0 0 0 1px rgba(15,23,42,.08), 0 14px 26px rgba(15,23,42,.08);
}
.donut-premium-chart:after{
  content:"";
  position:absolute;
  inset:36px;
  background:#fff;
  border-radius:50%;
  box-shadow:inset 0 0 0 1px #e2e8f0;
}
.donut-premium-center{
  position:absolute;
  inset:42px;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.donut-premium-center strong{
  font-size:16px;
  line-height:1.08;
  color:#0f172a;
  font-weight:600;
  letter-spacing:-.6px;
}
.donut-premium-center span{
  margin-top:5px;
  color:#64748b;
  font-size:11px;
  font-weight:400;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.donut-premium-legend{
  display:grid;
  gap:8px;
}
.legend-line{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto 42px;
  align-items:center;
  gap:8px;
  padding:8px 0;
  border-bottom:1px solid #eef2f7;
  color:#334155;
}
.legend-line:last-child{border-bottom:0}
.legend-name{
  display:flex;
  align-items:center;
  min-width:0;
  gap:8px;
  font-weight:400;
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.legend-name i{
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
  flex:0 0 auto;
}
.legend-line b{
  font-size:12px;
  color:#0f172a;
  font-weight:400;
  white-space:nowrap;
}
.legend-line small{
  text-align:right;
  color:#64748b;
  font-size:11px;
  font-weight:400;
}
.mini-bars-premium{
  min-height:260px;
  display:flex;
  align-items:center;
}
.mini-bars-list{
  width:100%;
  display:grid;
  gap:18px;
}
.mini-bar-row{display:grid;gap:8px}
.mini-bar-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.mini-bar-top span{
  color:#334155;
  font-size:12px;
  font-weight:850;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.mini-bar-top b{
  color:#0f172a;
  font-size:12px;
  font-weight:950;
  white-space:nowrap;
}
.mini-bar-track{
  height:10px;
  background:#edf2f7;
  border-radius:999px;
  overflow:hidden;
}
.mini-bar-track i{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#60a5fa,#2563eb);
  box-shadow:0 8px 16px rgba(37,99,235,.16);
}
.chart-wide-panel{padding:18px 20px 14px}
.chart-bars.clean{
  height:236px;
  border:1px solid #eef2f7;
  border-radius:16px;
  padding:18px 14px 10px;
  background:linear-gradient(180deg,#ffffff,#f8fafc);
}
.chart-bars.clean .bar-wrap{height:174px}
.chart-bars.clean .bar-wrap span{width:62%;background:linear-gradient(180deg,#93c5fd,#2563eb)}
.chart-bars.clean .bar-item small{font-size:10px;color:#64748b}
.dashboard-tables{margin-top:0}
@media(max-width:1280px){
  .chart-row.four{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:768px){
  .chart-row.four{grid-template-columns:1fr!important;gap:14px!important}
  .chart-card{min-height:auto;padding:16px!important}
  .chart-head{display:block}
  .chart-head strong{display:inline-block;margin-top:10px}
  .donut-premium-chart{width:164px;height:164px}
  .legend-line{grid-template-columns:minmax(0,1fr) auto 38px}
  .mini-bars-premium{min-height:auto}
  .chart-bars.clean{min-width:560px}
}


/* =========================================================
   LOCX V6.4 - RELATÓRIOS EM 2 COLUNAS + GRÁFICOS ALINHADOS
   ========================================================= */
.report-charts{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:18px!important;align-items:stretch;width:100%}
.report-chart-card{min-width:0;min-height:340px;display:flex;flex-direction:column}
.report-chart-card h2{font-size:20px;line-height:1.15;margin-bottom:18px;color:#0f172a;letter-spacing:-.25px}
.report-bars{flex:1;height:270px!important;min-width:0!important;display:flex;align-items:end;gap:18px;padding:22px 18px 12px!important;border:1px solid #eef2f7!important;border-radius:16px;background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%)!important;overflow:hidden}
.report-bars .bar-item{min-width:0;gap:10px}
.report-bars .bar-wrap{height:194px;display:flex;align-items:end}
.report-bars .bar-wrap span{width:68%;max-width:76px;min-width:34px;border-radius:11px 11px 4px 4px;background:linear-gradient(180deg,#60a5fa 0%,#2563eb 100%);box-shadow:0 12px 22px rgba(37,99,235,.18)}
.report-bars .bar-item small{font-size:11px;line-height:1.2;font-weight:750;color:#475569;white-space:normal;text-align:center;min-height:28px}
.report-donut{flex:1;display:grid!important;grid-template-columns:240px minmax(0,1fr);gap:22px;align-items:center;padding:12px 10px 6px}
.report-donut .donut{width:218px;height:218px;margin:0 auto;box-shadow:0 14px 28px rgba(15,23,42,.08)}
.report-donut .donut:after{inset:44px}.report-donut .donut strong{font-size:32px;letter-spacing:-.6px}.report-donut .donut span{font-size:11px;margin-top:38px;color:#64748b;text-transform:uppercase;font-weight:850}
.report-donut .legend{width:100%;display:grid;gap:10px;align-content:center}.report-donut .legend p{margin:0;display:grid;grid-template-columns:12px minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 12px;border:1px solid #eef2f7;border-radius:12px;background:#fbfdff;color:#334155;font-size:13px;font-weight:750}.report-donut .legend b{width:10px;height:10px;margin:0}.report-donut .legend span{font-weight:400;color:#0f172a;text-align:right}
.menu a span{width:28px;height:28px;display:grid;place-items:center;border-radius:10px;background:#f8fafc;color:#64748b;flex:0 0 28px}.menu a span svg{width:17px;height:17px;stroke:currentColor;stroke-width:1.9;fill:none;stroke-linecap:round;stroke-linejoin:round}.menu a.active span,.menu a:hover span{background:#eef2ff;color:#4f46e5}
@media(max-width:1100px){.report-charts{grid-template-columns:1fr!important}}
@media(max-width:768px){.report-charts{grid-template-columns:1fr!important;gap:14px!important}.report-chart-card{min-height:auto}.report-bars{min-width:560px!important;height:245px!important}.report-donut{grid-template-columns:1fr!important;gap:14px;padding:4px 0 0}.report-donut .donut{width:190px;height:190px}.report-donut .donut:after{inset:38px}}


/* =========================================================
   LOCX V6.6 - CORREÇÃO DEFINITIVA DO DONUT DE RELATÓRIOS
   Centraliza "180" e "TOTAL" exatamente no miolo branco.
   Também garante exibição dos valores acima das barras.
   ========================================================= */
.report-donut .donut{
  position:relative!important;
  display:block!important;
  flex:0 0 auto;
}
.report-donut .donut:after{
  z-index:1!important;
  pointer-events:none;
}
.report-donut .donut strong{
  position:absolute!important;
  top:50%!important;
  left:50%!important;
  transform:translate(-50%,-62%)!important;
  z-index:3!important;
  display:block!important;
  margin:0!important;
  padding:0!important;
  line-height:1!important;
  text-align:center!important;
  font-size:33px!important;
  font-weight:950!important;
  color:#0f172a!important;
  letter-spacing:-.8px!important;
}
.report-donut .donut span{
  position:absolute!important;
  top:50%!important;
  left:50%!important;
  transform:translate(-50%,18px)!important;
  z-index:3!important;
  display:block!important;
  margin:0!important;
  padding:0!important;
  line-height:1!important;
  text-align:center!important;
  font-size:11px!important;
  font-weight:400!important;
  color:#64748b!important;
  text-transform:uppercase!important;
  letter-spacing:.05em!important;
}

/* Garante valor em moeda acima de cada barra do faturamento por loja */
.report-bars .bar-value{
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  min-height:18px!important;
  margin:0 0 8px 0!important;
  color:#0f172a!important;
  font-size:14px!important;
  line-height:1!important;
  font-weight:400!important;
  letter-spacing:-.2px!important;
  text-align:center!important;
  white-space:nowrap!important;
}
.report-bars .bar-item{
  display:flex!important;
  flex-direction:column!important;
  justify-content:flex-end!important;
  align-items:stretch!important;
}


/* LOGOTIPO SIDEBAR */
.empresa-logo{
 width:100%;
 margin:15px 0;
  
 border-radius:14px;
 background:#fff;
 text-align:center;
}
.empresa-logo img{
 max-width:220px;
 max-height:120px;
 width:auto;
 height:auto;
 object-fit:contain;
}


/* =========================================================
   LOCX - CORREÇÃO DEFINITIVA DOS ÍCONES
   Ícones outline, legíveis e sem preenchimento preto.
   ========================================================= */
.menu a span,
.module-card i{
  color:#2563eb!important;
  background:#eef4ff!important;
}
.menu a span svg,
.module-card i svg{
  width:22px!important;
  height:22px!important;
  display:block!important;
  stroke:currentColor!important;
  fill:none!important;
  stroke-width:2.1!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
.module-card i{
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  border-radius:14px!important;
  display:grid!important;
  place-items:center!important;
  font-size:0!important;
}
.module-card:hover i,
.menu a:hover span,
.menu a.active span{
  color:#4f46e5!important;
  background:#e9ecff!important;
}

/* Menu categorizado */
.menu{gap:8px}
.menu-group{border:1px solid #eef2f7;border-radius:14px;background:#fff;overflow:hidden}
.menu-group summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;cursor:pointer;color:#475569;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;background:#f8fafc}
.menu-group summary::-webkit-details-marker{display:none}
.menu-group summary:after{content:"";width:7px;height:7px;border-right:2px solid #94a3b8;border-bottom:2px solid #94a3b8;transform:rotate(45deg);transition:.16s ease;margin-left:auto}
.menu-group[open] summary:after{transform:rotate(225deg)}
.menu-group summary small{min-width:22px;height:22px;border-radius:999px;display:grid;place-items:center;background:#fff;border:1px solid #e2e8f0;color:#64748b;font-size:11px;font-weight:800}
.menu-group-items{display:grid;gap:4px;padding:6px}
.menu-group .menu-group-items a{border-radius:10px;padding:6px}
.sidebar-menu-info{
  position:relative;
}
.sidebar-menu-info:after{
  content:attr(data-menu-info);
  position:absolute;
  left:calc(100% + 12px);
  top:50%;
  z-index:10030;
  width:260px;
  max-width:calc(100vw - 330px);
  padding:11px 12px;
  border:1px solid #bfcee2;
  border-radius:10px;
  background:#0f172a;
  color:#fff;
  font-size:12px;
  line-height:1.4;
  font-weight:500;
  white-space:normal;
  box-shadow:0 14px 30px rgba(15,23,42,.22);
  opacity:0;
  transform:translateY(-50%) translateX(-4px);
  pointer-events:none;
  transition:opacity .14s ease, transform .14s ease;
}
.sidebar-menu-info:before{
  content:"";
  position:absolute;
  left:calc(100% + 6px);
  top:50%;
  z-index:10031;
  width:12px;
  height:12px;
  background:#0f172a;
  transform:translateY(-50%) rotate(45deg);
  opacity:0;
  pointer-events:none;
  transition:opacity .14s ease;
}
.sidebar-menu-info:hover:after,
.sidebar-menu-info:focus-visible:after{
  opacity:1;
  transform:translateY(-50%) translateX(0);
}
.sidebar-menu-info:hover:before,
.sidebar-menu-info:focus-visible:before{
  opacity:1;
}


/* LOCX V8 - WhatsApp API */
code{display:inline-block;background:#f8fafc;border:1px solid var(--line);border-radius:10px;padding:8px 10px;color:#334155;word-break:break-all;max-width:100%}
.actions form{margin:0}.actions .btn{padding:8px 10px;font-size:12px;box-shadow:none}
.module-card[href]{cursor:pointer}
.pix-cell{display:grid;gap:8px;min-width:240px;max-width:360px;white-space:normal}
.pix-tools{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap}
.pix-copy-btn{padding:8px 10px;font-size:12px;box-shadow:none}
.pix-copy-btn.success{background:var(--green);color:#fff;border-color:var(--green)}
.pix-qr-link{display:inline-flex;background:#fff;border:1px solid var(--line);border-radius:10px;padding:8px}
.pix-qr{width:176px;height:176px;background:#fff;object-fit:contain}
.pix-help{display:block;color:var(--muted);font-size:11px;line-height:1.35}
.pix-code{display:block;font-size:11px;line-height:1.35;padding:6px 8px;max-width:100%;white-space:normal}

/* LOCX CRM */
.crm-workspace{display:grid;gap:18px}
.crm-quickbar{display:flex;justify-content:space-between;align-items:center;gap:16px;background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px 20px;box-shadow:var(--shadow-sm)}
.crm-quickbar span,.crm-contact-strip span{display:block;color:#64748b;font-size:11px;text-transform:uppercase;letter-spacing:.06em;margin-bottom:6px}
.crm-quickbar strong{display:block;color:#0f172a;font-size:22px;line-height:1.15}
.crm-quickbar small{display:block;color:#64748b;margin-top:5px}
.crm-quick-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.crm-stage-cards{grid-template-columns:repeat(6,minmax(140px,1fr))}
.crm-stage-cards .metric{padding:15px}
.crm-stage-cards .metric strong{font-size:22px}
.crm-subtitle{margin:4px 0 0;color:#64748b;font-size:13px}
.crm-layout .table-wrap table{min-width:860px}
.crm-client-table td strong{display:block}
.crm-client-table td small{display:block;color:#64748b;margin-top:4px}
.crm-client-table tr.is-selected td{background:#eef6ff}
.crm-money-open{color:#b91c1c}
.crm-money-ok{color:#166534}
.crm-portal-inbox{display:grid;gap:10px}.crm-inbox-item{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;border:1px solid var(--line);border-radius:12px;padding:12px;background:#fff;color:inherit;text-decoration:none}.crm-inbox-item.needs-human{border-color:#f59e0b;background:#fffbeb}.crm-inbox-item strong{display:block;color:#0f172a}.crm-inbox-item span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:#475569;font-size:12px;line-height:1.35}.crm-inbox-item small{color:#64748b;white-space:nowrap}
.crm-task-list{display:grid;gap:10px}
.crm-task{display:flex;justify-content:space-between;gap:12px;align-items:center;border:1px solid var(--line);border-radius:14px;padding:12px;background:#fbfdff}
.crm-task strong{display:block;color:#0f172a}
.crm-task span{display:block;color:var(--muted);font-size:12px;margin-top:4px}
.crm-task form{margin:0}
.crm-contact-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:12px 0 16px}
.crm-contact-strip div{background:#f8fafc;border:1px solid var(--line);border-radius:14px;padding:12px;min-width:0}
.crm-contact-strip strong{display:block;color:#0f172a;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crm-stage-form{grid-template-columns:minmax(0,1fr) auto;align-items:end;margin-bottom:14px}
.crm-timeline{display:grid;gap:12px}
.crm-event{display:grid;grid-template-columns:110px minmax(0,1fr);gap:12px;border:1px solid var(--line);border-radius:14px;padding:12px;background:#fff}
.crm-event strong{display:block;color:#0f172a}
.crm-event p{margin:5px 0;color:#475569;white-space:normal}
.crm-event small{color:var(--muted)}
.crm-detail .section-head p{margin:6px 0 0;color:var(--muted)}
.crm-portal-chats{display:grid;gap:14px}.crm-portal-chat{border:1px solid var(--line);border-radius:14px;background:#efe7dc;overflow:hidden}.crm-portal-chat.needs-human{border-color:#f59e0b;box-shadow:0 0 0 2px rgba(245,158,11,.12)}.crm-chat-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;background:#075e54;color:#fff;padding:12px 14px}.crm-chat-head strong{display:block;color:#fff}.crm-chat-head strong small{font-weight:500;opacity:.78}.crm-chat-head span,.crm-chat-head small{display:block;color:rgba(255,255,255,.78);font-size:12px}.crm-chat-head .tag{background:rgba(255,255,255,.16);color:#fff;border-color:rgba(255,255,255,.18)}.human-alert{margin-top:5px;text-align:right}.crm-chat-thread{display:grid;gap:8px;align-content:start;max-height:360px;overflow:auto;padding:12px}.crm-chat-line{display:flex}.crm-chat-line.cliente{justify-content:flex-start}.crm-chat-line.humano{justify-content:flex-end}.crm-chat-line.bot{justify-content:flex-start}.crm-chat-bubble{max-width:82%;border-radius:8px 8px 8px 2px;padding:8px 10px;background:#fff;box-shadow:0 1px 1px rgba(15,23,42,.08);color:#0f172a}.crm-chat-line.humano .crm-chat-bubble{background:#dcf8c6;border-radius:8px 8px 2px 8px}.crm-chat-line.bot .crm-chat-bubble{background:#f8fafc}.crm-chat-bubble span{font-size:11px;font-weight:700;color:#475569}.crm-chat-bubble p{margin:4px 0;color:#0f172a;white-space:pre-wrap;line-height:1.35}.crm-chat-bubble time{display:block;text-align:right;color:#64748b;font-size:10px}.crm-chat-reply{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:10px 12px 12px;background:rgba(255,255,255,.45);border-top:1px solid rgba(15,23,42,.08)}.crm-chat-reply textarea{min-height:42px;resize:vertical;border-radius:18px;padding:10px 12px;font-size:13px}.crm-chat-reply button{height:42px;border-radius:18px;padding:0 14px;align-self:end}
@media(max-width:768px){
  .crm-quickbar{display:grid;padding:16px}
  .crm-quick-actions{justify-content:stretch}
  .crm-quick-actions .btn{width:100%;justify-content:center}
  .crm-stage-cards{grid-template-columns:1fr!important}
  .crm-contact-strip{grid-template-columns:1fr}
  .crm-stage-form{grid-template-columns:1fr}
  .crm-event{grid-template-columns:1fr}
  .crm-task{display:grid}
}

/* LOCX LOOK OPERACIONAL */
.look-page{display:grid;gap:18px}
.look-hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:20px;
  padding:22px;
  box-shadow:var(--shadow);
}
.look-hero span{
  display:block;
  color:#2563eb;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:700;
  margin-bottom:8px;
}
.look-hero h2{
  margin:0;
  color:#0f172a;
  font-size:26px;
  letter-spacing:0;
}
.look-hero p{
  margin:8px 0 0;
  color:#64748b;
  max-width:760px;
  line-height:1.5;
}
.look-hero-mark{
  width:76px;
  height:76px;
  border-radius:18px;
  display:grid;
  place-items:center;
  color:#2563eb;
  background:#eef4ff;
  flex:0 0 76px;
}
.look-hero-mark svg{width:36px;height:36px}
.look-routines{display:grid;gap:12px}
.look-routine{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  border:1px solid var(--line);
  border-radius:16px;
  padding:15px;
  background:#fbfdff;
}
.look-routine strong{display:block;color:#0f172a;font-size:15px}
.look-routine p{margin:6px 0 0;color:#475569;line-height:1.45}
.look-shortcuts{display:grid;gap:12px}
.look-shortcuts .module-card{box-shadow:none}
.look-steps{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.look-steps div{
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  background:#fff;
  display:grid;
  gap:8px;
}
.look-steps span{
  width:34px;
  height:34px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#eef4ff;
  color:#2563eb;
  font-weight:800;
}
.look-steps strong{color:#0f172a}
.look-steps small{color:#64748b;line-height:1.4}
@media(max-width:768px){
  .look-hero{display:grid;padding:18px}
  .look-hero-mark{width:58px;height:58px;grid-row:1}
  .look-hero h2{font-size:22px}
  .look-routine{display:grid}
  .look-steps{grid-template-columns:1fr}
}

/* CONTRATO DE LOCACAO */
.contract-card-button{
  width:100%;
  border:1px solid var(--line);
  text-align:left;
  cursor:pointer;
  font:inherit;
}
.contract-generate-btn{
  background:linear-gradient(135deg,#dc001b,#ef4444);
  color:#fff;
  box-shadow:0 10px 18px rgba(220,0,27,.22);
}
.contract-modal{
  position:fixed;
  inset:0;
  z-index:80;
  display:none;
}
.contract-modal.is-open{display:block}
.contract-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.58);
}
.contract-modal-dialog{
  position:relative;
  width:min(920px,calc(100vw - 32px));
  max-height:calc(100vh - 32px);
  margin:16px auto;
  background:#fff;
  border-radius:16px;
  box-shadow:0 24px 70px rgba(15,23,42,.28);
  overflow:auto;
}
.contract-modal-head{
  position:sticky;
  top:0;
  z-index:1;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  padding:18px 22px;
  background:#fff;
  border-bottom:1px solid var(--line);
}
.contract-modal-head h2{margin:0;color:#0f172a}
.contract-modal-head p{margin:4px 0 0;color:#64748b}
.contract-modal-close{
  border:0;
  background:#f1f5f9;
  color:#0f172a;
  width:34px;
  height:34px;
  border-radius:8px;
  font-size:24px;
  line-height:1;
  cursor:pointer;
}
.contract-document{
  color:#111827;
  padding:34px 42px;
  font-family:Arial,Helvetica,sans-serif;
  line-height:1.5;
}
.contract-document .contract-brand{
  margin-bottom:18px;
}
.contract-document .contract-brand img{width:210px;height:auto}
.contract-document h1{
  margin:0 0 8px;
  font-size:22px;
  text-align:center;
  letter-spacing:0;
}
.contract-document h2{
  margin:24px 0 12px;
  font-size:16px;
  color:#111827;
}
.contract-document h3{
  margin:0 0 24px;
  text-align:center;
  font-size:15px;
}
.contract-document p{margin:0 0 10px}
.contract-date{margin-top:28px!important}
.contract-signatures{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:48px;
  margin-top:64px;
  text-align:center;
}
.contract-signatures span{
  display:block;
  border-top:1px solid #111827;
  margin-bottom:8px;
}
.contract-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:16px 22px 22px;
  border-top:1px solid var(--line);
}
@media(max-width:768px){
  .contract-document{padding:24px 20px}
  .contract-signatures{grid-template-columns:1fr;gap:42px}
  .contract-modal-actions{display:grid}
}

/* =========================================================
   CRM V7 - CENTRAL DE ATENDIMENTO
   Caixa de entrada, conversa e contexto do cliente.
   ========================================================= */
.crm-desk{display:grid;gap:18px;min-width:0}
.crm-desk *{box-sizing:border-box}
.crm-eyebrow{display:block;color:#64748b;font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;margin-bottom:6px}
.crm-desk-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:24px 26px;border:1px solid #dbe4ee;border-radius:20px;background:linear-gradient(135deg,#ffffff 0%,#f7fbff 58%,#edf8f5 100%);box-shadow:0 12px 30px rgba(15,23,42,.06)}
.crm-desk-hero h2{margin:0;color:#0f172a;font-size:24px;letter-spacing:-.45px}.crm-desk-hero p{margin:7px 0 0;color:#64748b;max-width:720px}
.crm-live-indicator{display:flex;align-items:center;gap:8px;white-space:nowrap;border:1px solid #cce8df;background:#f0fdf8;color:#087a5b;border-radius:999px;padding:9px 13px;font-size:12px;font-weight:700}.crm-live-indicator i{width:8px;height:8px;border-radius:50%;background:#10b981;box-shadow:0 0 0 5px rgba(16,185,129,.12)}
.crm-support-metrics{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}.crm-support-metrics article{position:relative;overflow:hidden;background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:15px 16px;box-shadow:0 7px 18px rgba(15,23,42,.04)}.crm-support-metrics article:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:#64748b}.crm-support-metrics article.attention:before{background:#f59e0b}.crm-support-metrics article.active:before{background:#2563eb}.crm-support-metrics article.waiting:before{background:#8b5cf6}.crm-support-metrics article.task:before{background:#ef4444}.crm-support-metrics span,.crm-support-metrics small{display:block;color:#64748b}.crm-support-metrics span{font-size:12px;font-weight:700}.crm-support-metrics strong{display:block;color:#0f172a;font-size:27px;line-height:1;margin:9px 0 6px}.crm-support-metrics small{font-size:11px}
.crm-service-workspace{display:grid;grid-template-columns:310px minmax(430px,1fr) 300px;min-height:720px;border:1px solid #dce4ec;border-radius:20px;overflow:hidden;background:#fff;box-shadow:0 18px 42px rgba(15,23,42,.07)}
.crm-service-workspace>.panel{margin:0;border:0;border-radius:0;box-shadow:none;min-width:0;padding:0}.crm-service-workspace>.panel+ .panel{border-left:1px solid #e2e8f0}
.crm-conversation-sidebar{display:flex;flex-direction:column;background:#fbfcfe}.crm-sidebar-head{display:flex;align-items:center;justify-content:space-between;padding:18px 18px 12px}.crm-sidebar-head h3,.crm-section-title h3,.crm-context-profile h3{margin:0;color:#0f172a;font-size:18px}.crm-queue-count{display:grid;place-items:center;min-width:28px;height:28px;border-radius:999px;background:#e9f2ff;color:#2563eb;font-size:12px;font-weight:800}
.crm-search-box{display:flex;align-items:center;gap:8px;margin:0 14px 12px;padding:9px 11px;border:1px solid #dce4ec;border-radius:11px;background:#fff;color:#64748b}.crm-search-box:focus-within{border-color:#8bb8ef;box-shadow:0 0 0 3px rgba(37,99,235,.08)}.crm-search-box input{width:100%;border:0!important;outline:0!important;padding:0!important;min-height:0!important;background:transparent!important;box-shadow:none!important;font-size:12px}.crm-search-box.small{width:min(270px,100%);margin:0}.crm-inbox-filters{display:flex;gap:6px;overflow:auto;padding:0 14px 12px;scrollbar-width:none}.crm-inbox-filters::-webkit-scrollbar{display:none}.crm-inbox-filters button{flex:0 0 auto;border:1px solid #dce4ec;background:#fff;color:#64748b;border-radius:999px;padding:7px 10px;font-size:10px;font-weight:700;box-shadow:none}.crm-inbox-filters button.is-active{border-color:#1f6feb;background:#1f6feb;color:#fff}
.crm-conversation-list{flex:1;min-height:0;overflow:auto;border-top:1px solid #edf1f5}.crm-conversation-item{position:relative;display:flex;align-items:flex-start;gap:10px;padding:13px 12px;color:inherit;text-decoration:none;border-bottom:1px solid #edf1f5;background:#fff;transition:.16s ease}.crm-conversation-item:hover{background:#f6f9fd}.crm-conversation-item.is-selected{background:#edf5ff;box-shadow:inset 3px 0 #2563eb}.crm-conversation-item.has-unread .crm-conversation-title strong{font-weight:900}.crm-contact-avatar{display:grid;place-items:center;flex:0 0 auto;width:40px;height:40px;border-radius:13px;background:linear-gradient(145deg,#dcecff,#e8f8f2);color:#0e4f78;font-size:12px;font-weight:900;border:1px solid #d7e5ef}.crm-contact-avatar.large{width:45px;height:45px;border-radius:14px}.crm-contact-avatar.xlarge{width:54px;height:54px;border-radius:17px;font-size:15px}.crm-conversation-content{display:block;min-width:0;flex:1}.crm-conversation-title{display:flex;align-items:center;justify-content:space-between;gap:8px}.crm-conversation-title strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#0f172a;font-size:12px}.crm-conversation-title time{color:#94a3b8;font-size:10px}.crm-conversation-preview{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:4px 0 7px;color:#64748b;font-size:11px}.crm-conversation-meta{display:flex;align-items:center;gap:6px;min-width:0}.crm-conversation-meta small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#94a3b8;font-size:9px}.crm-conversation-meta b{margin-left:auto;color:#b45309;font-size:8px;text-transform:uppercase}.crm-status-dot{display:inline-flex;align-items:center;gap:4px;white-space:nowrap;color:#475569;font-size:9px;font-style:normal;font-weight:800}.crm-status-dot:before{content:"";width:6px;height:6px;border-radius:50%;background:#94a3b8}.crm-status-dot.is-attention:before,.crm-status-pill.is-attention{background:#f59e0b}.crm-status-dot.is-new:before,.crm-status-pill.is-new{background:#0ea5e9}.crm-status-dot.is-active:before,.crm-status-pill.is-active{background:#2563eb}.crm-status-dot.is-waiting:before,.crm-status-pill.is-waiting{background:#8b5cf6}.crm-status-dot.is-resolved:before,.crm-status-pill.is-resolved{background:#10b981}.crm-unread-badge{position:absolute;right:10px;top:40px;display:grid;place-items:center;width:17px;height:17px;border-radius:50%;background:#2563eb;color:#fff;font-size:9px;font-weight:900}
.crm-chat-panel{background:#f4f7fb}.crm-active-conversation{height:100%;min-height:720px;display:grid;grid-template-rows:auto auto minmax(260px,1fr) auto}.crm-chat-header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:15px 18px;background:#fff;border-bottom:1px solid #e2e8f0}.crm-chat-person{display:flex;align-items:center;gap:11px;min-width:0}.crm-chat-person h3{margin:0;color:#0f172a;font-size:15px}.crm-chat-person p{margin:3px 0 0;color:#64748b;font-size:11px}.crm-chat-actions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}.crm-chat-actions .btn{padding:8px 11px;font-size:10px}.crm-resolve-button{background:#0f766e!important}.crm-chat-contextbar{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;background:#fff;border-bottom:1px solid #e2e8f0}.crm-chat-contextbar>span{min-width:0;padding:9px 12px;border-right:1px solid #edf1f5}.crm-chat-contextbar>span:last-child{border-right:0}.crm-chat-contextbar small,.crm-chat-contextbar b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crm-chat-contextbar small{color:#94a3b8;font-size:9px;text-transform:uppercase;font-weight:700}.crm-chat-contextbar b{margin-top:3px;color:#334155;font-size:10px}.crm-status-pill{display:inline-flex!important;width:max-content;max-width:100%;align-items:center;padding:3px 7px;border-radius:999px;color:#fff!important}.text-danger{color:#b91c1c!important}
.crm-chat-thread{display:flex;flex-direction:column;gap:8px;overflow:auto;padding:18px 22px;background-color:#f0f4f8;background-image:radial-gradient(rgba(100,116,139,.08) 1px,transparent 1px);background-size:18px 18px}.crm-chat-day{display:flex;justify-content:center;margin:2px 0 8px}.crm-chat-day span{background:rgba(255,255,255,.9);border:1px solid #e2e8f0;border-radius:999px;padding:5px 10px;color:#64748b;font-size:9px;font-weight:700}.crm-chat-line{display:flex;width:100%}.crm-chat-line.cliente{justify-content:flex-start}.crm-chat-line.humano{justify-content:flex-end}.crm-chat-line.bot{justify-content:flex-start}.crm-chat-bubble{max-width:min(78%,580px);border:1px solid #e1e7ee;border-radius:14px 14px 14px 4px;padding:9px 11px;background:#fff;box-shadow:0 3px 8px rgba(15,23,42,.05)}.crm-chat-line.humano .crm-chat-bubble{border-color:#bfe4d8;background:#dcf8ee;border-radius:14px 14px 4px 14px}.crm-chat-line.bot .crm-chat-bubble{background:#f8fbff;border-color:#dce8f5}.crm-chat-bubble span{display:block;color:#0f766e;font-size:9px;font-weight:900}.crm-chat-bubble p{margin:4px 0;color:#172033;white-space:pre-wrap;line-height:1.42;font-size:12px}.crm-chat-bubble time{display:block;text-align:right;color:#94a3b8;font-size:9px}
.crm-composer{border-top:1px solid #dce4ec;background:#fff}.crm-quick-replies{display:flex;align-items:center;gap:6px;overflow:auto;padding:9px 12px 3px;scrollbar-width:thin}.crm-quick-replies>span{flex:0 0 auto;color:#64748b;font-size:9px;font-weight:800;text-transform:uppercase}.crm-quick-replies button{flex:0 0 auto;max-width:270px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid #cbd8e6;border-radius:999px;background:#f8fafc;color:#334155;padding:6px 9px;font-size:9px;box-shadow:none}.crm-quick-replies button:hover{border-color:#7ca8dc;background:#edf5ff;color:#1d4ed8}.crm-chat-reply{display:block;padding:9px 12px 12px;background:#fff;border:0}.crm-chat-reply textarea{display:block;width:100%;min-height:72px;max-height:160px;resize:vertical;border:1px solid #ccd8e5;border-radius:13px;padding:11px 12px;font-size:12px;line-height:1.45;background:#fbfcfe}.crm-chat-reply textarea:focus{border-color:#7ca8dc;box-shadow:0 0 0 3px rgba(37,99,235,.08)}.crm-composer-footer{display:flex;align-items:center;gap:10px;margin-top:8px}.crm-composer-footer small{color:#94a3b8;font-size:9px}.crm-composer-footer kbd{border:1px solid #dbe3ec;border-bottom-width:2px;border-radius:4px;background:#fff;padding:1px 4px;font-family:inherit}.crm-composer-footer>span{margin-left:auto;color:#94a3b8;font-size:9px}.crm-composer-footer button{display:inline-flex;align-items:center;gap:8px;border-radius:10px;padding:9px 13px;font-size:10px}.crm-composer-footer button b{font-size:13px}.crm-closed-conversation{display:grid;justify-items:center;text-align:center;gap:5px;padding:18px;border-top:1px solid #dce4ec;background:#fff}.crm-closed-conversation strong{color:#0f172a}.crm-closed-conversation p{margin:0 0 6px;color:#64748b;font-size:11px}
.crm-customer-context{background:#fff;overflow:auto}.crm-context-profile{display:flex;align-items:center;gap:12px;padding:18px;border-bottom:1px solid #edf1f5}.crm-context-profile h3{font-size:15px}.crm-context-profile p{margin:3px 0 0;color:#64748b;font-size:10px}.crm-contact-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:12px 14px;border-bottom:1px solid #edf1f5}.crm-contact-actions a{display:flex;justify-content:center;border:1px solid #dce4ec;border-radius:9px;padding:7px 5px;color:#334155;text-decoration:none;font-size:9px;font-weight:800;background:#fbfcfe}.crm-contact-actions a:hover{border-color:#86aee0;color:#1d4ed8;background:#edf5ff}.crm-context-section{padding:14px;border-bottom:1px solid #edf1f5}.crm-context-section header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.crm-context-section h4{margin:0;color:#334155;font-size:11px;text-transform:uppercase;letter-spacing:.04em}.crm-financial-snapshot{display:grid;grid-template-columns:1fr 1fr;gap:8px}.crm-financial-snapshot article{padding:10px;border:1px solid #e2e8f0;border-radius:10px;background:#f8fafc}.crm-financial-snapshot article.danger{border-color:#fecaca;background:#fff5f5}.crm-financial-snapshot span,.crm-financial-snapshot strong{display:block}.crm-financial-snapshot span{color:#64748b;font-size:9px}.crm-financial-snapshot strong{margin-top:5px;color:#0f172a;font-size:12px}.crm-compact-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px}.crm-compact-form select,.crm-stacked-form input,.crm-stacked-form select,.crm-stacked-form textarea{width:100%;min-height:35px;border:1px solid #dce4ec;border-radius:8px;padding:7px 8px;font-size:10px;background:#fff}.crm-compact-form button,.crm-stacked-form button{border-radius:8px;padding:7px 10px;font-size:9px}.crm-next-task{border-left:3px solid #2563eb;padding:7px 9px;background:#f5f9ff;border-radius:0 8px 8px 0}.crm-next-task strong,.crm-next-task span{display:block}.crm-next-task strong{color:#0f172a;font-size:11px}.crm-next-task span{margin-top:3px;color:#64748b;font-size:9px}.crm-context-muted{margin:0;color:#94a3b8;font-size:10px}.crm-context-details{border-bottom:1px solid #edf1f5}.crm-context-details summary{cursor:pointer;padding:13px 14px;color:#334155;font-size:10px;font-weight:800;list-style:none}.crm-context-details summary:after{content:"+";float:right;color:#64748b}.crm-context-details[open] summary:after{content:"−"}.crm-stacked-form{display:grid;gap:7px;padding:0 14px 14px}.crm-stacked-form textarea{min-height:70px;resize:vertical}
.crm-management-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(320px,1fr);gap:18px}.crm-management-grid>.panel,.crm-client-base,.crm-history-panel{margin:0;border-radius:18px}.crm-section-title{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}.crm-section-title h3{font-size:17px}.crm-section-title>b{display:grid;place-items:center;min-width:30px;height:30px;border-radius:999px;background:#eef3f8;color:#475569;font-size:11px}.crm-stage-cards.modern{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px}.crm-stage-cards.modern article{position:relative;overflow:hidden;border:1px solid #e2e8f0;border-radius:12px;padding:12px;background:#fbfcfe}.crm-stage-cards.modern article:after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:linear-gradient(90deg,#2563eb,#10b981)}.crm-stage-cards.modern span,.crm-stage-cards.modern small{display:block;color:#64748b;font-size:9px}.crm-stage-cards.modern strong{display:block;margin:7px 0 2px;color:#0f172a;font-size:21px}.crm-task-list.modern{display:grid;gap:7px}.crm-task-list.modern article{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #e2e8f0;border-radius:10px;padding:9px 10px;background:#fff}.crm-task-list.modern article.is-overdue{border-color:#fecaca;background:#fff7f7}.crm-task-list.modern strong,.crm-task-list.modern span{display:block}.crm-task-list.modern strong{color:#0f172a;font-size:10px}.crm-task-list.modern span{margin-top:3px;color:#64748b;font-size:9px}.crm-task-list.modern button{border:1px solid #dce4ec;background:#fff;color:#334155;border-radius:8px;padding:6px 8px;font-size:9px;box-shadow:none}.crm-client-base .crm-section-title{margin-bottom:12px}.crm-client-table thead th{background:#f8fafc}.crm-client-table td strong,.crm-client-table td small{display:block}.crm-client-table td small{margin-top:3px;color:#64748b}.crm-stage-label{display:inline-flex;border-radius:999px;background:#edf5ff;color:#1d4ed8;padding:5px 8px;font-size:9px;font-weight:800}.crm-number-badge{display:inline-grid;place-items:center;min-width:26px;height:24px;border-radius:8px;background:#eef2f7;color:#475569;font-size:10px;font-weight:900}.crm-number-badge.danger{background:#fee2e2;color:#b91c1c}.crm-timeline.modern{display:grid;grid-template-columns:1fr 1fr;gap:10px}.crm-timeline.modern article{display:grid;grid-template-columns:12px minmax(0,1fr);gap:9px;border:1px solid #e2e8f0;border-radius:11px;padding:11px;background:#fbfcfe}.crm-timeline-icon{width:9px;height:9px;border-radius:50%;margin-top:4px;background:#3b82f6;box-shadow:0 0 0 4px rgba(59,130,246,.1)}.crm-timeline-icon.ok{background:#10b981}.crm-timeline-icon.warn{background:#f59e0b}.crm-timeline-icon.danger{background:#ef4444}.crm-timeline.modern small,.crm-timeline.modern strong{display:block}.crm-timeline.modern small{color:#94a3b8;font-size:9px}.crm-timeline.modern strong{margin-top:4px;color:#0f172a;font-size:11px}.crm-timeline.modern p{margin:4px 0 0;color:#64748b;font-size:10px;line-height:1.4}.crm-empty-state{display:grid;place-items:center;text-align:center;padding:30px;color:#94a3b8}.crm-empty-state>span{font-size:30px}.crm-empty-state strong{color:#334155}.crm-empty-state p{max-width:330px;margin:6px 0 0;font-size:11px;line-height:1.45}.crm-empty-state.compact{padding:18px}.crm-chat-empty{height:100%;min-height:560px;align-content:center}
@media(max-width:1420px){.crm-service-workspace{grid-template-columns:285px minmax(400px,1fr) 270px}.crm-support-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.crm-stage-cards.modern{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:1120px){.crm-service-workspace{grid-template-columns:300px minmax(0,1fr)}.crm-customer-context{grid-column:1/-1;border-left:0!important;border-top:1px solid #e2e8f0;display:grid;grid-template-columns:260px repeat(2,minmax(0,1fr));align-items:start}.crm-context-profile{grid-row:span 2}.crm-contact-actions{grid-column:1}.crm-context-details{align-self:stretch}.crm-support-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.crm-management-grid{grid-template-columns:1fr}.crm-chat-contextbar{grid-template-columns:repeat(3,minmax(0,1fr))}.crm-chat-contextbar>span:nth-child(n+4){border-top:1px solid #edf1f5}.crm-timeline.modern{grid-template-columns:1fr}}
@media(max-width:780px){.crm-desk-hero{display:block;padding:18px}.crm-live-indicator{width:max-content;margin-top:14px}.crm-support-metrics{grid-template-columns:1fr 1fr}.crm-service-workspace{display:block;overflow:visible;border-radius:16px}.crm-conversation-sidebar{max-height:420px;border-bottom:1px solid #e2e8f0}.crm-chat-panel{border-left:0!important}.crm-active-conversation{min-height:660px}.crm-chat-header{align-items:flex-start}.crm-chat-actions{max-width:190px}.crm-chat-contextbar{grid-template-columns:1fr 1fr}.crm-chat-contextbar>span{border-top:1px solid #edf1f5}.crm-customer-context{display:block;border-top:1px solid #e2e8f0}.crm-stage-cards.modern{grid-template-columns:1fr 1fr}.crm-composer-footer{flex-wrap:wrap}.crm-composer-footer>span{margin-left:0}.crm-composer-footer button{margin-left:auto}.crm-chat-bubble{max-width:90%}.crm-section-title{align-items:flex-start;flex-direction:column}.crm-search-box.small{width:100%}}
@media(max-width:520px){.crm-support-metrics{grid-template-columns:1fr}.crm-stage-cards.modern{grid-template-columns:1fr}.crm-chat-header{display:block}.crm-chat-actions{max-width:none;margin-top:10px;justify-content:flex-start}.crm-chat-contextbar{grid-template-columns:1fr}.crm-chat-contextbar>span{border-right:0}.crm-chat-thread{padding:14px}.crm-composer-footer small{width:100%}}

/* CRM - cliente único e histórico de atendimentos */
.crm-conversation-history-summary{display:block;margin-top:6px;color:#64748b;font-size:9px;line-height:1.3}
.crm-attendance-history-section>header>span{display:grid;place-items:center;min-width:24px;height:24px;border-radius:999px;background:#eef3f8;color:#475569;font-size:9px;font-weight:900}
.crm-attendance-history{display:grid;gap:7px;max-height:235px;overflow:auto;padding-right:2px}
.crm-attendance-history>a{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid #e2e8f0;border-radius:10px;padding:9px;background:#fbfcfe;color:inherit;text-decoration:none;transition:.16s ease}
.crm-attendance-history>a:hover{border-color:#9dbde3;background:#f2f7ff}
.crm-attendance-history>a.is-current{border-color:#7aa8df;background:#edf5ff;box-shadow:inset 3px 0 #2563eb}
.crm-attendance-history>a>span{min-width:0}.crm-attendance-history strong,.crm-attendance-history small{display:block}.crm-attendance-history strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#0f172a;font-size:10px}.crm-attendance-history small{margin-top:3px;color:#94a3b8;font-size:8px}.crm-attendance-history .crm-status-dot{flex:0 0 auto}

/* Portal do cliente - retomada ou novo assunto */
.chat-resume-card{display:grid;gap:5px;width:calc(100% - 34px);margin-left:34px;padding:11px;border:1px solid #bdd8d2;border-radius:12px;background:#fff;box-shadow:0 2px 8px rgba(15,23,42,.06)}
.chat-resume-card.is-hidden{display:none}.chat-resume-card>span{color:#64748b;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.chat-resume-card>strong{color:#0f172a;font-size:12px}.chat-resume-card>p{margin:0;color:#64748b;font-size:10px}.chat-resume-card>div{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:4px}.chat-resume-card button{min-height:34px;border-radius:9px;padding:7px 8px;font-size:10px}.chat-resume-card button.secondary{border:1px solid #cbd5e1;background:#f8fafc;color:#334155;box-shadow:none}
.chat-history-compact{width:calc(100% - 34px);margin-left:34px;border-top:1px solid rgba(15,23,42,.08);padding-top:7px}.chat-history-compact summary{cursor:pointer;color:#64748b;font-size:10px;font-weight:700}.chat-history-compact>div{display:grid;gap:5px;margin-top:7px}.chat-history-compact article{display:grid;gap:2px;border:1px solid rgba(15,23,42,.08);border-radius:8px;padding:7px 8px;background:rgba(255,255,255,.65)}.chat-history-compact article span{color:#334155;font-size:10px;font-weight:700}.chat-history-compact article small{color:#64748b;font-size:9px}
@media(max-width:520px){.chat-resume-card>div{grid-template-columns:1fr}.crm-attendance-history{max-height:none}}


/* =========================================================
   CRM V8 - ALINHAMENTO VISUAL DAS CONVERSAS
   Atendente/assistente à esquerda e cliente à direita.
   ========================================================= */
.crm-chat-line.cliente{justify-content:flex-end}
.crm-chat-line.humano,.crm-chat-line.bot{justify-content:flex-start}
.crm-chat-line.cliente .crm-chat-bubble{
  border-color:#bfd5f5;
  background:#e8f1ff;
  border-radius:16px 16px 4px 16px;
  box-shadow:0 3px 9px rgba(37,99,235,.08)
}
.crm-chat-line.humano .crm-chat-bubble{
  border-color:#cfe6dd;
  background:#ffffff;
  border-radius:16px 16px 16px 4px;
  box-shadow:0 3px 9px rgba(15,118,110,.07)
}
.crm-chat-line.bot .crm-chat-bubble{
  border-color:#d8e5f2;
  background:#f8fbff;
  border-radius:16px 16px 16px 4px
}
.crm-chat-line.cliente .crm-chat-bubble>span{color:#1d4ed8;text-align:right}
.crm-chat-line.humano .crm-chat-bubble>span{color:#0f766e}
.crm-chat-line.bot .crm-chat-bubble>span{color:#475569}
.crm-chat-line .crm-chat-bubble p{text-align:left}
.crm-chat-line .crm-chat-bubble time{text-align:right}

/* Portal do cliente: mantém o mesmo sentido visual do CRM. */
.chat-row.cliente{justify-content:flex-end}
.chat-row.humano,.chat-row.bot{justify-content:flex-start}
.chat-row.cliente .chat-bubble{
  background:#e8f1ff;
  border:1px solid #bfd5f5;
  border-radius:12px 12px 3px 12px
}
.chat-row.humano .chat-bubble,.chat-row.bot .chat-bubble{
  background:#ffffff;
  border:1px solid #dce6ef;
  border-radius:12px 12px 12px 3px
}
.chat-row.cliente .chat-sender{color:#1d4ed8;text-align:right}
.chat-row.humano .chat-sender{color:#0f766e}
.chat-row.bot .chat-sender{color:#475569}
@media(max-width:520px){
  .crm-chat-bubble,.chat-bubble{max-width:88%}
}

/* =========================================================
   CRM V7.4 - CORRECAO DE VISIBILIDADE E SCROLL DO CHAT
   Mantem a conversa central, cabecalho e resposta visiveis.
   ========================================================= */
@media (min-width:1121px){
  .crm-service-workspace{
    height:clamp(620px,calc(100dvh - 36px),820px);
    min-height:0;
    scroll-margin-top:16px;
  }
  .crm-service-workspace>.panel{
    min-height:0;
    overflow:hidden;
  }
  .crm-conversation-sidebar,
  .crm-chat-panel,
  .crm-customer-context{
    height:100%;
    min-height:0;
  }
}

.crm-chat-panel{
  min-width:0;
  min-height:0;
  overflow:hidden;
}
.crm-active-conversation{
  height:100%;
  min-height:0;
  overflow:hidden;
  grid-template-rows:auto auto minmax(0,1fr) auto;
}
.crm-chat-thread{
  min-width:0;
  min-height:0;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  scroll-behavior:smooth;
}
.crm-chat-header,
.crm-chat-contextbar,
.crm-composer,
.crm-closed-conversation{
  position:relative;
  z-index:2;
  flex:0 0 auto;
}
.crm-chat-bubble{
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* Padrao visual solicitado: atendente/assistente a esquerda e cliente a direita. */
.crm-chat-line.cliente{justify-content:flex-end}
.crm-chat-line.humano,
.crm-chat-line.bot{justify-content:flex-start}
.crm-chat-line.cliente .crm-chat-bubble{
  border-color:#bfd7ff;
  background:#e8f2ff;
  border-radius:14px 14px 4px 14px;
}
.crm-chat-line.humano .crm-chat-bubble,
.crm-chat-line.bot .crm-chat-bubble{
  border-radius:14px 14px 14px 4px;
}
.crm-chat-line.cliente .crm-chat-bubble span{
  color:#1d4ed8;
  text-align:right;
}

@media (max-width:1120px) and (min-width:781px){
  .crm-service-workspace{
    height:auto;
    min-height:0;
    overflow:visible;
    scroll-margin-top:16px;
  }
  .crm-conversation-sidebar,
  .crm-chat-panel{
    height:clamp(600px,calc(100dvh - 40px),760px);
    min-height:0;
  }
  .crm-customer-context{
    height:auto;
    max-height:none;
    overflow:visible;
  }
}

@media (max-width:780px){
  .crm-service-workspace{
    height:auto;
    min-height:0;
    overflow:visible;
    scroll-margin-top:72px;
  }
  .crm-conversation-sidebar{
    height:auto;
    max-height:360px;
    overflow:hidden;
  }
  .crm-chat-panel{
    height:clamp(560px,calc(100dvh - 92px),720px);
    min-height:560px;
    overflow:hidden;
  }
  .crm-active-conversation{
    height:100%;
    min-height:0;
  }
  .crm-chat-thread{
    padding:14px 12px;
  }
  .crm-chat-bubble{
    max-width:88%;
  }
}

@media (max-width:520px){
  .crm-chat-panel{
    height:calc(100dvh - 82px);
    min-height:520px;
  }
  .crm-chat-header{
    max-height:132px;
    overflow:auto;
  }
  .crm-chat-contextbar{
    max-height:138px;
    overflow:auto;
  }
  .crm-quick-replies{
    max-height:48px;
  }
  .crm-chat-reply textarea{
    min-height:58px;
    max-height:96px;
  }
}


/* =========================================================
   CRM V7.5 - CLIENTE SEMPRE VISIVEL NA CONVERSA
   Exibe inclusive a escolha inicial do assunto e evita
   que baloes sejam ocultados ou comprimidos pelo painel.
   ========================================================= */
.crm-chat-thread{
  justify-content:flex-start!important;
  align-items:stretch;
}
.crm-chat-thread>.crm-chat-line{
  display:flex!important;
  flex:0 0 auto;
  min-height:max-content;
  visibility:visible!important;
  opacity:1!important;
}
.crm-chat-thread>.crm-chat-line.cliente{
  justify-content:flex-end!important;
}
.crm-chat-thread>.crm-chat-line.humano,
.crm-chat-thread>.crm-chat-line.bot{
  justify-content:flex-start!important;
}
.crm-chat-line.cliente .crm-chat-bubble{
  color:#0f172a;
  background:#dfeeff!important;
  border-color:#9fc5f8!important;
}
.crm-chat-line.cliente .crm-chat-bubble p{
  color:#0f172a!important;
}
.crm-chat-line.cliente .crm-chat-bubble time{
  color:#64748b!important;
}

/* =========================================================
   CRM V7.6 - CONVERSAS NO MESMO LADO
   Mantem cliente, atendente e assistente visiveis a esquerda.
   A identificacao continua por nome e cor do balao.
   ========================================================= */
.crm-chat-thread > .crm-chat-line,
.crm-chat-thread > .crm-chat-line.cliente,
.crm-chat-thread > .crm-chat-line.humano,
.crm-chat-thread > .crm-chat-line.bot {
  justify-content: flex-start !important;
}
.crm-chat-line.cliente .crm-chat-bubble,
.crm-chat-line.humano .crm-chat-bubble,
.crm-chat-line.bot .crm-chat-bubble {
  border-radius: 14px 14px 14px 4px !important;
  max-width: min(82%, 620px);
}
.crm-chat-line.cliente .crm-chat-bubble {
  background: #e8f2ff !important;
  border-color: #9fc5f8 !important;
}
.crm-chat-line.humano .crm-chat-bubble {
  background: #ffffff !important;
  border-color: #bfe4d8 !important;
}
.crm-chat-line.bot .crm-chat-bubble {
  background: #f8fbff !important;
  border-color: #d8e5f2 !important;
}
.crm-chat-line.cliente .crm-chat-bubble > span,
.crm-chat-line.humano .crm-chat-bubble > span,
.crm-chat-line.bot .crm-chat-bubble > span {
  text-align: left !important;
}
@media (max-width: 780px) {
  .crm-chat-line.cliente .crm-chat-bubble,
  .crm-chat-line.humano .crm-chat-bubble,
  .crm-chat-line.bot .crm-chat-bubble {
    max-width: 92%;
  }
}

/* =========================================================
   CENTRAL MULTICANAL - WHATSAPP, E-MAIL E TELEGRAM
   ========================================================= */
.campaign-section{margin-top:24px}.campaign-head{display:flex;justify-content:space-between;gap:24px;align-items:center;padding:22px 24px;margin-bottom:16px;border:1px solid #dce8ed;border-radius:18px;background:linear-gradient(135deg,#f7fbfc,#eef8f7)}.campaign-head>div:first-child span{font-size:.72rem;font-weight:800;letter-spacing:.14em;color:#0f766e}.campaign-head h2{margin:4px 0 6px}.campaign-head p{margin:0;color:#61717d}.campaign-kpis{display:grid;grid-template-columns:auto auto;gap:2px 10px;min-width:180px}.campaign-kpis b{font-size:1.25rem;text-align:right;color:#0f766e}.campaign-kpis small{align-self:center}.campaign-grid{align-items:start}.campaign-channels{border:1px solid #d6e2e8;border-radius:12px;padding:12px 14px;display:flex;gap:18px;flex-wrap:wrap}.campaign-channels legend{padding:0 6px;font-weight:700}.campaign-channels label{display:flex;align-items:center;gap:7px;margin:0}.campaign-channels input{width:auto}.campaign-select-list{border:1px solid #e0e8ed;border-radius:12px;padding:14px;background:#fafcfd}.campaign-checks{max-height:210px;overflow:auto;margin-top:10px;display:grid;gap:7px;padding-right:6px}.campaign-checks label{display:flex;align-items:flex-start;gap:8px;padding:8px 10px;border-radius:9px;background:#fff;border:1px solid #edf1f3;font-size:.9rem}.campaign-checks input{width:auto;margin-top:2px}.campaign-list{display:grid;gap:12px;max-height:730px;overflow:auto;padding-right:5px}.campaign-item{padding:15px;border:1px solid #dce6eb;border-radius:14px;background:#fff;display:grid;gap:9px}.campaign-item>div:first-child{display:flex;flex-direction:column;gap:3px}.campaign-item>div:first-child span{font-size:.78rem;color:#697986}.campaign-progress{height:7px;background:#edf2f5;border-radius:999px;overflow:hidden}.campaign-progress span{display:block;height:100%;background:#0f766e;border-radius:999px}.telegram-link-card{margin-top:16px;padding:15px;border:1px solid #cfe0f5;border-radius:14px;background:#f4f9ff;display:grid;gap:9px}.telegram-link-card p{margin:0;color:#5d6c7a}.telegram-btn{background:#229ed9!important;border-color:#229ed9!important;color:#fff!important}.metric.info{border-color:#c9e5f4;background:#f4fbff}.btn.danger{background:#fff1f2!important;color:#b42318!important;border-color:#fecaca!important}
@media(max-width:900px){.campaign-head{align-items:flex-start;flex-direction:column}.campaign-kpis{grid-template-columns:auto auto;min-width:0}.campaign-grid{grid-template-columns:1fr!important}}
@media(max-width:640px){.campaign-head{padding:18px}.campaign-channels{flex-direction:column;gap:9px}.campaign-item .actions{flex-direction:column;align-items:stretch}.campaign-item .actions form,.campaign-item .actions button{width:100%}}

/* =========================================================
   CRM - SCROLL INDIVIDUAL POR SECAO
   Evita que uma area grande esconda as outras partes da tela.
   Cada bloco controla sua propria rolagem vertical e horizontal.
   ========================================================= */
.crm-desk{
  overflow:visible;
}
.crm-service-workspace{
  max-width:100%;
  overflow:hidden!important;
}
.crm-conversation-sidebar,
.crm-chat-panel,
.crm-customer-context,
.crm-management-grid>.panel,
.crm-client-base,
.crm-history-panel{
  max-width:100%;
  min-width:0;
  overflow:auto!important;
  scrollbar-gutter:stable;
}
.crm-conversation-list,
.crm-chat-thread,
.crm-attendance-history,
.crm-task-list.modern,
.crm-client-base .table-wrap,
.crm-history-panel .crm-timeline{
  overflow:auto!important;
  -webkit-overflow-scrolling:touch;
}
.crm-conversation-list{
  max-height:100%;
}
.crm-customer-context{
  max-height:100%;
}
.crm-management-grid>.panel{
  max-height:420px;
}
.crm-client-base{
  max-height:560px;
}
.crm-history-panel{
  max-height:440px;
}
.crm-client-base .table-wrap{
  max-height:470px;
}
.crm-task-list.modern{
  max-height:330px;
  padding-right:3px;
}
.crm-stage-cards.modern{
  min-width:620px;
}
.crm-client-table{
  min-width:860px;
}
.crm-timeline.modern{
  min-width:640px;
  padding-right:3px;
}

@media(max-width:1320px) and (min-width:781px){
  .crm-service-workspace{
    overflow:hidden!important;
  }
  .crm-customer-context{
    max-height:430px;
    overflow:auto!important;
  }
}

@media(max-width:780px){
  .crm-service-workspace{
    overflow:visible!important;
  }
  .crm-conversation-sidebar,
  .crm-chat-panel,
  .crm-customer-context,
  .crm-management-grid>.panel,
  .crm-client-base,
  .crm-history-panel{
    max-height:none;
    overflow:auto!important;
  }
  .crm-conversation-sidebar{
    max-height:430px;
  }
  .crm-chat-panel{
    max-height:calc(100dvh - 96px);
  }
  .crm-customer-context{
    max-height:560px;
  }
  .crm-management-grid>.panel,
  .crm-client-base,
  .crm-history-panel{
    max-height:520px;
  }
  .crm-stage-cards.modern,
  .crm-timeline.modern{
    min-width:520px;
  }
}

/* =========================================================
   CRM - AJUSTE DE VISIBILIDADE EM TELAS MENORES
   A area util desconta o menu lateral, entao o CRM precisa
   quebrar de tres para duas colunas antes do restante do app.
   ========================================================= */
@media(max-width:1320px) and (min-width:781px){
  .crm-service-workspace{
    grid-template-columns:300px minmax(0,1fr)!important;
    overflow:visible;
  }
  .crm-service-workspace>.panel{
    min-width:0;
  }
  .crm-customer-context{
    grid-column:1/-1;
    border-left:0!important;
    border-top:1px solid #e2e8f0;
    display:grid;
    grid-template-columns:260px repeat(2,minmax(0,1fr));
    align-items:start;
    max-height:none;
    overflow:visible;
  }
  .crm-context-profile{
    grid-row:span 2;
  }
  .crm-contact-actions{
    grid-column:1;
  }
}

@media(max-width:780px){
  .crm-desk,
  .crm-service-workspace,
  .crm-service-workspace>.panel,
  .crm-chat-panel,
  .crm-customer-context{
    overflow:visible!important;
  }
  .crm-conversation-sidebar{
    overflow:hidden!important;
  }
  .crm-conversation-list,
  .crm-chat-thread,
  .crm-attendance-history{
    overflow:auto!important;
  }
  .crm-chat-panel{
    height:auto!important;
    min-height:0!important;
  }
  .crm-active-conversation{
    min-height:0!important;
  }
}

.crm-schedule-details{
  border:1px solid #bfd7ff;
  background:#f5f9ff;
}
.crm-schedule-details summary{
  color:#1d4ed8;
}
.crm-schedule-details .crm-stacked-form{
  padding:0 12px 12px;
}
.crm-schedule-details .crm-stacked-form textarea{
  min-height:54px;
}

.crm-note-card{
  margin:14px;
  padding:14px;
  border:1px solid #cfe0f5;
  border-radius:14px;
  background:#f7fbff;
  box-shadow:0 6px 16px rgba(37,99,235,.06);
}
.crm-note-card header{
  margin-bottom:12px;
}
.crm-note-card h4{
  margin:0;
  color:#0f172a;
  font-size:13px;
  letter-spacing:0;
  text-transform:none;
}
.crm-note-card p{
  margin:4px 0 0;
  color:#64748b;
  font-size:11px;
  line-height:1.4;
}
.crm-note-form{
  display:grid;
  gap:10px;
}
.crm-note-form label{
  display:grid;
  gap:6px;
  color:#334155;
  font-size:11px;
  font-weight:800;
}
.crm-note-form select,
.crm-note-form textarea{
  width:100%;
  border:1px solid #bfd2e8;
  border-radius:10px;
  background:#fff;
  color:#0f172a;
  font-size:12px;
  line-height:1.45;
  padding:10px 11px;
}
.crm-note-form textarea{
  min-height:118px;
  resize:vertical;
}
.crm-note-form button{
  justify-content:center;
  width:100%;
  min-height:38px;
  border-radius:10px;
  background:#1d4ed8;
  font-size:11px;
}
@media(max-width:1320px) and (min-width:781px){
  .crm-note-card{
    margin:0;
    align-self:stretch;
    border-radius:0;
    border-top:0;
    border-bottom:0;
  }
  .crm-note-form textarea{
    min-height:132px;
  }
}
@media(max-width:780px){
  .crm-note-card{
    margin:14px;
  }
  .crm-note-form textarea{
    min-height:128px;
  }
}

/* =========================================================
   LOCX V8 - LAYOUT OPERACIONAL MAIS LIMPO
   Padroniza topbar, formularios, tabelas e cards sem alterar fluxos.
   ========================================================= */
:root{
  --shadow:0 10px 28px rgba(15,23,42,.055);
  --shadow-sm:0 4px 16px rgba(15,23,42,.05);
}
body{
  background:#f6f8fb;
}
.main{
  padding:24px 28px;
}
.topbar{
  position:sticky;
  top:0;
  z-index:12;
  align-items:flex-start;
  border-radius:14px;
  padding:18px 20px;
  box-shadow:0 8px 24px rgba(15,23,42,.055);
}
.topbar-title{
  min-width:0;
}
.topbar-title>span{
  display:block;
  margin-bottom:5px;
  color:#2563eb;
  font-size:11px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.topbar h1{
  font-size:25px;
  letter-spacing:0;
}
.topbar p{
  max-width:720px;
  line-height:1.45;
}
.toolbar{
  justify-content:flex-end;
  flex-wrap:wrap;
  min-width:220px;
}
.btn,button{
  min-height:38px;
  border-radius:8px;
  padding:9px 13px;
  font-weight:600;
  box-shadow:none;
}
.btn:hover,button:hover{
  transform:none;
  filter:brightness(.98);
}
.panel,.metric,.module-card,.topbar{
  border-color:#dbe3ee;
}
.panel{
  border-radius:14px;
  padding:18px;
  box-shadow:0 6px 20px rgba(15,23,42,.045);
}
.panel h2{
  font-size:18px;
  letter-spacing:0;
}
.grid.side{
  gap:16px!important;
}
.grid.side>.panel:first-child:not(.crm-conversation-sidebar):not(.crm-chat-panel):not(.crm-customer-context){
  border-top:3px solid #2563eb;
}
.grid.side>.panel:has(.table-wrap){
  padding-bottom:0;
  overflow:hidden;
}
.grid.side>.panel:has(.table-wrap)>h2,
.panel:has(.table-wrap)>h2{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:-2px 0 14px;
}
.form-grid{
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:14px;
}
.form-grid .span-2{
  grid-column:span 2;
}
.form-grid .span-3{
  grid-column:1/-1;
}
label{
  color:#334155;
  font-size:12px;
  font-weight:700;
}
input,select,textarea{
  min-height:40px;
  border-radius:8px;
  padding:9px 11px;
  border-color:#ccd6e3;
  background:#fbfdff;
}
textarea{
  line-height:1.45;
}
label:has(input[type="checkbox"]){
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:9px;
  padding:10px 12px;
  border:1px solid #dbe3ee;
  border-radius:10px;
  background:#f8fafc;
}
label:has(input[type="checkbox"]) input{
  width:auto!important;
  min-height:0;
}
input[type="file"]{
  padding:7px 9px;
  background:#fff;
}
.table-wrap{
  border-radius:10px;
  border-color:#dbe3ee;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
}
table{
  min-width:820px;
}
th{
  position:sticky;
  top:0;
  z-index:1;
  background:#f1f5f9;
  color:#475569;
  font-size:11px;
  font-weight:700;
  letter-spacing:.04em;
}
th,td{
  padding:10px 12px;
  vertical-align:top;
}
td{
  color:#1e293b;
}
td small{
  color:#64748b;
  line-height:1.4;
}
td .btn,
td button.btn,
td form button{
  min-height:32px;
  padding:7px 10px;
  font-size:12px;
}
tr:hover td{
  background:#f8fbff;
}
.tag{
  border-radius:999px;
  padding:5px 9px;
  font-weight:700;
}
.metric{
  border-radius:12px;
  padding:16px;
  box-shadow:0 6px 18px rgba(15,23,42,.045);
}
.metric:after{
  opacity:.7;
  width:40px;
  height:40px;
  border-radius:10px;
}
.metric strong{
  font-size:24px;
  letter-spacing:0;
}
.module-grid{
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
}
.module-card{
  border-radius:12px;
  box-shadow:none;
  transition:border-color .16s ease, background .16s ease;
}
.module-card:hover{
  border-color:#b9c8dc;
  background:#f8fbff;
}
.module-card-info{
  position:relative;
}
.module-card-info:after{
  content:attr(data-module-info);
  position:absolute;
  left:14px;
  right:14px;
  bottom:calc(100% + 10px);
  z-index:30;
  display:block;
  padding:11px 12px;
  border:1px solid #bfcee2;
  border-radius:10px;
  background:#0f172a;
  color:#fff;
  font-size:12px;
  line-height:1.4;
  font-weight:500;
  white-space:normal;
  box-shadow:0 14px 30px rgba(15,23,42,.22);
  opacity:0;
  transform:translateY(4px);
  pointer-events:none;
  transition:opacity .14s ease, transform .14s ease;
}
.module-card-info:before{
  content:"";
  position:absolute;
  left:34px;
  bottom:calc(100% + 4px);
  z-index:31;
  width:12px;
  height:12px;
  background:#0f172a;
  transform:rotate(45deg);
  opacity:0;
  pointer-events:none;
  transition:opacity .14s ease;
}
.module-card-info:hover:after,
.module-card-info:focus-visible:after{
  opacity:1;
  transform:translateY(0);
}
.module-card-info:hover:before,
.module-card-info:focus-visible:before{
  opacity:1;
}
.panel:has(.module-card-info){
  overflow:visible;
}
.section-head{
  padding-bottom:10px;
  border-bottom:1px solid #e5ebf3;
}
.user-role-panel .section-head{
  margin-bottom:14px;
}
.role-preset-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
  gap:8px;
  margin:4px 0 12px;
}
.role-preset-grid article{
  border:1px solid #dbe3ee;
  border-radius:10px;
  padding:10px;
  background:#fbfdff;
}
.role-preset-grid article.is-active{
  border-color:#2563eb;
  background:#eff6ff;
  box-shadow:inset 3px 0 #2563eb;
}
.role-preset-grid strong,
.role-preset-grid span{
  display:block;
}
.role-preset-grid strong{
  color:#0f172a;
  font-size:12px;
}
.role-preset-grid span{
  margin-top:5px;
  color:#64748b;
  font-size:10px;
  line-height:1.35;
}
.permission-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin:14px 0 10px;
}
.permission-head h3{
  margin:0;
}
.permission-head small{
  display:block;
  margin-top:4px;
  color:#64748b;
  line-height:1.35;
}
.actions{
  flex-wrap:wrap;
  align-items:center;
}
code{
  display:inline-block;
  max-width:100%;
  white-space:normal;
  overflow-wrap:anywhere;
  border:1px solid #e2e8f0;
  border-radius:8px;
  padding:3px 6px;
  background:#f8fafc;
  color:#334155;
}
.notice,.alert{
  border-radius:10px;
  box-shadow:none;
}
.chart-card,.chart-wide-panel{
  border-radius:14px;
}
.dashboard-tables{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
.billing-tools{
  display:grid;
  gap:12px;
  margin:0 0 14px;
  padding:14px;
  border:1px solid #dbe3ee;
  border-radius:12px;
  background:#f8fbff;
}
.billing-tools small{
  color:#64748b;
}
.billing-tools small strong{
  color:#0f172a;
}
.billing-search{
  display:grid;
  grid-template-columns:80px minmax(0,1fr);
  align-items:center;
  gap:10px;
  margin:0!important;
}
.billing-search span{
  color:#475569;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.billing-filter-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.billing-filter-row button{
  min-height:32px;
  padding:7px 10px;
  border:1px solid #d5dfeb;
  background:#fff;
  color:#334155;
  border-radius:999px;
  font-size:12px;
}
.billing-filter-row button.is-active{
  border-color:#2563eb;
  background:#eff6ff;
  color:#1d4ed8;
}
.billing-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  min-width:230px;
}
.billing-actions form{
  display:inline-flex;
}
.gateway-cell{
  min-width:96px;
}
.pix-cell{
  min-width:220px;
}
.pix-cell>div:first-child{
  margin-bottom:3px;
}
.pix-tools{
  display:flex;
  align-items:center;
  gap:8px;
  margin:8px 0;
}
.pix-qr{
  width:52px;
  height:52px;
  border:1px solid #dbe3ee;
  border-radius:8px;
  background:#fff;
}
.pix-help{
  display:block;
  max-width:240px;
  white-space:normal;
}
.pix-code{
  max-width:260px;
  font-size:11px;
}
tr[hidden]{
  display:none!important;
}

@media(max-width:1100px){
  .topbar{
    position:relative;
  }
  .dashboard-tables{
    grid-template-columns:minmax(0,1fr)!important;
  }
}
@media(max-width:768px){
  .main{
    padding:14px!important;
  }
  .topbar{
    position:relative;
    padding:15px!important;
  }
  .topbar h1{
    font-size:22px;
  }
  .toolbar{
    justify-content:stretch;
    min-width:0;
  }
  .toolbar .btn,
  .toolbar button{
    flex:1 1 150px;
    width:auto!important;
  }
  .form-grid .span-2,
  .form-grid .span-3{
    grid-column:1/-1;
  }
  .grid.side>.panel:has(.table-wrap),
  .panel:has(.table-wrap){
    padding:14px!important;
  }
  table{
    min-width:760px;
  }
  .billing-search{
    grid-template-columns:1fr;
    gap:6px;
  }
  .billing-filter-row{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .billing-filter-row button{
    justify-content:center;
    border-radius:8px;
    white-space:normal;
  }
  .module-card-info:after{
    left:10px;
    right:10px;
    bottom:auto;
    top:calc(100% + 10px);
  }
  .module-card-info:before{
    left:30px;
    bottom:auto;
    top:calc(100% + 4px);
  }
  .sidebar-menu-info:after{
    left:0;
    right:0;
    top:calc(100% + 6px);
    width:auto;
    max-width:none;
    transform:translateY(4px);
  }
  .sidebar-menu-info:before{
    left:24px;
    top:calc(100% + 1px);
    transform:rotate(45deg);
  }
  .sidebar-menu-info:hover:after,
  .sidebar-menu-info:focus-visible:after{
    transform:translateY(0);
  }
}

/* CRM - garantia final dos scrolls individuais apos os overrides gerais. */
.crm-chat-panel{
  min-height:620px!important;
}
.crm-active-conversation{
  display:grid!important;
  grid-template-rows:auto auto minmax(260px,1fr) auto!important;
  min-height:620px!important;
}
.crm-chat-thread{
  display:flex!important;
  flex-direction:column!important;
  gap:8px!important;
  min-height:260px!important;
  background-color:#f0f4f8!important;
}
.crm-chat-thread>.crm-chat-line{
  display:flex!important;
  width:100%!important;
  flex:0 0 auto!important;
  visibility:visible!important;
  opacity:1!important;
}
.crm-chat-bubble{
  display:block!important;
  min-width:120px;
  max-width:min(82%,620px)!important;
  color:#0f172a!important;
}
.crm-chat-bubble p{
  display:block!important;
  color:#172033!important;
}
.crm-conversation-sidebar,
.crm-chat-panel,
.crm-customer-context,
.crm-management-grid>.panel,
.crm-client-base,
.crm-history-panel{
  overflow:auto!important;
}
.crm-service-workspace{
  overflow:hidden!important;
}
.crm-conversation-list,
.crm-chat-thread,
.crm-attendance-history,
.crm-task-list.modern,
.crm-client-base .table-wrap,
.crm-history-panel .crm-timeline{
  overflow:auto!important;
}
@media(max-width:1320px) and (min-width:781px){
  .crm-service-workspace{
    height:auto!important;
    min-height:0!important;
    align-items:start!important;
    grid-auto-rows:auto!important;
    overflow:visible!important;
    margin-bottom:18px!important;
  }
  .crm-service-workspace>.panel{
    height:auto!important;
  }
  .crm-conversation-sidebar,
  .crm-chat-panel{
    height:clamp(600px,calc(100dvh - 40px),760px)!important;
  }
  .crm-customer-context{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    position:relative!important;
    z-index:1;
    overflow:visible!important;
  }
  .crm-management-grid{
    position:relative!important;
    z-index:0;
    margin-top:18px!important;
  }
}
@media(max-width:780px){
  .crm-service-workspace{
    overflow:visible!important;
  }
  .crm-conversation-sidebar{
    max-height:430px!important;
  }
  .crm-chat-panel{
    max-height:calc(100dvh - 96px)!important;
    min-height:560px!important;
  }
  .crm-active-conversation{
    min-height:560px!important;
  }
  .crm-chat-thread{
    min-height:240px!important;
  }
  .crm-customer-context{
    max-height:560px!important;
  }
  .crm-management-grid>.panel,
  .crm-client-base,
  .crm-history-panel{
    max-height:520px!important;
  }
}
