@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root{
  --bg: #0B0E17;
  --sidebar: #0F1320;
  --surface: #131829;
  --border: #232B3D;
  --text: #E7ECF7;
  --text-dim: #8B96AE;
  --text-faint: #5B6580;
  --active-bg: #1C2336;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
}

a{ color: inherit; text-decoration:none; }

/* ---------- Sidebar ---------- */
.sidebar{
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar);
  padding: 28px 16px;
}

.nav-label{
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  padding: 0 12px;
  margin-bottom: 14px;
}

.nav{ display:flex; flex-direction:column; gap:2px; }

.nav-item{
  display:flex; align-items:center; gap:10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
}
.nav-item.active{
  background: var(--active-bg);
  color: var(--text);
}
.nav-item:hover:not(.active){ color: var(--text); }

.plat-dot{
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.plat-dot.meta{ background: linear-gradient(135deg,#0081FB,#00C6FF); }
.plat-dot.google{ background: conic-gradient(from -45deg, #4285F4 0deg 90deg, #34A853 90deg 180deg, #FBBC05 180deg 270deg, #EA4335 270deg 360deg); }

/* ---------- Main ---------- */
.main{
  flex: 1;
  padding: 40px 48px;
  max-width: 1140px;
}

.page-title{
  font-family:'Sora', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.page-sub{
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--text-dim);
}

.logos--google-ads {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 230'%3E%3Cpath fill='%23fbbc04' d='M5.888 166.405L90.88 20.9c10.796 6.356 65.236 36.484 74.028 42.214L79.916 208.627c-9.295 12.28-85.804-23.587-74.028-42.23z'/%3E%3Cpath fill='%234285f4' d='M250.084 166.402L165.092 20.906C153.21 1.132 127.62-6.054 106.601 5.625S79.182 42.462 91.064 63.119l84.992 145.514c11.882 19.765 37.473 26.95 58.492 15.272c20.1-11.68 27.418-37.73 15.536-57.486z'/%3E%3Cellipse cx='42.664' cy='187.924' fill='%2334a853' rx='42.664' ry='41.604'/%3E%3C/svg%3E");
}

.logos--google-ads-main{
  display: inline-block;
  width: 30px;
  height: 25px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 230'%3E%3Cpath fill='%23fbbc04' d='M5.888 166.405L90.88 20.9c10.796 6.356 65.236 36.484 74.028 42.214L79.916 208.627c-9.295 12.28-85.804-23.587-74.028-42.23z'/%3E%3Cpath fill='%234285f4' d='M250.084 166.402L165.092 20.906C153.21 1.132 127.62-6.054 106.601 5.625S79.182 42.462 91.064 63.119l84.992 145.514c11.882 19.765 37.473 26.95 58.492 15.272c20.1-11.68 27.418-37.73 15.536-57.486z'/%3E%3Cellipse cx='42.664' cy='187.924' fill='%2334a853' rx='42.664' ry='41.604'/%3E%3C/svg%3E");
}




/* ---------- Panel / table ---------- */
.panel{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.panel-title{
  padding: 18px 24px;
  font-family:'Sora', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title-right{
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box{
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  width: 220px;
}
.search-box i{ color: var(--text-faint); font-size: 12px; }
.search-box input{
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  width: 100%;
}
.search-box input::placeholder{ color: var(--text-faint); }

.icon-btn{
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.icon-btn:hover{ color: var(--text); border-color: var(--text-dim); }
.icon-btn.active{ color: var(--text); border-color: var(--text-dim); background: var(--active-bg); }

.sync-info{
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-faint);
}

.btn-refresh{
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.btn-refresh:hover{ color: var(--text); border-color: var(--text-dim); }

.state-msg{
  padding: 36px 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}
.state-error{ color: #FF9494; }

table{
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
thead th{
  text-align: left;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-faint);
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th.num{ text-align: right; }
thead th.center{ text-align: center; }

tbody td{
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
tbody tr:last-child td{ border-bottom: none; }
tbody tr{ transition: background 0.15s ease; }
tbody tr:hover{ background: var(--active-bg); }

.acct-name{
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-id{
  font-size: 11.5px;
  color: var(--text-faint);
  font-family:'JetBrains Mono', monospace;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.balance{
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  text-align: right;
}

/* ---------- Status do saldo ---------- */
.status-badge{
  font-size: 12.5px;
  font-weight: 600;
}
.status-badge.baixo{ color: #FF6B6B; }
.status-badge.ok{ color: #3ECF8E; }

/* ---------- Toggle switch ---------- */
.toggle-cell{ text-align: center; }
.toggle-switch{
  position: relative;
  width: 38px;
  height: 21px;
  border-radius: 999px;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.toggle-switch::after{
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: left 0.15s ease, background 0.15s ease;
}
.toggle-switch.on{ background: #2E7D5B; }
.toggle-switch.on::after{ left: 19px; background: #fff; }
.toggle-switch:disabled{
  cursor: not-allowed;
  opacity: 0.4;
}
.toggle-switch:disabled::after{ background: var(--text-faint); }

.btn-boleto{
  background: var(--active-bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.btn-boleto:hover{ color: var(--text); border-color: var(--text-dim); }

/* ---------- Nome da conta clicável (abre o card de detalhes) ---------- */
.acct-name-clickable{
  cursor: pointer;
}
.acct-name-clickable:hover{
  text-decoration: underline;
}

/* ---------- Modal / card de detalhes da conta ---------- */
.modal-overlay{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open{ display: flex; }

.modal-card{
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
}

.modal-close{
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover{ color: var(--text); }

.modal-row{
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 14px;
}
.modal-label{
  font-weight: 600;
  margin-right: 6px;
}

.modal-toggles{
  display: flex;
  gap: 32px;
  margin: 22px 0 24px;
}
.modal-toggle-group{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-toggle-group .modal-label{ font-size: 12.5px; }

.btn-boleto-modal{
  width: 100%;
  padding: 10px 12px;
  font-size: 12.5px;
}

/* ---------- Linha de conta inativa (não-cliente ou sem tráfego) ---------- */
tr.row-inactive{ opacity: 0.42; }
tr.row-inactive:hover{ background: none; }
tr.row-inactive .acct-name,
tr.row-inactive .balance,
tr.row-inactive .status-badge{ color: var(--text-faint); }

.panel-pad{ height: 24px; }

@media (max-width: 780px){
  .sidebar{ display:none; }
  .main{ padding: 24px; }
}

@media (max-width: 640px){
  .panel-title{ flex-wrap: wrap; }
  .search-box{ width: 100%; order: 3; }
}

/* ---------- Tela de login ---------- */
.login-body{
  display: block;
  min-height: 100vh;
}
.login-wrap{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card{
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
}
.login-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.login-brand-mark{
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #7C6FFF, #4A3FCC);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.login-brand-name{
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 19px;
}
.login-sub{
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 26px;
}
.login-label{
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.login-input{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  margin-bottom: 18px;
  outline: none;
}
.login-input:focus{ border-color: #7C6FFF; }
.login-error{
  font-size: 12.5px;
  color: #FF6B6B;
  min-height: 16px;
  margin-bottom: 6px;
}
.login-btn{
  background: #7C6FFF;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
}
.login-btn:hover{ background: #6C5FE8; }
.login-btn:disabled{ opacity: 0.6; cursor: not-allowed; }

/* ---------- Botão de sair (usado no topo das páginas protegidas) ---------- */
.btn-logout{
  background: none;
  border: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.btn-logout:hover{ color: var(--text); border-color: var(--text-dim); }