@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-label:not(:first-child){
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.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); }
.nav-item i, .nav-item .plat-dot, .nav-item .logos--google-ads{ width: 15px; text-align: center; flex-shrink: 0; }

.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;
}

/* ---------- Tags exibidas na tabela e no modal ---------- */
.acct-tags{ display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag-pill{
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.5;
}
.tag-pill-add{
  background: var(--active-bg);
  color: var(--text-dim);
  border: 1px dashed var(--border);
  cursor: pointer;
}
.tag-pill-add:hover{ color: var(--text); border-color: var(--text-dim); }

.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; }
.status-badge.sem-referencia{ color: var(--text-faint); }

/* ---------- 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;
  max-height: 90vh;
  overflow-y: auto;
}

.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; }

/* ---------- Tags dentro do modal + popover de adicionar ---------- */
.modal-tags-row{ position: relative; margin-bottom: 18px; }
.modal-tags{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.tag-popover{
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  min-width: 180px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.tag-popover.open{ display: block; }
.tag-popover-item{
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
}
.tag-popover-item:hover{ background: var(--active-bg); }
.tag-popover-dot{ width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tag-popover-empty{ padding: 8px 9px; font-size: 12px; color: var(--text-faint); }

/* ---------- Caixa de anotação ---------- */
.modal-notes-group{ display: flex; flex-direction: column; gap: 8px; margin: 0 0 22px; }
.modal-notes-group .modal-label{ font-size: 12.5px; }
.modal-notes{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  min-height: 72px;
  resize: vertical;
  outline: none;
  width: 100%;
}
.modal-notes:focus{ border-color: #7C6FFF; }
.modal-notes-hint{ font-size: 11px; color: var(--text-faint); }

.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; }

/* ---------- Menu mobile (hambúrguer + sidebar deslizante) ---------- */
.mobile-topbar{ display: none; }
.mobile-nav-overlay{ display: none; }
.sidebar-close-btn{ display: none; }

@media (max-width: 780px){
  .mobile-topbar{
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--sidebar);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 150;
  }
  .hamburger-btn{
    background: none;
    border: none;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .hamburger-btn:hover{ background: var(--active-bg); }
  .mobile-topbar-title{ font-family:'Sora', sans-serif; font-weight: 700; font-size: 15px; }

  .sidebar{
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 250;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: 240px;
    display: flex;
    flex-direction: column;
  }
  .sidebar.open{ transform: translateX(0); }

  .sidebar-close-btn{
    display: flex;
    align-self: flex-end;
    background: none;
    border: none;
    color: var(--text-faint);
    font-size: 18px;
    cursor: pointer;
    margin-bottom: 10px;
  }
  .sidebar-close-btn:hover{ color: var(--text); }

  .mobile-nav-overlay.open{
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
  }

  .main{ padding: 16px; }

  body{ flex-direction: column; }
}

@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-logo{
  display: block;
  max-width: 300px;
  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); }

/* ================= Tela de Tags ================= */

.btn-primary{
  background: #7C6FFF;
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover{ background: #6C5FE8; }

.tag-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.tag-row:last-child{ border-bottom: none; }
.tag-row-left{ display: flex; align-items: center; gap: 12px; }
.tag-dot{ width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.tag-name{ font-size: 13.5px; font-weight: 600; color: var(--text); }
.tag-count{ font-size: 12px; color: var(--text-faint); margin-left: 4px; }

.tag-row-actions{ display: flex; align-items: center; gap: 8px; }
.icon-btn-sm{
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.icon-btn-sm:hover{ color: var(--text); border-color: var(--text-dim); }
.icon-btn-sm.danger:hover{ color: #FF6B6B; border-color: #FF6B6B; }

/* ---------- Modal de criar/editar tag ---------- */
.modal-title{ font-family:'Sora', sans-serif; font-size: 16px; font-weight: 700; margin: 0 0 20px; }

.form-label{ font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; display: block; }
.form-input{
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  margin-bottom: 18px;
  outline: none;
}
.form-input:focus{ border-color: #7C6FFF; }
.form-error{ font-size: 12px; color: #FF6B6B; margin: -12px 0 14px; min-height: 14px; }

.modal-orcamento-input{
  width: 130px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 9px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  margin-left: 6px;
}
.modal-orcamento-input:focus{ border-color: #7C6FFF; }
.modal-orcamento-hint{ font-size: 10.5px; color: var(--text-faint); margin-left: 8px; }

.color-picker-row{ display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.color-swatch-input{
  width: 42px; height: 42px; border-radius: 8px; border: 1px solid var(--border);
  background: none; cursor: pointer; padding: 2px;
}
.color-presets{ display: flex; gap: 6px; flex-wrap: wrap; }
.color-preset{
  width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid transparent;
}
.color-preset.selected{ border-color: var(--text); }

.modal-actions{ display: flex; gap: 10px; }
.btn-secondary{
  flex: 1;
  background: var(--active-bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.modal-actions .btn-primary{ flex: 1; justify-content: center; }

/* ---------- Modal: contas vinculadas a uma tag ---------- */
.modal-card.wide{ max-width: 440px; padding: 0; }
.modal-card.wide .modal-close{ color: var(--text-dim); }
.accounts-modal-header{
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.accounts-modal-dot{ width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.accounts-modal-title{ font-family:'Sora', sans-serif; font-size: 15px; font-weight: 700; }
.accounts-modal-sub{ font-size: 12px; color: var(--text-faint); margin-top: 2px; }

.accounts-list{ max-height: 340px; overflow-y: auto; }
.account-item{
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 28px; border-bottom: 1px solid var(--border);
}
.account-item:last-child{ border-bottom: none; }
.account-item-name{ font-size: 13px; font-weight: 600; color: var(--text); }
.account-item-id{ font-size: 11px; color: var(--text-faint); font-family:'JetBrains Mono', monospace; margin-top: 2px; }
.account-item-balance{ font-size: 13px; font-weight: 600; color: var(--text); font-family:'JetBrains Mono', monospace; }
.account-item-remove{
  background: none; border: none; color: var(--text-faint); cursor: pointer;
  font-size: 12px; padding: 6px; margin-left: 10px;
}
.account-item-remove:hover{ color: #FF6B6B; }
.account-item-left{ display: flex; align-items: center; gap: 12px; }
.account-item-right{ display: flex; align-items: center; }

/* ================= Tela de Tarefas ================= */

.layout{ display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px){ .layout{ grid-template-columns: 1fr; } }

.cal-nav{ display:flex; align-items:center; gap: 10px; }
.cal-nav-btn{
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
  display:flex; align-items:center; justify-content:center; font-size: 10px;
}
.cal-nav-btn:hover{ color: var(--text); border-color: var(--text-dim); }
.cal-month-label{ font-size: 13px; }

.cal-body{ padding: 16px 18px 20px; }
.cal-dow{ display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 6px; }
.cal-dow span{ text-align: center; font-size: 10px; color: var(--text-faint); font-weight: 600; }
.cal-grid{ display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-day{
  aspect-ratio: 1; border-radius: 8px; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-dim); cursor: pointer; position: relative;
  border: 1px solid transparent;
}
.cal-day:hover{ border-color: var(--border); }
.cal-day.empty{ background: transparent; cursor: default; }
.cal-day.today{ font-weight: 700; color: var(--text); }
.cal-day.selected{ background: #7C6FFF; color: #fff; }
.cal-day-dots{ display: flex; align-items: center; gap: 3px; margin-top: 3px; }
.cal-day-dot{ width: 4px; height: 4px; border-radius: 50%; background: #7C6FFF; margin-top: 0; }
.cal-day-dot-google{ width: 4px; height: 4px; border-radius: 50%; background: #4285F4; }
.cal-day.selected .cal-day-dot{ background: #fff; }
.cal-day.selected .cal-day-dot-google{ background: #fff; }

/* ---------- Checkbox "Mostrar eventos do Google Agenda" ---------- */
.google-agenda-toggle{
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-dim);
  cursor: pointer; user-select: none;
}
.google-agenda-toggle input[type="checkbox"]{
  width: 15px; height: 15px; accent-color: #4285F4; cursor: pointer;
}
.google-agenda-toggle:hover{ color: var(--text); }

/* ---------- Eventos do Google Agenda, dentro da visão Dia ---------- */
.google-event-row{ opacity: 0.92; }
.google-event-icon{
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(66, 133, 244, 0.15); color: #4285F4; font-size: 11px;
}
.google-event-badge{
  font-size: 10px; font-weight: 600; color: #4285F4;
  background: rgba(66, 133, 244, 0.12); padding: 2px 7px; border-radius: 999px;
}
.google-event-time{ font-size: 11px; color: var(--text-faint); }

/* ---------- Eventos do Google Agenda, dentro da visão Semana ---------- */
.week-task-google{ cursor: default; opacity: 0.92; }
.week-task-priority-bar.google{ background: #4285F4; }

.cal-legend{ padding: 12px 18px 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-faint); display: flex; align-items: center; gap: 6px; }
.cal-legend-dot{ width: 6px; height: 6px; border-radius: 50%; background: #7C6FFF; }

.month-summary{ padding: 14px 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.month-summary-row{ display: flex; justify-content: space-between; font-size: 12px; }
.month-summary-row span:first-child{ color: var(--text-dim); }
.month-summary-row span:last-child{ font-weight: 600; }
.month-summary-row .overdue{ color: #FF6B6B; }

.day-panel-title-left{ display: flex; flex-direction: column; }
.day-panel-date{ font-size: 15px; }
.day-panel-count{ font-size: 11.5px; color: var(--text-faint); font-weight: 400; margin-top: 2px; }

.quick-add{ display: flex; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.quick-add input{
  flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; color: var(--text); font-family: inherit; font-size: 13px; outline: none;
}
.quick-add input:focus{ border-color: #7C6FFF; }
.quick-add button{
  background: var(--active-bg); border: 1px solid var(--border); color: var(--text-dim);
  padding: 0 14px; border-radius: 8px; font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.quick-add button:hover{ color: var(--text); border-color: var(--text-dim); }

.task-row{ display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.task-row:last-child{ border-bottom: none; }
.task-checkbox{
  width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border);
  background: var(--bg); cursor: pointer; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; font-size: 10px; color: transparent;
}
.task-checkbox.done{ background: #3ECF8E; border-color: #3ECF8E; color: #0B0E17; }
.task-body{ flex: 1; min-width: 0; }
.task-title{ font-size: 13px; font-weight: 600; color: var(--text); }
.task-title.done{ color: var(--text-faint); text-decoration: line-through; }
.task-meta{ display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.task-account-chip{
  display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 500;
  color: var(--text-dim); background: var(--active-bg); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 999px;
}
.priority-badge{ font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; }
.priority-badge.alta{ background: #FF6B6B22; color: #FF6B6B; }
.priority-badge.media{ background: #F5A62322; color: #F5A623; }
.priority-badge.baixa{ background: #3ECF8E22; color: #3ECF8E; }
.task-row-actions{ display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.priority-select{ display: flex; gap: 8px; margin-bottom: 18px; }
.priority-option{
  flex: 1; text-align: center; padding: 8px; border-radius: 8px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); cursor: pointer; color: var(--text-dim);
}
.priority-option.selected.alta{ background: #FF6B6B22; border-color: #FF6B6B; color: #FF6B6B; }
.priority-option.selected.media{ background: #F5A62322; border-color: #F5A623; color: #F5A623; }
.priority-option.selected.baixa{ background: #3ECF8E22; border-color: #3ECF8E; color: #3ECF8E; }

/* ---------- Abas Dia / Semana ---------- */
.view-tabs{ display: flex; gap: 4px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.view-tab{ padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text-dim); cursor: pointer; }
.view-tab.active{ background: var(--active-bg); color: var(--text); }

.cal-day.in-week{ background: var(--active-bg); }

/* ---------- Visualização Semana ---------- */
.week-range{ font-size: 12px; color: var(--text-faint); padding: 14px 20px; border-bottom: 1px solid var(--border); }

.week-grid{ display: grid; grid-template-columns: repeat(7, 1fr); }
.week-col{ border-right: 1px solid var(--border); min-height: 240px; display: flex; flex-direction: column; }
.week-col:last-child{ border-right: none; }
.week-col.today-col{ background: rgba(124, 111, 255, 0.06); }

.week-col-header{ padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--border); }
.week-col-dow{ font-size: 9.5px; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.week-col-day{ font-size: 15px; font-weight: 700; margin-top: 2px; }
.week-col-day.today{ color: #7C6FFF; }

.week-col-tasks{ padding: 8px 6px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.week-task{
  background: var(--bg); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 8px; font-size: 11px; cursor: pointer; position: relative; padding-left: 12px;
}
.week-task.done{ opacity: 0.45; }
.week-task-title{ font-weight: 600; color: var(--text); line-height: 1.3; }
.week-task.done .week-task-title{ text-decoration: line-through; }
.week-task-account{ font-size: 9.5px; color: var(--text-faint); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-task-priority-bar{ position: absolute; top: 0; left: 0; bottom: 0; width: 3px; border-radius: 7px 0 0 7px; }
.week-task-priority-bar.alta{ background: #FF6B6B; }
.week-task-priority-bar.media{ background: #F5A623; }
.week-task-priority-bar.baixa{ background: #3ECF8E; }

.week-col-add{
  border: none; background: none; color: var(--text-faint); font-size: 11px;
  padding: 6px 8px; cursor: pointer; text-align: left; margin-top: auto; font-family: inherit;
}
.week-col-add:hover{ color: var(--text-dim); }

@media (max-width: 900px){
  .week-grid{ grid-template-columns: repeat(7, minmax(110px, 1fr)); overflow-x: auto; }
}

/* ================= Campanhas ativas ================= */

/* ---------- Chip na tabela ---------- */
.campaigns-chip{
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; margin-top: 6px;
  color: var(--text-dim);
}
.campaigns-chip .dot{ width: 6px; height: 6px; border-radius: 50%; background: #3ECF8E; }
.campaigns-chip.zero{ color: var(--text-faint); }
.campaigns-chip.zero .dot{ background: var(--text-faint); }

/* ---------- Seção no modal ---------- */
.campaigns-section{ margin: 20px 0; }
.campaigns-section-title{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.campaigns-section-title span:first-child{ font-weight: 600; font-size: 12.5px; color: var(--text-dim); }
.campaigns-section-title .updated-at{ font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }

#modal-campaigns-list{
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
/* Scrollbar mais discreta, combinando com o tema escuro */
#modal-campaigns-list::-webkit-scrollbar{ width: 6px; }
#modal-campaigns-list::-webkit-scrollbar-track{ background: transparent; }
#modal-campaigns-list::-webkit-scrollbar-thumb{ background: var(--border); border-radius: 999px; }
#modal-campaigns-list::-webkit-scrollbar-thumb:hover{ background: var(--text-faint); }

.campaign-item{
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--border); margin-bottom: 6px; font-size: 12.5px;
}
.campaign-status-dot{ width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.campaign-status-dot.active{ background: #3ECF8E; }
.campaign-name{ flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campaign-objective{
  font-size: 9.5px; color: var(--text-faint); background: var(--active-bg);
  padding: 2px 7px; border-radius: 999px; flex-shrink: 0;
}

.campaigns-empty{ font-size: 12px; color: var(--text-faint); padding: 12px 0; text-align: center; }

/* ================= Tela de Anotações (sistema unificado, com histórico) ================= */

.form-select, .form-textarea{
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  margin-bottom: 18px;
  outline: none;
}
.form-select:focus, .form-textarea:focus{ border-color: #7C6FFF; }
.form-textarea{ min-height: 90px; resize: vertical; }

.pauta-row{ padding: 16px 24px; border-bottom: 1px solid var(--border); }
.pauta-row:last-child{ border-bottom: none; }
.pauta-header{ display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.pauta-title-group{ display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pauta-titulo{ font-size: 13.5px; font-weight: 700; color: var(--text); overflow-wrap: break-word; word-break: break-word; }
.pauta-conta-chip{
  display: inline-flex; align-items: center; gap: 5px; width: fit-content;
  font-size: 10.5px; font-weight: 500; color: var(--text-dim);
  background: var(--active-bg); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px;
}
.pauta-data{ font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }
.pauta-texto{ font-size: 12.5px; color: var(--text-dim); line-height: 1.5; white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word; }
.pauta-remove{ background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 11px; padding: 4px; }
.pauta-remove:hover{ color: #FF6B6B; }

/* ---------- Histórico de anotações dentro do modal do Meta Ads ---------- */
.notes-section{ margin: 0 0 20px; }
.notes-section-header{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.notes-section-header span{ font-weight: 600; font-size: 12.5px; color: var(--text-dim); }
.btn-small{
  background: var(--active-bg); border: 1px solid var(--border); color: var(--text-dim);
  padding: 5px 10px; border-radius: 7px; font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
}
.btn-small:hover{ color: var(--text); border-color: var(--text-dim); }

.note-form{ margin-bottom: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.note-form input, .note-form textarea{
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
  padding: 8px 9px; color: var(--text); font-family: inherit; font-size: 12.5px; margin-bottom: 8px; outline: none;
}
.note-form textarea{ min-height: 60px; resize: vertical; }
.note-form input:focus, .note-form textarea:focus{ border-color: #7C6FFF; }
.note-form-actions{ display: flex; gap: 6px; }
.note-form-actions button{
  flex: 1; padding: 7px; border-radius: 7px; font-family: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; border: none;
}
.note-form-save{ background: #7C6FFF; color: #fff; }
.note-form-cancel{ background: var(--active-bg); border: 1px solid var(--border) !important; color: var(--text); }

.notes-history{ max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding-right: 4px; }
.notes-history::-webkit-scrollbar{ width: 6px; }
.notes-history::-webkit-scrollbar-track{ background: transparent; }
.notes-history::-webkit-scrollbar-thumb{ background: var(--border); border-radius: 999px; }

.note-entry{ background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; position: relative; }
.note-entry-header{ display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; padding-right: 44px; }
.note-entry-title{ font-size: 12px; font-weight: 700; color: var(--text); overflow-wrap: break-word; word-break: break-word; min-width: 0; }
.note-entry-date{ font-size: 10px; color: var(--text-faint); white-space: nowrap; }
.note-entry-text{ font-size: 11.5px; color: var(--text-dim); line-height: 1.4; white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word; }

.note-entry-actions{
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 2px;
  opacity: 0; transition: opacity 0.1s;
}
.note-entry:hover .note-entry-actions{ opacity: 1; }
.note-entry-remove{
  background: none; border: none; color: var(--text-faint);
  cursor: pointer; font-size: 10px; padding: 4px;
}
.note-entry-remove:hover{ color: #FF6B6B; }
.note-entry-actions button:first-child:hover{ color: #7C6FFF; }

.notes-empty{ font-size: 11.5px; color: var(--text-faint); text-align: center; padding: 16px 0; }

/* ================= Cartões de conta (Meta Ads no mobile) ================= */

.contas-cards-mobile{ display: none; }

@media (max-width: 780px){
  table{ display: none; }
  .contas-cards-mobile{ display: block; padding: 12px; }
}

.acct-card{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.acct-card.row-inactive{ opacity: 0.5; }
.acct-card-top{ display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.acct-card-name{ font-size: 14px; font-weight: 700; color: var(--text); overflow-wrap: break-word; }
.acct-card-id{ font-size: 10.5px; color: var(--text-faint); font-family:'JetBrains Mono', monospace; margin-top: 2px; }

.acct-card-balance{
  font-family:'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 8px 0 10px;
}

.acct-card-toggles{ display: flex; flex-direction: column; gap: 8px; }
.acct-card-toggle-row{ display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-dim); }

.acct-card-footer{ display: flex; gap: 8px; margin-top: 12px; }

.acct-card-subrow{
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: -4px;
}
.acct-card-footer .btn-boleto{ flex: 1; text-align: center; }
