/* polish.css - refinamento visual PainelAlfa
   Camada final: corrige ordem de carregamento, padroniza tons neutros,
   restaura botoes coloridos e detalha sidebar + componentes. */

/* ---------- Base ---------- */
html{scrollbar-width:thin;scrollbar-color:#3a3a42 #0a0a0b}
html::-webkit-scrollbar{width:11px}
html::-webkit-scrollbar-track{background:#0a0a0b}
html::-webkit-scrollbar-thumb{background:#2b2b31;border-radius:8px;border:3px solid #0a0a0b}
html::-webkit-scrollbar-thumb:hover{background:#3f3f46}

.main{scrollbar-width:thin;scrollbar-color:#2b2b31 transparent}
.main::-webkit-scrollbar{width:9px}

:is(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid #818cf8;outline-offset:2px}
::selection{background:#8b5cf644;color:#fff}

body:has(#theme-toggle:not(:checked)){background:#0a0a0b!important}

/* ---------- Botoes: restaura o painel colorido ---------- */
:is(button,.btn){
  border-radius:12px;
  letter-spacing:-.01em;
  background:linear-gradient(110deg,#4f46e5,#7c3aed 55%,#a21caf)!important;
  border:1px solid #a78bfa3d!important;
  box-shadow:inset 0 1px 0 #ffffff2b,0 10px 24px #0000003d!important;
}
:is(button,.btn):hover{filter:brightness(1.08)!important;transform:translateY(-2px)!important;box-shadow:inset 0 1px 0 #ffffff2b,0 14px 30px #0000004d!important}
:is(button,.btn):active{transform:translateY(0)!important;box-shadow:inset 0 2px 6px #00000055!important}

button.danger{background:linear-gradient(110deg,#f43f5e,#be123c)!important;border-color:#f43f5e55!important}
.teal-button{background:linear-gradient(110deg,#0d9488,#059669)!important;border-color:#2dd4bf4d!important;box-shadow:inset 0 1px 0 #ffffff2b,0 8px 22px #10b98140!important}
.tube-button{background:linear-gradient(110deg,#db2777,#ef4444)!important;border-color:#ec489955!important}
.gift-button{background:linear-gradient(110deg,#db2777,#f59e0b)!important;border-color:#f59e0b55!important}
.coin-button{background:linear-gradient(110deg,#f59e0b,#f97316)!important;border-color:#fbbf2455!important}
.alert-button{background:linear-gradient(110deg,#f59e0b,#f97316)!important;border-color:#fbbf2455!important}
.wallet-primary{background:linear-gradient(110deg,#10b981,#059669)!important;border-color:#34d3994d!important}
.customers-button--primary{background:linear-gradient(110deg,#2563eb,#06b6d4)!important;border-color:#38bdf866!important}
.paid-app-actions .teal-button{background:var(--app-color,#8b5cf6)!important;border-color:#ffffff30!important}
.cancel-button{background:#2a2a30!important;border-color:#3a3a42!important;box-shadow:none!important}
.outline-button{background:transparent!important;color:#60a5fa!important;border:1px solid #60a5fa55!important}
.danger-button{background:#ef44441a!important;color:#fca5a5!important;border-color:#ef444455!important;box-shadow:none!important}
.success-button{background:#10b98126!important;color:#86efac!important;border-color:#10b98166!important;box-shadow:none!important}
.reset-button,.shortcut-off{background:#f59e0b1f!important;color:#fcd34d!important;border-color:#f59e0b55!important;box-shadow:none!important}
.shortcut-free{background:#10b98126!important;color:#86efac!important;border-color:#10b98166!important}
.edit-button{background:#164e6355!important;color:#a5f3fc!important;border-color:#06b6d466!important}
.hide-action{background:#e11d48!important;border-color:#e11d4855!important}
.show-action{background:#059669!important;border-color:#05966955!important}
.icon-delete{background:#7f1d1d!important;border-color:#b91c1c44!important}
.visibility-button{min-width:87px}
.gift-switch{background:#3f3f46!important;border:0!important;box-shadow:none!important;padding:0!important}
.gift-switch.switch-on{background:#10b981!important}
.integration-test{background:transparent!important;color:#7dd3fc!important;border-color:#38bdf877!important;box-shadow:none!important}
.modal-close{background:transparent!important;border:0!important;box-shadow:none!important;min-height:0!important;margin:0!important}

/* ---------- Sidebar ---------- */
.sidebar{
  background:linear-gradient(180deg,#16161a 0%,#0f0f12 55%,#0a0a0c 100%)!important;
  border-right-color:#ffffff14!important;
  scrollbar-width:thin;scrollbar-color:#2b2b31 transparent;
}
.sidebar::-webkit-scrollbar{width:8px}
.sidebar::-webkit-scrollbar-thumb{background:#2b2b31;border-radius:8px;border:2px solid transparent;background-clip:content-box}
.sidebar::-webkit-scrollbar-thumb:hover{background:#3f3f46}
.sidebar::before{content:"";position:absolute;top:-90px;right:-80px;width:260px;height:260px;border-radius:50%;background:radial-gradient(closest-side,#8b5cf60f,transparent);pointer-events:none}

.brand-grid{background:#0a0a0c!important;box-shadow:0 0 22px #6366f140,0 8px 20px #0008!important}
.brand-name{font-size:21px}
.brand-subtitle{letter-spacing:.2em;color:#71717a}

.profile{position:relative;margin:0 5px 22px;padding:14px 13px;background:linear-gradient(135deg,#1b2236f0,#141828ea 62%,#181234ee);border:1px solid #6366f140!important;border-radius:18px;box-shadow:inset 0 1px 0 #ffffff14,0 12px 30px #0006,0 0 22px #6366f11f;overflow:hidden}
.profile:before{content:"";position:absolute;inset:0 0 auto;height:1px;background:linear-gradient(90deg,transparent,#818cf8,#d946ef,transparent);opacity:.9}
.profile .avatar{position:relative;width:44px;height:44px;border-radius:14px;color:#fff;font-size:18px;font-weight:800;background:linear-gradient(135deg,#60a5fa,#818cf8 45%,#c026d3)!important;box-shadow:0 6px 16px #6366f180,inset 0 1px 0 #ffffff66}
.profile .avatar:after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:inset 0 0 0 1px #ffffff40}
.profile strong{font-size:14px!important;font-weight:800!important;letter-spacing:-.01em;color:#f4f4f5!important}
.profile small{color:#c7d2fe!important;background:linear-gradient(135deg,#6366f126,#8b5cf632)!important;border:1px solid #818cf848!important;display:inline-flex!important;align-items:center;gap:5px;padding:2.5px 9px!important;border-radius:999px!important;font-weight:800!important;letter-spacing:.09em!important;width:fit-content!important;text-transform:capitalize;box-shadow:0 0 0 2px #6366f113;margin-top:4px}
.profile:after{border-color:#0e0e10!important;background:#34d399!important;box-shadow:0 0 0 3px #34d39922,0 0 12px #34d39988!important}

body:has(#theme-toggle:checked) .profile{background:linear-gradient(135deg,#ffffff,#f8fafc);border-color:#e2e8f0!important;box-shadow:0 12px 28px #94a3b82e,inset 0 1px 0 #ffffff}
body:has(#theme-toggle:checked) .profile:before{background:linear-gradient(90deg,transparent,#818cf8,#d946ef,transparent)}
body:has(#theme-toggle:checked) .profile .avatar{background:linear-gradient(135deg,#3b82f6,#6366f1 45%,#a21caf)!important}
body:has(#theme-toggle:checked) .profile strong{color:#0f172a!important}
body:has(#theme-toggle:checked) .profile small{color:#4338ca!important;background:#eef2ff!important;border-color:#c7d2fe!important;box-shadow:0 0 0 2px #eef2ff!important}
body:has(#theme-toggle:checked) .profile:after{border-color:#ffffff!important;background:#22c55e!important;box-shadow:0 0 0 3px #dcfce744,0 0 12px #22c55e66!important}

.profile-head{display:flex;align-items:center;gap:6px;min-width:0}
.profile .profile-head strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.profile-gear{display:flex;flex:none;align-items:center;justify-content:center;width:26px;height:26px;margin:0 0 0 auto;padding:0;border:1px solid #2e2e34;border-radius:99px;background:linear-gradient(135deg,#ffffff0d,#ffffff04);color:#9ca3af;cursor:pointer;text-decoration:none;box-shadow:inset 0 1px 0 #ffffff12;transition:color .2s ease,border-color .2s ease,background .2s ease,box-shadow .2s ease}
.profile-gear:hover{color:#c7d2fe;border-color:#818cf866;background:#6366f11a;box-shadow:inset 0 1px 0 #ffffff1f,0 0 12px #6366f133}
.profile-gear[aria-expanded="true"]{color:#a78bfa;border-color:#a78bfa88;background:#8b5cf61f;box-shadow:0 0 14px #8b5cf640}
.profile-gear svg{width:13px;height:13px;transition:transform .3s var(--ease)}
.profile-gear:hover svg{transform:rotate(45deg)}
.profile-gear[aria-expanded="true"] svg{transform:rotate(45deg)}
body:has(#theme-toggle:checked) .profile-gear{border-color:#e2e8f0;background:linear-gradient(135deg,#ffffff,#f1f5f9);color:#64748b;box-shadow:inset 0 1px 0 #ffffff}
body:has(#theme-toggle:checked) .profile-gear:hover{color:#4f46e5;border-color:#a5b4fc;background:#eef2ff}
body:has(#theme-toggle:checked) .profile-gear[aria-expanded="true"]{color:#4f46e5;border-color:#a5b4fc;background:#e0e7ff}

.profile-edit{margin:-6px 4px 14px}
.profile-edit-card{position:relative}
.profile-edit-card>summary{list-style:none;position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.profile-edit-card[open]{display:block}
.profile-edit-card .alert+form{margin-top:10px}
.profile-edit-card form{display:grid;gap:0;padding:12px;background:#151518ee;border:1px solid #2e2e34;border-radius:12px;box-shadow:0 18px 40px #0008,inset 0 1px 0 #ffffff0d;backdrop-filter:blur(10px)}
.profile-edit-card form label{display:block;color:#9ca1b0;font-size:10px;letter-spacing:.08em;text-transform:uppercase;margin-bottom:3px}
.profile-edit-card form label small{color:#71717a;text-transform:none;letter-spacing:0}
.profile-edit-card input{background:#0e0e12;border-color:#2e2e34;border-radius:9px;padding:8px 10px;font-size:13px}
.profile-edit-card .btn{margin-top:12px;min-height:36px;border:0;border-radius:10px;background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;font-weight:700;font-size:13px;box-shadow:none}
.profile-edit-card .btn:hover{filter:brightness(1.08);transform:none}

.menu-group{margin-top:20px;padding-top:13px}
.menu-group:before{left:14px;right:14px;background:linear-gradient(90deg,#ffffff14,transparent)}
.menu-label{color:#71717a!important;font-size:9px;padding:0 14px 9px}
.menu-label:before{width:6px;height:6px;background:#71717a;border-radius:50%;box-shadow:none}

.sidebar a{min-height:43px;padding:9px 12px!important;border-radius:12px!important;color:#a3a7b4!important}
.sidebar a svg{width:19px;height:19px;padding:4px;border-radius:9px;background:#ffffff08;border:1px solid #ffffff0a;transition:transform .2s ease,background .2s ease,border-color .2s ease,color .2s ease}
.sidebar a:hover{color:#fff!important;background:#ffffff0c!important;border-color:#ffffff14!important;transform:translateX(3px)}
.sidebar a:hover svg{background:#ffffff14;border-color:#ffffff18;transform:scale(1.06)}
.sidebar a.active{color:#fff!important;background:linear-gradient(100deg,#6366f13d,#8b5cf630 55%,#ec48991f)!important;border-color:#a78bfa4d!important;box-shadow:0 8px 24px #00000066,inset 0 1px 0 #ffffff26!important}
.sidebar a.active:before{left:-2px!important;top:11px;bottom:11px;width:3px!important;border-radius:0 6px 6px 0!important;background:linear-gradient(#818cf8,#d946ef)!important;box-shadow:0 0 10px #8b5cf666}
.sidebar a.active svg{color:#fff;background:#ffffff14;border-color:#ffffff26}
.sidebar a.active:after{width:6px;height:6px;background:#34d399!important;box-shadow:0 0 8px #34d399!important}
.sidebar .menu-group:nth-of-type(2) a svg{color:#60a5fa}
.sidebar .menu-group:nth-of-type(3) a svg{color:#f472b6}
.sidebar .menu-group:nth-of-type(4) a svg{color:#34d399}
.sidebar .menu-group:nth-of-type(5) a svg{color:#fbbf24}
.sidebar .menu-group:nth-of-type(6) a svg{color:#a78bfa}
.sidebar a.active svg{color:#fff!important}

.sidebar .menu-count{border-radius:999px!important;font-size:9px!important;padding:2px 7px!important;min-width:20px;height:auto}
.sidebar a.active .menu-count{color:#fde68a}

.sidebar .theme-switch{margin:22px 4px 0!important;padding:9px 12px!important;border-radius:11px!important;background:#ffffff06!important;border:1px solid #2e2e34!important;color:#b8bcc6!important;justify-content:center;letter-spacing:.02em}
.sidebar .theme-switch:hover{background:#ffffff0c!important;border-color:#3a3a42!important}
.sidebar .theme-switch input{accent-color:#818cf8;width:16px!important;height:16px;min-height:16px;margin:0;padding:0;flex:none}

.sidebar .logout{margin:14px 4px 0!important;border-color:#2e2e34!important;border-radius:12px!important;background:#ffffff04}
.sidebar .logout:hover{background:#ef444412!important;border-color:#ef444444}
.panel-logout button{min-height:40px;border:1px solid #2e2e34!important;border-radius:12px!important;background:#ffffff06!important;color:#fda4af!important;font-weight:700;box-shadow:none!important}
.panel-logout button:hover{background:#ef444418!important;border-color:#ef444455!important;transform:none!important}
.panel-logout button svg{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

.sidebar-details>a{margin-left:18px!important}
.sidebar-details>a.active{color:#fff!important;background:linear-gradient(100deg,#6366f13d,#8b5cf630)!important;border-color:#a78bfa4d!important}

/* ---------- Topbar & cabecalhos ---------- */
body:has(#theme-toggle:not(:checked)) .topbar{
  height:auto;
  min-height:46px;
  padding:8px 15px;
  background:#ffffff05;
  border:1px solid #ffffff0d;
  border-radius:13px;
  margin-bottom:26px!important;
  color:#9aa1b0!important;
}
body:has(#theme-toggle:not(:checked)) .topbar span{color:#9aa1b0}
body:has(#theme-toggle:not(:checked)) .topbar strong{color:#e6e8ef!important;font-weight:700;letter-spacing:-.01em}
body:has(#theme-toggle:not(:checked)) .topbar span::after{content:" › ";color:#555b69;margin:0 7px;font-weight:700}

body:has(#theme-toggle:not(:checked)) .eyebrow{color:#a78bfa!important}
body:has(#theme-toggle:not(:checked)) h1{letter-spacing:-.05em}

/* ---------- Cards ---------- */
body:has(#theme-toggle:not(:checked)) .card{
  background:linear-gradient(180deg,#1a1a1e,#141417)!important;
  border-color:#27272d!important;
  border-radius:18px;
  box-shadow:inset 0 1px 0 #ffffff08,0 16px 38px #00000030!important;
}
body:has(#theme-toggle:not(:checked)) .card:hover{transform:translateY(-2px)!important;border-color:#40404a!important;box-shadow:inset 0 1px 0 #ffffff0a,0 20px 44px #00000038!important}
body:has(#theme-toggle:not(:checked)) details.card>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:10px;color:#c7d2fe;font-weight:700;letter-spacing:-.01em}
body:has(#theme-toggle:not(:checked)) details.card>summary::-webkit-details-marker{display:none}
body:has(#theme-toggle:not(:checked)) details.card>summary::after{content:"›";margin-left:auto;color:#71717a;transition:transform .2s ease;font-size:20px;line-height:1}
body:has(#theme-toggle:not(:checked)) details.card[open]>summary::after{transform:rotate(90deg)}

body:has(#theme-toggle:not(:checked)) .kpi-card,
body:has(#theme-toggle:not(:checked)) .tube-card{
  background:linear-gradient(180deg,#1a1a1e,#141417)!important;
  border-color:#27272d!important;
  border-radius:16px;
  box-shadow:inset 0 1px 0 #ffffff07,0 14px 32px #0000002e!important;
}
body:has(#theme-toggle:not(:checked)) .stat-value{background:linear-gradient(110deg,#60a5fa,#a78bfa 55%,#f472b6);-webkit-background-clip:text;background-clip:text;color:transparent}

/* ---------- Formularios ---------- */
body:has(#theme-toggle:not(:checked)) :is(input,select,textarea){
  background:#101013!important;
  border-color:#2e2e34!important;
  border-radius:12px;
  box-shadow:inset 0 1px 2px #0004;
}
body:has(#theme-toggle:not(:checked)) :is(input,select,textarea):hover{border-color:#3f3f4a!important}
body:has(#theme-toggle:not(:checked)) :is(input,select,textarea):focus{
  border-color:#818cf8!important;
  background:#141418!important;
  box-shadow:0 0 0 3px #818cf826,0 8px 20px #0002!important;
}
body:has(#theme-toggle:not(:checked)) label{color:#c2c6d0}
body:has(#theme-toggle:not(:checked)) .check-label input{accent-color:#818cf8}
body:has(#theme-toggle:not(:checked)) .form-help{color:#71717a}

/* ---------- Tabelas ---------- */
body:has(#theme-toggle:not(:checked)) table{background:#101013!important;border-color:#27272d!important;border-radius:14px}
body:has(#theme-toggle:not(:checked)) th{background:#18181c!important;color:#9aa0ad!important;font-size:10px;letter-spacing:.11em}
body:has(#theme-toggle:not(:checked)) td{color:#d8dbe3}
body:has(#theme-toggle:not(:checked)) tr:hover td{background:#ffffff09}
body:has(#theme-toggle:not(:checked)) tbody tr:last-child td{border-bottom:0}

/* ---------- Modais / popovers / avisos ---------- */
body:has(#theme-toggle:not(:checked)) .modal-card{background:#151518!important;border-color:#2e2e34!important;box-shadow:0 30px 90px #000,inset 0 1px 0 #ffffff12}
body:has(#theme-toggle:not(:checked)) .alert-popover form{background:#161619!important;border-color:#2e2e34!important;box-shadow:0 18px 44px #000a}
body:has(#theme-toggle:not(:checked)) .client-alert-light:after{background:#16161a!important;border-color:#3a3a42!important;color:#e6e8ee!important;box-shadow:0 10px 28px #0006}
body:has(#theme-toggle:not(:checked)) .client-alert-light>.alert-dot.dot-off{background:#2a3a55!important;border-color:#1a2740!important;color:transparent!important;box-shadow:none!important}
body:has(#theme-toggle:checked) .client-alert-light>.alert-dot.dot-off{background:#d3dbe5!important;border-color:#c3cdda!important;color:transparent!important;box-shadow:none!important}

/* ---------- Dashboard: dias para vencer ---------- */
.dashboard-due{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:500;white-space:nowrap}
.dashboard-due strong{font-size:14px;font-weight:800}
.dashboard-due--danger{color:#fda4af}
.dashboard-due--warn{color:#fcd34d}
.dashboard-due--ok{color:#86efac}
body:has(#theme-toggle:checked) .dashboard-due--danger{color:#be123c}
body:has(#theme-toggle:checked) .dashboard-due--warn{color:#b45309}
body:has(#theme-toggle:checked) .dashboard-due--ok{color:#047857}

/* ---------- Dashboard: faturamento por mês (tabela) ---------- */
.dashboard-revenue h2{display:flex;align-items:center;gap:10px}
.dashboard-revenue h2::before{content:"";width:9px;height:9px;border-radius:99px;background:linear-gradient(135deg,#38bdf8,#fb923c,#4ade80);box-shadow:0 0 12px #60a5fa55;flex:none}
.dashboard-month-table{margin-top:6px}
.dashboard-month-row{display:flex;align-items:center;gap:14px;padding:13px 14px;margin:0 -14px;border-radius:13px;border-top:1px solid #ffffff0c;transition:background .2s ease,box-shadow .2s ease}
.dashboard-month-row:first-child{border-top:0}
.dashboard-month-row:hover{background:#ffffff08;box-shadow:inset 0 0 0 1px #ffffff12}
.dashboard-month-row--forecast{background:linear-gradient(90deg,#7dd3fc12,transparent 72%)}
.dashboard-month-row--current{background:linear-gradient(90deg,#fdba7412,transparent 72%)}
.dashboard-month-row--closed{background:linear-gradient(90deg,#4ade8012,transparent 72%)}
.dashboard-month-info{display:flex;align-items:baseline;gap:9px;min-width:0}
.dashboard-month-name{display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:800;letter-spacing:-.01em}
.dashboard-month-name::before{content:"";width:7px;height:7px;border-radius:99px;background:currentColor;box-shadow:0 0 9px currentColor;flex:none}
.dashboard-month-value{margin-left:auto;font-variant-numeric:tabular-nums;font-size:20px;font-weight:800;letter-spacing:-.02em;white-space:nowrap;background-clip:text;-webkit-background-clip:text;color:transparent}
.dashboard-month-note{color:#8d9ab1;font-size:11px;white-space:nowrap}
.dashboard-month-badge{display:inline-block;padding:3px 9px;border-radius:999px;font-size:9px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;color:#4ade80;background:#4ade8014;border:1px solid #4ade8033;box-shadow:0 0 10px #4ade8022}
.dashboard-month-row--forecast .dashboard-month-name{color:#7dd3fc}
.dashboard-month-row--forecast .dashboard-month-note{color:#7dd3fc99}
.dashboard-month-row--forecast .dashboard-month-value{background-image:linear-gradient(120deg,#38bdf8,#818cf8)}
.dashboard-month-row--current .dashboard-month-name{color:#fdba74}
.dashboard-month-row--current .dashboard-month-note{color:#fdba7499}
.dashboard-month-row--current .dashboard-month-value{background-image:linear-gradient(120deg,#fb923c,#f472b6)}
.dashboard-month-row--closed .dashboard-month-name{color:#4ade80}
.dashboard-month-row--closed .dashboard-month-value{background-image:linear-gradient(120deg,#4ade80,#10b981)}
@media (max-width:700px){.dashboard-month-row{flex-wrap:wrap;gap:6px}.dashboard-month-note{display:none}.dashboard-month-value{font-size:17px}}

/* ---------- Dashboard: topo lado a lado (cadastrados + faturamento + apps) ---------- */
.dashboard-top-grid{display:grid;grid-template-columns:minmax(210px,260px) minmax(0,1fr) minmax(240px,300px);gap:18px;align-items:stretch;margin-bottom:22px}
.dashboard-top-grid>.card{margin-bottom:0}
.dashboard-top-grid .dashboard-kpi{display:flex;flex-direction:row;align-items:stretch;justify-content:center;gap:0;padding:26px 18px}
.dashboard-kpi-cell{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:0;padding:0 8px}
.dashboard-kpi-divider{width:1px;flex:none;align-self:stretch;background:linear-gradient(180deg,transparent,#ffffff1f 22%,#ffffff1f 78%,transparent)}
.dashboard-count--active{background:linear-gradient(110deg,#34d399,#10b981)!important;-webkit-background-clip:text!important;background-clip:text!important;color:transparent!important}
body:has(#theme-toggle:checked) .dashboard-kpi-divider{background:linear-gradient(180deg,transparent,#d4d4d8 22%,#d4d4d8 78%,transparent)!important}
body:has(#theme-toggle:checked) .dashboard-count--active{background:linear-gradient(110deg,#22c55e,#059669)!important;-webkit-background-clip:text!important;background-clip:text!important;color:transparent!important}
@media (max-width:460px){.dashboard-top-grid .dashboard-kpi{flex-direction:column;gap:16px}.dashboard-kpi-divider{width:100%;height:1px;background:linear-gradient(90deg,transparent,#ffffff1f 22%,#ffffff1f 78%,transparent)}}
@media (max-width:1000px){.dashboard-top-grid{grid-template-columns:1fr}.dashboard-top-grid>.card{margin-bottom:22px}}

/* Modo claro: widget fintech (card branco, fundo cinza claro, sombra suave) */
body:has(#theme-toggle:checked) .dashboard-revenue{background:#ffffff!important;border-color:#e5e7eb!important;box-shadow:0 12px 34px #94a3b833!important}
body:has(#theme-toggle:checked) .dashboard-month-row{border-top:1px solid #f0f1f5!important;background:#ffffff!important}
body:has(#theme-toggle:checked) .dashboard-month-row:first-child{border-top:0!important}
body:has(#theme-toggle:checked) .dashboard-month-row:hover{background:#fafbfc!important;box-shadow:inset 0 0 0 1px #eef0f4!important}
body:has(#theme-toggle:checked) .dashboard-month-row--forecast{background:linear-gradient(90deg,#eaf2ff,transparent 76%)!important}
body:has(#theme-toggle:checked) .dashboard-month-row--current{background:linear-gradient(90deg,#fff3e8,transparent 76%)!important}
body:has(#theme-toggle:checked) .dashboard-month-row--closed{background:linear-gradient(90deg,#ebfaef,transparent 76%)!important}
body:has(#theme-toggle:checked) .dashboard-month-note{color:#71717a!important}
body:has(#theme-toggle:checked) .dashboard-month-row--forecast .dashboard-month-name{color:#3b82f6!important}
body:has(#theme-toggle:checked) .dashboard-month-row--forecast .dashboard-month-note{color:#3b82f699!important}
body:has(#theme-toggle:checked) .dashboard-month-row--forecast .dashboard-month-value{background-image:linear-gradient(120deg,#3b82f6,#6366f1)!important}
body:has(#theme-toggle:checked) .dashboard-month-row--current .dashboard-month-name{color:#f97316!important}
body:has(#theme-toggle:checked) .dashboard-month-row--current .dashboard-month-note{color:#f9731699!important}
body:has(#theme-toggle:checked) .dashboard-month-row--current .dashboard-month-value{background-image:linear-gradient(120deg,#f97316,#ec4899)!important}
body:has(#theme-toggle:checked) .dashboard-month-row--closed .dashboard-month-name{color:#16a34a!important}
body:has(#theme-toggle:checked) .dashboard-month-row--closed .dashboard-month-value{background-image:linear-gradient(120deg,#22c55e,#059669)!important}
body:has(#theme-toggle:checked) .dashboard-month-badge{color:#16a34a!important;background:#16a34a14!important;border-color:#16a34a33!important;box-shadow:0 0 10px #16a34a22!important}
.dashboard-kpi--past{color:#94a3b8}
.dashboard-kpi--current{color:#86efac}
.dashboard-kpi--next{color:#7dd3fc}
body:has(#theme-toggle:checked) .dashboard-kpi--past{color:#64748b}
body:has(#theme-toggle:checked) .dashboard-kpi--current{color:#047857}
body:has(#theme-toggle:checked) .dashboard-kpi--next{color:#0369a1}

/* ---------- Dashboard: grid com card de vencidos ao lado ---------- */
.dashboard-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,330px);gap:18px;align-items:start}
@media (max-width:1000px){.dashboard-grid{grid-template-columns:1fr}}
.dashboard-overdue-list{margin:0;padding:0;list-style:none;display:grid;gap:8px}
.dashboard-apps-card .dashboard-overdue-list{grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
@media (max-width:700px){.dashboard-apps-card .dashboard-overdue-list{grid-template-columns:1fr}}
.dashboard-overdue-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid #ffffff12;border-radius:10px;background:#ffffff04}
.dashboard-overdue-item>span:first-child{min-width:0;overflow-wrap:anywhere}
.dashboard-overdue-days{font-weight:800;font-size:12px;white-space:nowrap}
.dashboard-overdue--purple .dashboard-overdue-days{color:#c4b5fd}
.dashboard-overdue--orange .dashboard-overdue-days{color:#fcd34d}
.dashboard-overdue--red .dashboard-overdue-days{color:#fda4af}
body:has(#theme-toggle:checked) .dashboard-overdue-item{border-color:#e5e8ef;background:#f8fafc}
body:has(#theme-toggle:checked) .dashboard-overdue--purple .dashboard-overdue-days{color:#6d28d9}
body:has(#theme-toggle:checked) .dashboard-overdue--orange .dashboard-overdue-days{color:#b45309}
body:has(#theme-toggle:checked) .dashboard-overdue--red .dashboard-overdue-days{color:#be123c}
body:has(#theme-toggle:not(:checked)) .alert{background:#10b98112;border-color:#34d3994d;color:#a7f3d0;border-radius:12px;box-shadow:0 10px 26px #00000026}
body:has(#theme-toggle:not(:checked)) .empty-state{border-style:dashed;border-color:#3a3a42;background:#ffffff03}

/* ---------- Neutraliza fundos azulados residuais ---------- */
body:has(#theme-toggle:not(:checked)) .payment-tabs,
body:has(#theme-toggle:not(:checked)) .payment-checklist span,
body:has(#theme-toggle:not(:checked)) .payment-step-list div,
body:has(#theme-toggle:not(:checked)) .whatsapp-instance,
body:has(#theme-toggle:not(:checked)) .message-kpi,
body:has(#theme-toggle:not(:checked)) .template-item,
body:has(#theme-toggle:not(:checked)) .client-point-row,
body:has(#theme-toggle:not(:checked)) .finance-card,
body:has(#theme-toggle:not(:checked)) .plan-card,
body:has(#theme-toggle:not(:checked)) .server-card,
body:has(#theme-toggle:not(:checked)) .paid-app-card,
body:has(#theme-toggle:not(:checked)) .integration-form input,
body:has(#theme-toggle:not(:checked)) .client-directory .alert-popover form{
  background:linear-gradient(145deg,#1a1a1e,#141417)!important;
  border-color:#27272d!important;
}
body:has(#theme-toggle:not(:checked)) .plan-form,
body:has(#theme-toggle:not(:checked)) .server-form,
body:has(#theme-toggle:not(:checked)) .server-integration,
body:has(#theme-toggle:not(:checked)) .paid-app-form{background:#151518!important;border-color:#27272d!important}
body:has(#theme-toggle:not(:checked)) .client-directory .client-row{background:linear-gradient(140deg,#1a1a1e,#131316)!important;border-color:#2b2b31!important}
body:has(#theme-toggle:not(:checked)) .main:has(.plan-form) .page-heading{background:linear-gradient(105deg,#1e1b4b,#4c1d95 48%,#701a75)!important;border-bottom-color:#a78bfa66!important}
body:has(#theme-toggle:not(:checked)) .message-kpi span{color:#9aa1b0}
body:has(#theme-toggle:not(:checked)) .message-kpi small{color:#71717a}

/* ---------- Clientes: seções opcionais com fundo distinto ---------- */
.customers-optional-fields{padding:14px 16px;border:1px solid var(--customer-line);border-radius:14px}
.customers-optional-fields--points{background:linear-gradient(135deg,#6366f114,#8b5cf608);border-color:#6366f13d!important}
.customers-optional-fields--promo{background:linear-gradient(135deg,#10b98110,#06b6d408);border-color:#10b98138!important}
.customers-optional-fields>summary{display:flex;align-items:center;justify-content:space-between;list-style:none;cursor:pointer;gap:10px}
.customers-optional-fields>summary::-webkit-details-marker{display:none}
.customers-optional-fields>summary span{margin-left:0!important;padding:2px 9px;border-radius:999px;background:#ffffff0d;border:1px solid #ffffff14;font-size:10px!important;text-transform:uppercase;letter-spacing:.08em}
.customers-optional-fields--points>summary span{color:#a5b4fc!important;background:#6366f11f!important;border-color:#818cf84d!important}
.customers-optional-fields--promo>summary span{color:#6ee7b7!important;background:#10b9811f!important;border-color:#34d3994d!important}
body:has(#theme-toggle:checked) .customers-optional-fields--points{background:linear-gradient(135deg,#eef2ff,#f5f3ff);border-color:#c7d2fe!important}
body:has(#theme-toggle:checked) .customers-optional-fields--promo{background:linear-gradient(135deg,#ecfdf5,#f0fdfa);border-color:#a7f3d0!important}
body:has(#theme-toggle:checked) .customers-optional-fields--points>summary span{color:#4338ca!important;background:#e0e7ff!important;border-color:#c7d2fe!important}
body:has(#theme-toggle:checked) .customers-optional-fields--promo>summary span{color:#047857!important;background:#d1fae5!important;border-color:#a7f3d0!important}

.customers-optional-fields--points{background:linear-gradient(135deg,#6366f11c,#8b5cf60f 80%)!important;border:1px solid #818cf84d!important;border-left:3px solid #818cf8!important}
.customers-optional-fields--promo{background:linear-gradient(135deg,#10b9811c,#06b6d40f 80%)!important;border:1px solid #34d3994d!important;border-left:3px solid #34d399!important}
.customers-optional-fields--points>summary{color:#a5b4fc!important}
.customers-optional-fields--promo>summary{color:#6ee7b7!important}
.customers-optional-fields--points>summary span,.customers-optional-fields--promo>summary span{margin-left:auto!important}
body:has(#theme-toggle:checked) .customers-optional-fields--points{background:linear-gradient(135deg,#eef2ff,#faf5ff)!important;border-color:#c7d2fe!important;border-left-color:#6366f1!important}
body:has(#theme-toggle:checked) .customers-optional-fields--promo{background:linear-gradient(135deg,#ecfdf5,#f0fdfa)!important;border-color:#a7f3d0!important;border-left-color:#10b981!important}

/* ---------- Login ---------- */
.login-page{background:radial-gradient(circle at 18% 18%,#6366f124,transparent 30%),radial-gradient(circle at 82% 82%,#a855f726,transparent 30%),radial-gradient(circle at 55% 105%,#ec489910,transparent 34%),#0a0a0c!important}
.login-card{background:#151518ee!important;border-color:#2e2e34!important;box-shadow:0 30px 80px #00000090,inset 0 1px 0 #ffffff14}
.login-brand .brand-grid{box-shadow:0 0 30px #6366f150,0 10px 24px #0008}
.guest-main{color:var(--text)}

/* ---------- Mobile: drawer do menu ---------- */
.mobile-menu-toggle{display:none}
@media(max-width:700px){
  .sidebar{position:relative!important;width:100%!important;height:auto!important;padding:14px!important;border-bottom:1px solid #ffffff16}
  .sidebar .brand-lockup{padding:0 4px 10px!important}
  .mobile-menu-toggle{display:flex;width:100%;align-items:center;justify-content:center;gap:8px;margin:0 0 4px;padding:10px;background:#ffffff08!important;border:1px solid #ffffff18!important;border-radius:11px;color:#cbd5e1;font-size:12px;font-weight:700;box-shadow:none!important}
  .mobile-menu-toggle:hover{background:#ffffff12!important;color:#fff!important;transform:none!important}
  .sidebar #panel-menu{display:none;padding:4px 2px 0}
  .sidebar.menu-open #panel-menu{display:block}
  .sidebar #panel-menu .menu-group{display:block;margin:0 0 12px}
  .sidebar #panel-menu .menu-label{display:flex!important}
  .sidebar a{min-height:40px}
  .sidebar .profile{margin-bottom:12px}
  .sidebar .theme-switch,.sidebar .logout{display:none!important}
}

/* ---------- Acessibilidade / microinteracoes ---------- */
@keyframes pf5-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:no-preference){
  .main .page-heading{animation:pf5-rise .45s var(--ease)}
  .page-heading + .card, .page-heading + details.card, .page-heading + .grid > .card{animation:pf5-rise .45s var(--ease) .05s both}
  .sidebar a svg,.sidebar a{transition-duration:.22s}
}

body:has(#theme-toggle:not(:checked)) .topbar,
body:has(#theme-toggle:not(:checked)) .card,
body:has(#theme-toggle:not(:checked)) .kpi-card,
body:has(#theme-toggle:not(:checked)) input,
body:has(#theme-toggle:not(:checked)) select,
body:has(#theme-toggle:not(:checked)) textarea,
body:has(#theme-toggle:not(:checked)) .menu-count,
body:has(#theme-toggle:not(:checked)) .wallet-badge{transition:all .25s var(--ease)}.reminder-date-fields{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:4px}.reminder-date-fields h3{font-size:11px;color:var(--muted);margin:0 0 6px}.reminder-list{display:grid;gap:10px;margin-top:16px}.reminder-item{display:flex;align-items:center;gap:14px;justify-content:space-between;padding:15px 16px;background:#27272a66;border:1px solid var(--surface-3);border-radius:13px;transition:all .25s var(--ease)}.reminder-item:hover{transform:translateY(-2px);border-color:#71717a;box-shadow:0 14px 30px #0004}.reminder-item-body{flex:1;min-width:0}.reminder-item-body strong{display:block;font-size:14px}.reminder-item-body small{display:block;margin-top:6px;color:var(--muted);font-size:12px}.reminder-item-actions{display:flex;gap:8px;flex:none}.reminder-item-actions form{margin:0}.reminder-badge{color:#fbbf24;font-weight:600}.reminder-badge-overdue{color:#f87171}.reminder-badge-today{color:#fbbf24}.reminder-badge-soon{color:#a5b4fc}.reminder-item.reminder-done{opacity:.55}.reminder-item.reminder-done .reminder-badge{color:#34d399}.reminder-item.reminder-overdue{border-color:#f8717177;background:#f8717110}.reminder-item.reminder-today{border-color:#fbbf2477;background:#fbbf2410}


.dashboard-top-grid{grid-template-columns:minmax(210px,250px) minmax(0,1fr) minmax(220px,260px) minmax(240px,300px)}@media (max-width:1280px){.dashboard-top-grid{grid-template-columns:minmax(180px,220px) minmax(0,1fr) minmax(200px,230px)}}@media (max-width:1000px){.dashboard-top-grid{grid-template-columns:1fr}}.dashboard-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:4px}.dashboard-card-head h2{margin:0}.dashboard-card-link{font-size:12px;font-weight:600;color:var(--blue);text-decoration:none;white-space:nowrap}.dashboard-reminders-list{margin:0;padding:0;list-style:none;display:grid;gap:8px}.dashboard-reminders-card .dashboard-overdue-item{align-items:flex-start}.dashboard-reminders-card .dashboard-overdue-days{flex:none;white-space:nowrap}body:has(#theme-toggle:checked) .dashboard-reminders-card .dashboard-overdue-item{border-color:#e5e8ef!important;background:#f8fafc!important}.dashboard-overdue--ok .dashboard-overdue-days{color:#86efac}body:has(#theme-toggle:checked) .dashboard-overdue--ok .dashboard-overdue-days{color:#047857}
@keyframes blinkPulse{0%,100%{opacity:1}50%{opacity:.25}}.blink-badge{animation:blinkPulse 1s ease-in-out infinite}.suggestion-filters{display:grid;grid-template-columns:1fr auto auto auto auto;gap:10px}.suggestion-filters input,.suggestion-filters select{padding:9px 11px;border-radius:8px}.suggestion-list{display:grid;gap:10px}.suggestion-item{padding:12px 14px;border:1px solid #ffffff12;border-radius:11px;background:#ffffff04}.suggestion-item-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.suggestion-item-head strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.suggestion-badge{display:inline-block;padding:3px 9px;border-radius:99px;font-size:11px;font-weight:700;white-space:nowrap}.suggestion-badge--new{color:#fda4af;background:#7f1d1d33;border:1px solid #f8717155}.suggestion-badge--read{color:#86efac;background:#14532d33;border:1px solid #4ade8055}.suggestion-badge--root{color:#c4b5fd;background:#4c1d9533;border:1px solid #a78bfa55}.suggestion-badge--role{color:#7dd3fc;background:#0c4a6e33;border:1px solid #38bdf855}.suggestion-admin-actions{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:16px}.suggestion-admin-actions form{margin:0}.suggestion-table td{padding:12px;vertical-align:top}.suggestion-cell-text{max-width:420px;white-space:pre-wrap;overflow-wrap:anywhere}.suggestion-cell-date{white-space:nowrap}.suggestion-row-actions{display:flex;gap:8px}.suggestion-row-actions form{margin:0}body:has(#theme-toggle:checked) .suggestion-item{background:#f8fafc;border-color:#e5e8ef}.suggestion-count{background:#7f1d1d;color:#fff}@media (max-width:900px){.suggestion-filters{grid-template-columns:1fr 1fr}}


.global-notice{display:flex;align-items:flex-start;gap:11px;width:min(100%,var(--page-max));margin:0 auto 22px;padding:12px 16px;border-radius:12px;border:1px solid #ffffff12;box-shadow:0 8px 24px #0002;color:#e4e4e7;font-size:13.5px;line-height:1.5}.global-notice--info{background:linear-gradient(90deg,#164e63cc,#0e7490aa);border-color:#38bdf855}.global-notice--success{background:linear-gradient(90deg,#14532dcc,#16a34aaa);border-color:#4ade8055}.global-notice--warning{background:linear-gradient(90deg,#713f12cc,#ca8a04aa);border-color:#facc1555}.global-notice--danger{background:linear-gradient(90deg,#450a0acc,#dc2626aa);border-color:#f8717155}.global-notice-icon{flex:none;font-size:17px;margin-top:1px}.global-notice-body{flex:1;min-width:0}.global-notice-body strong{color:#fff;font-size:13.5px}.global-notice-body > span{word-break:break-word;white-space:pre-wrap}.global-notice-expires{display:block;color:#ffffffaa;font-size:12px;margin-top:2px}.global-notice-tag{display:inline-block;margin-left:8px;padding:1px 8px;border-radius:99px;background:#dc2626;color:#fff;font-size:11px;font-weight:700;vertical-align:middle}.global-notice-close{margin-left:auto;border:none;background:transparent;color:#ffffffee;font-size:20px;line-height:1;cursor:pointer;padding:0 2px;opacity:.7;flex:none}.global-notice-close:hover{opacity:1}body:has(#theme-toggle:checked) .global-notice{color:#1e293b;border-color:#e2e8f0;box-shadow:0 8px 24px #64748b14}body:has(#theme-toggle:checked) .global-notice--info{background:#e0f2fe;color:#0c4a6e;border-color:#bae6fd}.global-notice--info .global-notice-body strong{color:inherit}body:has(#theme-toggle:checked) .global-notice--success{background:#dcfce7;color:#14532d;border-color:#86efac}body:has(#theme-toggle:checked) .global-notice--warning{background:#fef3c7;color:#713f12;border-color:#fde047}body:has(#theme-toggle:checked) .global-notice--danger{background:#fee2e2;color:#7f1d1d;border-color:#fecaca}.notice-status{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}.notice-status-badge{padding:5px 12px;border-radius:99px;font-size:12px;font-weight:700}.notice-status-badge--active{color:#86efac;background:#14532d33;border:1px solid #4ade8055}.notice-status-badge--inactive{color:#a1a1aa;background:#27272a55;border:1px solid #3f3f46}.notice-status-badge--expired{color:#fda4af;background:#7f1d1d33;border:1px solid #f8717155}.notice-status-badge--target{color:#c4b5fd;background:#4c1d9533;border:1px solid #a78bfa55}.notice-types{display:flex;gap:10px;margin:8px 0 14px}.notice-types .type-choice input{position:absolute;opacity:0;pointer-events:none}.type-badge{display:inline-block;padding:9px 16px;border-radius:11px;font-size:13px;font-weight:700;cursor:pointer;color:#0f172a;background:#e2e8f0;border:2px solid transparent;transition:all .2s var(--ease)}.type-badge:hover{transform:translateY(-2px)}.notice-time-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.notice-active-check{display:flex;align-items:center;gap:8px;margin:6px 0 12px;cursor:pointer;font-weight:600}.notice-deactivate{margin-top:0}.notice-preview-box{display:flex;align-items:flex-start;gap:12px;padding:13px 18px;border-radius:11px;border:1px solid #ffffff12;color:#e4e4e7;font-size:14px;line-height:1.5}.notice-preview--info{background:linear-gradient(90deg,#164e63cc,#0e7490aa);border-color:#38bdf855}.notice-preview--success{background:linear-gradient(90deg,#14532dcc,#16a34aaa);border-color:#4ade8055}.notice-preview--warning{background:linear-gradient(90deg,#713f12cc,#ca8a04aa);border-color:#facc1555}.notice-preview--danger{background:linear-gradient(90deg,#450a0acc,#dc2626aa);border-color:#f8717155}.notice-preview-icon{flex:none;font-size:18px}.notice-preview-box strong{color:#fff}.notice-preview-box > div{flex:1;min-width:0}.notice-preview-box > div > span{word-break:break-word;white-space:pre-wrap}@media (max-width:700px){.notice-time-grid{grid-template-columns:1fr}}

/* ================= MENSSAGENS: UX e acabamento ================= */

/* Borda de textarea com cor de tema claro dentro do card escuro */
.message-compose textarea,
.message-templates textarea,
.message-template-form textarea{
  border:1px solid var(--surface-3)!important;
  background:var(--surface-2);
  color:var(--text);
  border-radius:10px;
  line-height:1.55;
}
.message-compose textarea:focus,
.message-templates textarea:focus{
  border-color:var(--blue)!important;
  outline:none;
  box-shadow:0 0 0 3px #3b82f633;
}

/* KPIs viram links navegaveis */
a.message-kpi{
  display:block;
  color:inherit;
  text-decoration:none;
  transition:transform .2s var(--ease),border-color .2s,box-shadow .2s;
}
a.message-kpi:hover,
a.message-kpi:focus-visible{
  transform:translateY(-2px);
  border-color:#60a5fa88;
  box-shadow:0 14px 30px #0004;
}
a.message-kpi small::after{content:' \2192';opacity:.5}

/* Aviso de envio em lote */
.message-recipient-warning{
  margin:12px 0 0;
  padding:13px 15px;
  background:linear-gradient(135deg,#713f121f,#ef444414);
  border:1px solid #f59e0b55;
  border-left:3px solid var(--amber);
  border-radius:11px;
}
.message-recipient-warning[hidden]{display:none}
.message-recipient-warning strong{
  display:block;
  color:#fcd34d;
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.message-recipient-warning p{margin:7px 0 0;color:var(--muted);font-size:12px;line-height:1.5}
.message-recipient-warning b{color:#fde68a}

/* Busca rapida */
.message-search{display:flex;align-items:center;min-width:210px;flex:1 1 210px}
.message-search input{
  width:100%;
  height:38px;
  padding:0 13px;
  background:var(--surface-2);
  border:1px solid var(--surface-3);
  border-radius:10px;
  color:var(--text);
  font:inherit;
  font-size:12px;
}
.message-search input::placeholder{color:var(--faint)}
.message-search input:focus{
  border-color:var(--blue);
  outline:none;
  box-shadow:0 0 0 3px #3b82f62b;
}
.message-search-count{
  color:var(--faint);
  font-size:11px;
  white-space:nowrap;
}
.message-search-empty{
  margin:15px 0 0;
  padding:15px;
  text-align:center;
  background:var(--surface-2);
  border:1px dashed var(--surface-3);
  border-radius:11px;
  font-size:12px;
}
.message-search-empty[hidden]{display:none}
.message-search-row{
  display:flex;
  align-items:center;
  gap:11px;
  margin:17px 0 0;
  padding-top:15px;
  border-top:1px solid #ffffff12;
}

/* Itens ocultados pela busca */
.template-item[hidden],
.message-history tr[hidden]{display:none!important}

/* Titulos das secoes nao colam ao ir para o ancora */
.message-compose,
.message-templates{scroll-margin-top:18px}

/* Cabecalho de templates: form ao lado do titulo */
.message-templates>.section-heading{
  align-items:flex-start;
  flex-wrap:wrap;
  gap:16px;
}
.message-templates>.section-heading>div{flex:1 1 180px;min-width:0}

/* Historico: alinhar busca e filtros */
.message-history-tools{flex:1 1 100%;justify-content:flex-end}
.message-history-tools .message-search{flex:1 1 230px;max-width:340px;order:-1}
.message-history-tools .message-filters{order:-1}

@media (max-width:860px){
  .message-search-row{flex-wrap:wrap}
  .message-history-tools .message-search{max-width:none}
  .message-history-tools .message-filters{width:100%;overflow-x:auto;padding-bottom:4px}
  .message-history-tools{justify-content:flex-start}
}
@media (max-width:700px){
  .message-templates>.section-heading{flex-direction:column;align-items:stretch}
  .message-template-create{max-width:none}
  .message-kpis{grid-template-columns:1fr 1fr}
  a.message-kpi small::after{content:none}
}

/* Tema claro: neutraliza os fundos azulados que faltavam no modulo */
body:has(#theme-toggle:not(:checked)) .message-preview,
body:has(#theme-toggle:not(:checked)) .message-meta>div,
body:has(#theme-toggle:not(:checked)) .message-variable,
body:has(#theme-toggle:not(:checked)) .message-variable-group,
body:has(#theme-toggle:not(:checked)) .message-filters a,
body:has(#theme-toggle:not(:checked)) .message-template-create input,
body:has(#theme-toggle:not(:checked)) .message-template-create textarea,
body:has(#theme-toggle:not(:checked)) .message-search input,
body:has(#theme-toggle:not(:checked)) .message-search-empty,
body:has(#theme-toggle:not(:checked)) .message-compose textarea,
body:has(#theme-toggle:not(:checked)) .message-templates textarea{
  background:linear-gradient(145deg,#1a1a1e,#141417)!important;
  border-color:#27272d!important;
  color:var(--text);
}
body:has(#theme-toggle:not(:checked)) .message-filters a.selected{
  background:#2563eb2b!important;
  border-color:#60a5fa66!important;
}
body:has(#theme-toggle:not(:checked)) .message-search-count{color:var(--faint)}

/* Cobranca PIX publica (Mercado Pago 2) */
.pix-public{text-align:center;max-width:420px;margin:0 auto}
.pix-public h2{margin:12px 0 4px}
.pix-amount{font-size:1.9rem;font-weight:700;margin:4px 0}
.pix-public img{border-radius:12px;background:#fff;padding:10px;margin:12px 0}
.pix-public textarea{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.78rem;text-align:left}
.pix-status{display:inline-block;padding:6px 14px;border-radius:999px;font-size:.85rem;font-weight:600;background:#fef3c7;color:#92400e;border:1px solid #fcd34d}
.pix-status[data-status="approved"]{background:#dcfce7;color:#166534;border-color:#86efac}
.pix-status[data-status="rejected"],.pix-status[data-status="cancelled"],.pix-status[data-status="expired"]{background:#fee2e2;color:#991b1b;border-color:#fca5a5}
.pix-done{font-weight:600;color:var(--success,#16a34a)}

/* Link de pagamento para enviar ao cliente (compra de créditos) */
.payment-link-section{margin:14px 0;padding:12px;border:1px solid var(--border,#d4d4d8);border-radius:10px;background:#ffffff08}
.payment-link-section label{display:block;font-size:.78rem;color:var(--faint,#71717a);margin-bottom:4px}
.payment-link-section input{width:100%;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.82rem;padding:8px 10px;border:1px solid var(--border,#d4d4d8);border-radius:8px;background:var(--surface,#18181b);color:var(--text,#e4e4e7);cursor:pointer}
.payment-link-section input:focus{outline:2px solid var(--blue,#60a5fa);outline-offset:1px}
.payment-link-section input:hover{border-color:var(--muted,#94a3b8)}

/* Configuracao do Mercado Pago 2: o que ja esta salvo + limpar valores */
.mp2-saved{margin:0 0 18px;padding:14px 16px;border:1px dashed var(--border,#d4d4d8);border-radius:12px;background:#ffffff08}
.mp2-saved h3{margin:0 0 8px;font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--faint,#71717a)}
.mp2-saved ul{list-style:none;margin:0;padding:0;display:grid;gap:5px;font-size:.83rem}
.mp2-saved li{display:flex;gap:6px;align-items:baseline;flex-wrap:wrap}
.mp2-saved b{font-weight:700}
.mp2-saved b.ok{color:var(--success,#16a34a)}
.mp2-saved b.off{color:var(--faint,#a1a1aa);font-weight:500}
.mp2-saved .form-help{margin:10px 0 0}
.check-label--danger{color:#b91c1c!important;font-size:.8rem;display:flex;align-items:center;gap:7px;margin:-6px 0 14px}
.check-label--danger input{accent-color:#dc2626}
body:has(#theme-toggle:not(:checked)) .check-label--danger{color:#fca5a5!important}
.mp2-reset{border-color:#fca5a5}
.mp2-reset h2{color:#b91c1c}
body:has(#theme-toggle:not(:checked)) .mp2-reset h2{color:#fca5a5}
body:has(#theme-toggle:not(:checked)) .mp2-saved{background:#ffffff06}
