:root{
  --bg:#eef3f8;
  --surface:#ffffff;
  --surface-2:#f8fafc;
  --line:#d7dee8;
  --line-soft:#e8edf5;
  --text:#172033;
  --muted:#6b778c;
  --muted-2:#9aa7b8;
  --dark:#202733;
  --dark-2:#171e29;
  --dark-3:#111722;
  --primary:#4f76e8;
  --primary-dark:#3158cb;
  --primary-soft:#edf2ff;
  --success:#39b36b;
  --danger:#dc4d4d;
  --warning:#f59e0b;
  --radius:4px;
  --shadow:0 2px 10px rgba(31,41,55,.10);
  --shadow-soft:0 1px 4px rgba(31,41,55,.08);
}
*{box-sizing:border-box}
html{height:100%}
body{
  margin:0;
  min-height:100%;
  font-family:"Segoe UI",Roboto,Arial,Helvetica,sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:13px;
  line-height:1.45;
}
button,input,textarea,select{font:inherit}
.app{display:flex;min-height:100vh;background:#eef3f8}
.sidebar{
  width:230px;
  flex:0 0 230px;
  height:100vh;
  position:sticky;
  top:0;
  overflow:auto;
  background:linear-gradient(180deg,var(--dark) 0%,var(--dark-2) 100%);
  border-right:1px solid rgba(255,255,255,.08);
  box-shadow:2px 0 8px rgba(15,23,42,.18);
  padding:0;
}
.logo{
  height:56px;
  margin:0;
  padding:0 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:#fff;
  font-size:18px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1.15;
  letter-spacing:.02em;
  border-bottom:1px solid rgba(255,255,255,.10);
  background:#242b38;
}
.logo::after{content:"☰";font-size:18px;color:#d6dce7;font-weight:500}
.nav{
  width:100%;
  min-height:48px;
  margin:0;
  padding:11px 16px 11px 40px;
  position:relative;
  display:flex;
  align-items:center;
  border:0;
  border-bottom:1px solid rgba(255,255,255,.07);
  border-radius:0;
  background:transparent;
  color:#eef3fb;
  font-size:13px;
  font-weight:650;
  text-align:left;
  cursor:pointer;
  box-shadow:none;
  transition:background .12s ease,color .12s ease,border-color .12s ease;
}
.nav::before{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  width:17px;
  text-align:center;
  color:#f7f9fc;
  opacity:.95;
  font-size:14px;
}
.nav::after{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:3px;
  background:transparent;
}
.nav[data-page="dashboard"]::before{content:"▦"}
.nav[data-page="comunicados"]::before{content:"✉"}
.nav[data-page="campanhas"]::before{content:"▣"}
.nav[data-page="scripts"]::before{content:"⌘"}
.nav[data-page="shell"]::before{content:">_";font-size:10px}
.nav[data-page="suporte-remoto"]::before{content:"◉"}
.nav[data-page="agentes"]::before{content:"▤"}
.nav[data-page="bloqueio"]::before{content:"◼"}
.nav[data-page="usuarios"]::before{content:"◌"}
.nav[data-page="configuracoes"]::before{content:"⚙"}
.nav[data-page="historico"]::before{content:"↺"}
.nav:hover{background:#2b3444;color:#fff;transform:none;box-shadow:none}
.nav.active{background:#394250;color:#fff;box-shadow:none;border-color:rgba(255,255,255,.08)}
.nav.active::after{background:var(--primary)}
.nav.active::before{color:#fff;background:transparent}
.nav.hidden{display:none!important}
.main{flex:1;min-width:0;padding:0 24px 34px}
.topbar{
  height:56px;
  margin:0 -24px 28px;
  padding:0 24px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
  background:#fff;
  border-bottom:1px solid #ccd5e1;
  box-shadow:0 1px 7px rgba(15,23,42,.12);
}
.topbar::before,.topbar::after{display:none!important;content:none!important}
.session-user,.profile-card{
  height:42px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  backdrop-filter:none;
}
.session-user{
  min-width:190px;
  display:grid;
  grid-template-columns:1fr auto;
  grid-template-rows:20px 18px;
  column-gap:10px;
  align-items:center;
}
#sessionUserName{font-size:13px;font-weight:800;color:#172033;line-height:1.1}
#sessionUserEmail{font-size:11px;color:#748196;line-height:1.1;grid-column:1}
.session-user .mini-button{grid-column:2;grid-row:1 / 3;align-self:center}
.profile-card{width:220px;display:flex;align-items:center;gap:10px}
.profile-card label{margin:0;font-size:12px;font-weight:750;color:#455166;white-space:nowrap}
.profile-card select{height:34px;margin:0;padding:6px 10px;background:#fff}
.page{display:none}.page.active{display:block}.hidden{display:none!important}
.card{
  background:#fff;
  border:1px solid #dce3ec;
  border-radius:3px;
  box-shadow:var(--shadow);
  padding:18px;
  margin:0 0 18px;
}
#page-dashboard .card{max-width:1120px;margin:0 auto 18px;padding:22px 22px 18px}
h1{
  margin:0 0 6px;
  font-size:24px;
  line-height:1.18;
  font-weight:500;
  letter-spacing:-.02em;
  color:#121927;
}
#page-dashboard h1::before{content:"Olá, ";font-weight:400;color:#121927}
#page-dashboard h1::after{content:". Bem-vindo de volta";font-weight:400;color:#121927}
#page-dashboard h1{font-size:26px;margin-top:2px}
#page-dashboard h1 + .grid{margin-top:24px}
h2{margin:24px 0 10px;font-size:16px;font-weight:650;color:#172033}.hint{color:var(--muted);font-size:12px;margin:0 0 16px}.hint::first-letter{text-transform:uppercase}
p{margin:0 0 14px}
.grid{display:grid;gap:16px}.dashboard-grid{grid-template-columns:repeat(4,minmax(150px,1fr));align-items:stretch}.metric{
  min-height:92px;
  position:relative;
  padding:16px 14px 14px 72px;
  border:1px solid #edf1f6;
  border-radius:3px;
  background:#fff;
  box-shadow:none;
  overflow:hidden;
}
.metric::before{
  content:"";
  position:absolute;
  left:22px;
  top:21px;
  width:38px;
  height:38px;
  border-radius:50%;
  background:#eef3ff;
}
.metric::after{
  position:absolute;
  left:34px;
  top:29px;
  width:auto;
  height:auto;
  border-radius:0;
  background:transparent!important;
  color:var(--primary);
  opacity:1;
  font-size:16px;
  font-weight:700;
}
.metric[data-dashboard-card="agents"]::before{background:#eef2ff}.metric[data-dashboard-card="agents"]::after{content:"⇄"}
.metric[data-dashboard-card="offline"]::before{background:#ecfdf3}.metric[data-dashboard-card="offline"]::after{content:"●";color:#39b36b}
.metric[data-dashboard-card="notices"]::before{background:#fff7ed}.metric[data-dashboard-card="notices"]::after{content:"✉";color:#f59e0b}
.metric[data-dashboard-card="campaigns"]::before{background:#fef2f2}.metric[data-dashboard-card="campaigns"]::after{content:"◈";color:#ef6464}
.metric[data-dashboard-card="scripts"]::before{background:#eef2ff}.metric[data-dashboard-card="scripts"]::after{content:"⌘";color:#4f76e8}
.metric[data-dashboard-card="locks"]::before{background:#fef2f2}.metric[data-dashboard-card="locks"]::after{content:"▣";color:#dc4d4d}
.metric[data-dashboard-card="confirmations"]::before{background:#eff6ff}.metric[data-dashboard-card="confirmations"]::after{content:"✓";color:#4f76e8}
.metric span{display:block;margin:0 0 2px;font-size:22px;line-height:1.05;font-weight:700;color:#121927;letter-spacing:-.02em}.metric small{display:block;color:#667085;font-size:12px;font-weight:500}.metric-actions{display:block}.metric-actions .mini-button{margin-top:10px}.dashboard-actions{display:flex;justify-content:flex-end;margin-top:18px;padding-top:10px;border-top:1px solid #eef2f7}
label{display:block;margin:12px 0 6px;color:#344054;font-size:12px;font-weight:650}
input,textarea,select{
  width:100%;
  height:38px;
  border:1px solid #cfd8e5;
  border-radius:3px;
  padding:8px 10px;
  margin:0 0 11px;
  background:#fff;
  color:#172033;
  outline:none;
  transition:border-color .12s ease,box-shadow .12s ease;
}
input:focus,textarea:focus,select:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(79,118,232,.12)}
textarea{height:auto;min-height:150px;font-family:Consolas,"Cascadia Mono","Courier New",monospace;line-height:1.5;resize:vertical}
button{
  min-height:34px;
  border:1px solid var(--primary-dark);
  border-radius:3px;
  padding:8px 14px;
  background:var(--primary);
  color:#fff;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  box-shadow:none;
  transition:background .12s ease,border-color .12s ease,box-shadow .12s ease;
}
button:hover{background:var(--primary-dark);border-color:var(--primary-dark);transform:none;box-shadow:0 2px 8px rgba(79,118,232,.22)}
button:active{transform:none;box-shadow:none}.secondary,button.secondary{background:#fff;color:#172033;border:1px solid #cbd5e1;box-shadow:none}.secondary:hover,button.secondary:hover{background:#f7f9fc;border-color:#aeb9c8;box-shadow:none}.mini-button{min-height:28px;padding:6px 10px;border-radius:3px;font-size:11px;width:max-content}.check{display:flex;gap:8px;align-items:center;margin:10px 0 12px;font-weight:500;color:#344054}.check input{width:auto;height:auto;margin:0;accent-color:var(--primary)}.timer-box{margin:12px 0 14px;padding:13px;border:1px solid #e7edf5;border-radius:3px;background:#f9fbfd}.template-row,.actions-row,.shell-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:8px 0 14px}.template-row input,.template-row select{flex:1 1 280px;margin:0}.settings-company-row{width:100%;max-width:none}.settings-company-row input{flex:1 1 auto}.settings-company-row button{background:#fff;color:#172033;border:1px solid #cbd5e1;flex:0 0 auto;min-width:72px}.template-row button{flex:0 0 auto}.section-header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}.section-header h1{margin-bottom:4px}
.terminal,.script-terminal{background:#101722;color:#c8f7dd;padding:14px;border-radius:3px;white-space:pre-wrap;min-height:260px;max-height:560px;font-family:Consolas,"Cascadia Mono","Courier New",monospace;font-size:12px;line-height:1.55;overflow:auto;border:1px solid #0b1018;box-shadow:inset 0 1px 0 rgba(255,255,255,.04)}.script-terminal{min-height:220px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;border:1px solid #e2e8f0;background:#fff;border-radius:0}th,td{padding:11px 12px;border-bottom:1px solid #e8edf5;text-align:left;vertical-align:middle;font-size:12px}th{background:#f7f9fc;color:#475467;font-weight:700;white-space:nowrap}tr:last-child td{border-bottom:0}tbody tr:hover td{background:#f8fbff}.status{display:flex;align-items:center;gap:8px;font-weight:650;color:#344054}.status-dot{width:9px;height:9px;border-radius:50%;display:inline-block;flex:0 0 9px}.status-online{background:var(--success);box-shadow:0 0 0 3px rgba(57,179,107,.12)}.status-offline{background:var(--danger);box-shadow:0 0 0 3px rgba(220,77,77,.12)}.list{display:grid;gap:9px;margin-top:14px}.item{border:1px solid #e4eaf2;border-radius:3px;padding:12px;background:#fff}.item-title{font-weight:700;margin-bottom:6px;color:#172033}.item-meta{font-size:11px;color:#748196}pre.small{white-space:pre-wrap;background:#f8fafc;border:1px solid #e4eaf2;border-radius:3px;padding:11px;font-size:11px;color:#344054;overflow:auto}.remote-status{padding:10px 12px;border-radius:3px;border:1px solid #e4eaf2;background:#f8fafc;color:#344054;font-weight:650;margin:9px 0 12px}.remote-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid #e4eaf2;border-radius:3px;background:#fff;margin-bottom:12px}.remote-help{color:#748196;font-size:11px}.remote-view-wrap{position:relative;min-height:480px;border-radius:3px;border:1px solid #101722;background:#0b1018;overflow:hidden;outline:none;touch-action:none;user-select:none}.remote-view-wrap:focus{box-shadow:0 0 0 3px rgba(79,118,232,.18)}.remote-screen{display:none;width:100%!important;height:auto!important;object-fit:contain!important;image-rendering:auto!important;cursor:crosshair!important}.remote-placeholder{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#9aa7b8;font-weight:650}.remote-view-wrap.has-frame .remote-screen,#remoteScreen[src],#remoteScreen[src^="data:image"]{display:block!important}.remote-view-wrap.has-frame .remote-placeholder,#remoteViewWrap.has-frame #remotePlaceholder{display:none!important}#page-scripts #scriptList,#page-scripts #scriptsList,#page-scripts #savedScripts,#page-scripts .script-list,#page-scripts .saved-scripts,#page-scripts .script-card,#page-scripts [data-script-id]{display:none!important}#scriptApiResultPanel{display:none!important}.permissions-loading .nav{visibility:hidden}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background:#b9c4d2;border-radius:999px;border:2px solid transparent;background-clip:content-box}::-webkit-scrollbar-thumb:hover{background:#96a3b4;background-clip:content-box}
@media (max-width:1180px){.dashboard-grid{grid-template-columns:repeat(2,minmax(150px,1fr))}}
@media (max-width:900px){.app{display:block}.sidebar{position:relative;width:100%;height:auto;display:flex;gap:0;overflow:auto}.logo{min-width:190px}.logo::after{display:none}.nav{width:auto;min-width:max-content;border-right:1px solid rgba(255,255,255,.07);border-bottom:0}.main{padding:0 14px 24px}.topbar{margin:0 -14px 18px;padding:8px 14px;height:auto;flex-wrap:wrap}.topbar::before{display:none}.topbar::after{display:none}.session-user,.profile-card{flex:1 1 230px}.card,#page-dashboard .card{max-width:none;padding:16px}.dashboard-grid{grid-template-columns:1fr 1fr}}
@media (max-width:620px){h1,#page-dashboard h1{font-size:22px}.dashboard-grid{grid-template-columns:1fr}.section-header{display:block}.section-header button{margin-top:10px;width:100%}.template-row button,.actions-row button,.shell-actions button{width:100%}.remote-toolbar{display:block}.remote-help{display:block;margin-top:8px}}


/* Notificações inferiores, sem alert modal do navegador */
.toast-container{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:99999;
  display:grid;
  gap:10px;
  width:min(390px,calc(100vw - 32px));
  pointer-events:none;
}
.app-toast{
  display:grid;
  grid-template-columns:30px minmax(0,1fr) 28px;
  align-items:center;
  gap:10px;
  min-height:52px;
  padding:11px 12px;
  border:1px solid #d8e1ee;
  border-left:4px solid var(--primary);
  border-radius:8px;
  background:#fff;
  color:#172033;
  box-shadow:0 14px 38px rgba(16,24,40,.18);
  animation:toastIn .18s ease-out;
  pointer-events:auto;
}
.app-toast-success{border-left-color:#39b36b}.app-toast-error{border-left-color:#dc4d4d}.app-toast-info{border-left-color:var(--primary)}
.app-toast-icon{
  width:28px;
  height:28px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#eef2ff;
  color:var(--primary);
  font-size:13px;
  font-weight:800;
}
.app-toast-success .app-toast-icon{background:#ecfdf3;color:#21864f}.app-toast-error .app-toast-icon{background:#fef2f2;color:#c93434}
.app-toast-body{font-size:13px;font-weight:650;line-height:1.35;word-break:break-word}
.app-toast-close{
  min-width:0;
  min-height:28px;
  width:28px;
  height:28px;
  padding:0;
  border:0;
  background:transparent;
  color:#667085;
  box-shadow:none;
  font-size:20px;
  line-height:1;
}
.app-toast-close:hover{background:#f2f4f7;color:#172033;border:0;box-shadow:none}
.app-toast.is-hiding{opacity:0;transform:translateY(8px);transition:opacity .18s ease,transform .18s ease}
@keyframes toastIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
@media (max-width:620px){.toast-container{right:14px;bottom:14px;width:calc(100vw - 28px)}}
