*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:        #050505;
  --bg2:       #0f0f0f;
  --bg3:       #0a0a0a;
  --bg4:       #141414;
  --bg5:       #1a1a1a;
  --border:    #222;
  --border2:   #1a1a1a;

  --text:      #f5f5f5;
  --text-2:    #92989d;
  --text-3:    #525252;

  --accent-from: #2563eb;
  --accent-to:   #06b6d4;
  --accent-grad: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  --blue-1:    #2563eb;
  --blue-2:    #3b82f6;
  --blue-3:    #60a5fa;
  --cyan-1:    #06b6d4;
  --cyan-2:    #22d3ee;

  --green:     #22c55e;
  --green-2:   #4ade80;
  --red:       #ef4444;
  --red-2:     #f87171;
  --yellow:    #fbbf24;

  --glow:      rgba(37,99,235,0.3);
  --badge-bg:  rgba(37,99,235,0.12);

  --sidebar-w: 210px;
  --radius:    10px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 10;
  overflow: hidden;
}

.logo {
  padding: 22px 20px 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 1px solid var(--border);
}

nav { padding: 12px 10px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: color .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  bottom: 50%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-grad);
  transition: top .22s ease, bottom .22s ease;
}

.nav-item:hover {
  background: var(--bg4);
  color: var(--text);
  border-color: var(--border);
  box-shadow: inset 0 0 20px rgba(37,99,235,.04);
}

.nav-item:hover::before {
  top: 7px;
  bottom: 7px;
}

.nav-item.active {
  background: var(--badge-bg);
  color: var(--blue-3);
  border-color: rgba(37,99,235,0.25);
}

.nav-item.active::before {
  top: 7px;
  bottom: 7px;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 14px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 16px 8px;
}

.sidebar-accounts {
  padding: 0 10px;
  overflow-y: auto;
  flex: 1;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.btn-logout {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
  text-align: left;
}

.btn-logout:hover {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.2);
  color: #f87171;
}

.sidebar-account-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 1px;
  transition: color .22s ease, background .22s ease, box-shadow .22s ease;
  position: relative;
  overflow: hidden;
}

.sidebar-account-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  bottom: 50%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-grad);
  transition: top .22s ease, bottom .22s ease;
  opacity: .5;
}

.sidebar-account-btn:hover {
  background: var(--bg4);
  color: var(--text-2);
  box-shadow: inset 0 0 16px rgba(37,99,235,.04);
}

.sidebar-account-btn:hover::before {
  top: 6px;
  bottom: 6px;
}

.sidebar-account-btn.active {
  background: var(--bg4);
  color: var(--text);
}

.sidebar-account-btn.active::before {
  top: 6px;
  bottom: 6px;
  opacity: 1;
}

.sidebar-account-btn .acct-id {
  font-size: 10.5px;
  color: #92989d;
  display: block;
  margin-top: 1px;
  font-family: monospace;
}

/* ── Content ── */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px 36px;
  min-width: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
}

.updated-at {
  font-size: 11px;
  color: #92989d;
  display: block;
  margin-top: 4px;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--blue-1);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, box-shadow .15s;
  letter-spacing: .2px;
  white-space: nowrap;
}

.btn-primary:hover {
  opacity: .9;
  box-shadow: 0 0 18px var(--glow);
}

.btn-primary:disabled {
  opacity: .3;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: linear-gradient(135deg, #06b6d4 0%, #22c55e 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-secondary:hover {
  opacity: .9;
  box-shadow: 0 0 18px rgba(6,182,212,.3);
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-full { width: 100%; padding: 12px; margin-top: 6px; }

.btn-danger {
  background: transparent;
  border: 1px solid rgba(239,68,68,.35);
  color: var(--red-2);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
}

.btn-danger:hover {
  background: rgba(239,68,68,.1);
  border-color: var(--red);
}

.btn-go {
  flex: 1;
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
  text-decoration: none;
  text-align: center;
  display: block;
}

.btn-go:hover {
  border-color: rgba(37,99,235,.5);
  color: var(--blue-3);
  box-shadow: 0 0 12px var(--glow);
}

/* ── Account cards ── */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.empty-state {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  gap: 10px;
}
.empty-icon  { font-size: 36px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-2); }
.empty-desc  { font-size: 13px; color: #92989d; text-align: center; }

.account-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.account-card:hover {
  border-color: rgba(37,99,235,.3);
  box-shadow: 0 4px 24px rgba(37,99,235,.1), 0 0 0 1px rgba(37,99,235,.08);
  transform: translateY(-2px);
}

.account-card-top {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.account-avatar {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--badge-bg);
  border: 1px solid rgba(37,99,235,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-3);
  flex-shrink: 0;
}

.account-info { flex: 1; min-width: 0; }

.btn-rename-card {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg4);
  border: 1px solid rgba(37,99,235,.35);
  color: var(--blue-3);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, box-shadow .15s, border-color .15s;
  box-shadow: 0 0 8px rgba(37,99,235,.2);
}
.account-card:hover .btn-rename-card { opacity: 1; }
.btn-rename-card:hover {
  border-color: rgba(37,99,235,.7);
  box-shadow: 0 0 14px rgba(37,99,235,.4);
}

.sidebar-acct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.btn-rename-sidebar {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  transition: opacity .15s, color .15s;
  flex-shrink: 0;
  line-height: 1;
}
.sidebar-account-btn:hover .btn-rename-sidebar { opacity: 1; }
.btn-rename-sidebar:hover { color: var(--blue-3); }

.account-info h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.acct-corp {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-id {
  font-size: 11px;
  color: #92989d;
  font-family: monospace;
}

.account-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-action {
  display: block;
  width: 100%;
  text-align: center;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-action-primary {
  background: var(--badge-bg);
  border-color: rgba(37,99,235,.25);
  color: var(--blue-3);
}
.btn-action-primary:hover {
  background: rgba(37,99,235,.2);
  box-shadow: 0 0 12px var(--glow);
}

.btn-action-ghost {
  background: var(--bg4);
  border-color: var(--border);
  color: var(--text-2);
}
.btn-action-ghost:hover { color: var(--text); border-color: var(--bg5); }

.btn-action-danger {
  background: transparent;
  border-color: rgba(239,68,68,.2);
  color: var(--text-3);
}
.btn-action-danger:hover {
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.4);
  color: var(--red-2);
}

/* ── Metric cards ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .2s;
}

.metric-card:hover { border-color: var(--bg5); }

.metric-card .label {
  font-size: 11px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 600;
  margin-bottom: 10px;
}

.metric-card .value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.5px;
  line-height: 1;
}

.metric-card .value.green  { color: var(--green); }
.metric-card .value.red    { color: var(--red); }
.metric-card .value.yellow { color: var(--yellow); }
.metric-card .value.cyan   { color: var(--cyan-2); }
.metric-card .value.blue   {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metric-card .sub {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 6px;
}

.metric-card .sub.red  { color: var(--red-2); }

/* ── Alerts ── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #92989d;
  margin-bottom: 12px;
}

.alerts-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.alert-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-item.alert-red   { border-left-color: var(--red); }
.alert-item.alert-green { border-left-color: var(--green); }
.alert-item.alert-blue  { border-left-color: var(--blue-2); }

.alert-icon { font-size: 16px; flex-shrink: 0; }

.alert-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
}

.alert-text strong { color: var(--text); }

/* ── Table ── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border2);
  font-size: 13px;
}

th {
  color: #a3a3a3;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-size: 10px;
  background: var(--bg2);
}

tbody tr:hover td { background: var(--bg4); }
td { color: var(--text-2); }
td:first-child { color: var(--text); }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(3px);
}

.modal.hidden { display: none; }

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 500px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 15px; font-weight: 600; }

.modal-close {
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.modal-close:hover { color: var(--text); border-color: var(--bg5); }

.modal-body { padding: 22px; }

.tutorial {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.tutorial strong { color: var(--text); }
.tutorial ol { padding-left: 16px; margin-top: 8px; }
.tutorial li { margin-bottom: 3px; }

.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  margin-bottom: 6px;
  color: var(--text-2);
  text-transform: uppercase;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 13px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-3); }

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-1);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--bg3) inset;
  -webkit-text-fill-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}

.error-msg {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.25);
  color: var(--red-2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.error-msg.hidden { display: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--badge-bg);
  color: var(--blue-3);
  border: 1px solid rgba(37,99,235,.2);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}

.badge.green {
  background: rgba(34,197,94,.1);
  color: var(--green-2);
  border-color: rgba(34,197,94,.2);
}

.badge.red {
  background: rgba(239,68,68,.1);
  color: var(--red-2);
  border-color: rgba(239,68,68,.2);
}

.badge.yellow {
  background: rgba(251,191,36,.1);
  color: var(--yellow);
  border-color: rgba(251,191,36,.2);
}

/* ── Misc ── */
.loading, .placeholder {
  color: var(--text-3);
  padding: 48px;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
}

.hidden { display: none !important; }

/* ── Modal 2 passos ── */
.step2-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-back {
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 7px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-back:hover { color: var(--text); border-color: var(--bg5); }

.agent-name {
  font-size: 12px;
  color: #92989d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step2-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 14px;
}

.accounts-check-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-height: 320px;
  overflow-y: auto;
}

.account-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s;
}

.account-check-item:hover:not(.already-added) { border-color: rgba(37,99,235,.4); }
.account-check-item.already-added { opacity: .55; cursor: default; }

.account-check-item input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-1);
  flex-shrink: 0;
  cursor: pointer;
}

.check-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.check-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.check-corp {
  font-size: 11px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-id {
  font-size: 11px;
  color: #92989d;
}

/* ── Misc ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg5); }

/* ── Dashboard layout ── */
.dash-top {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 14px;
  margin-bottom: 14px;
}

.dash-overview-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px 26px;
}

.dash-corp-name {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 20px;
}

.dash-stats-bar {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.dash-stat {
  flex: 1;
  padding-right: 28px;
}

.dash-stat + .dash-stat {
  padding-left: 28px;
  padding-right: 28px;
  border-left: 1px solid var(--border2);
}

.dash-stat:last-child { padding-right: 0; }

.dash-stat-label {
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .7px;
  font-weight: 600;
  margin-bottom: 10px;
}

.dash-stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.5px;
  line-height: 1;
}

.dash-stat-value.green  { color: var(--green); }
.dash-stat-value.red    { color: var(--red-2); }
.dash-stat-value.yellow { color: var(--yellow); }

.dash-stat-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 5px;
}

/* ADS AO VIVO */
.dash-ads-live {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px;
}

.ads-live-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}

.ads-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: livepulse 2.2s ease-in-out infinite;
}

@keyframes livepulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green); }
  50%       { opacity: .35; box-shadow: none; }
}

.ads-live-title-text {
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--text-3);
}

.ads-live-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ads-live-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
}

.ads-live-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.ads-live-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ads-live-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ads-live-label {
  font-size: 12px;
  color: var(--text-2);
}

.ads-live-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.5px;
  line-height: 1;
}

.ads-live-value.green { color: var(--green); }
.ads-live-value.red   { color: var(--red-2); }

.ads-live-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  transition: border-color .15s;
}

.ads-live-toggle:hover { border-color: rgba(37,99,235,.4); }

.ads-live-toggle-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-2);
}

/* Stats atuais */
.dash-bottom-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 20px;
}

.dash-bottom-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 18px;
}

.dash-bottom-stats {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.dash-bottom-stat {
  flex: 1;
  padding-right: 28px;
}

.dash-bottom-stat + .dash-bottom-stat {
  padding-left: 28px;
  padding-right: 28px;
  border-left: 1px solid var(--border2);
}

.dash-bottom-stat:last-child { padding-right: 0; }

.dash-bottom-stat-label {
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 600;
  margin-bottom: 8px;
}

.dash-bottom-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
}

/* ── Campaign sub-tabs ── */
.camp-sub-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  padding-bottom: 10px;
}

.camp-sub-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 20px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
  white-space: nowrap;
}

.camp-sub-tab:hover { color: var(--text-2); }
.camp-sub-tab.active { color: var(--text); border-bottom-color: var(--text-2); font-weight: 600; }

/* ── Column visibility filter ── */
.col-filter-wrap { position: relative; }

.col-filter-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-2);
  font-size: 12px;
  padding: 0 10px;
  cursor: pointer;
  height: 30px;
  font-family: inherit;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.col-filter-btn:hover { border-color: var(--blue-1); color: var(--text); }

.col-filter-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  min-width: 175px;
  z-index: 50;
  box-shadow: 0 8px 28px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.col-filter-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 4px;
}
.col-filter-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  transition: background .12s, color .12s;
}
.col-filter-item:hover { background: var(--bg4); color: var(--text); }
.col-filter-item input[type=checkbox] {
  width: 14px;
  height: 14px;
  accent-color: var(--blue-1);
  cursor: pointer;
  flex-shrink: 0;
}

/* Ghost filler column (absorbs remaining table width) */
.col-ghost { padding: 0 !important; border: none !important; }

/* Hidden column (via visibility filter) */
.col-hidden { display: none !important; }

/* Filtros embutidos na linha de tabs */
.camp-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-bottom: 1px;
}

.camp-filter-select,
.camp-filter-date {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-2);
  font-size: 12px;
  padding: 5px 9px;
  cursor: pointer;
  transition: border-color .15s;
  font-family: inherit;
  height: 30px;
}

.camp-filter-select:focus,
.camp-filter-date:focus {
  outline: none;
  border-color: var(--blue-1);
}

.camp-filter-arrow { color: var(--text-3); font-size: 11px; }

/* ── Campaigns table ── */
.camp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.camp-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.camp-table thead tr {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}

.camp-table th {
  padding: 11px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-3);
  text-align: left;
  white-space: nowrap;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Column resize handle ── */
.col-resize {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 2;
}
.col-resize::after {
  content: '';
  position: absolute;
  right: 1px;
  top: 18%;
  bottom: 18%;
  width: 2px;
  border-radius: 2px;
  background: var(--border);
  transition: background .15s;
}
.col-resize:hover::after,
.col-resize.resizing::after {
  background: var(--blue-2);
}

.camp-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
}

.camp-table tbody tr { background: var(--bg2); transition: background .15s; }
.camp-table tbody tr:last-child td { border-bottom: none; }
.camp-table tbody tr:hover td { background: var(--bg4); }

.camp-name { min-width: 0; }
.camp-name-text {
  display: block;
  color: var(--text);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.camp-meta {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.camp-num { text-align: left; font-variant-numeric: tabular-nums; white-space: nowrap; }
.camp-red { color: var(--red-2) !important; font-weight: 600; }
.camp-total-row td { background: rgba(255,255,255,0.04); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.camp-status-cell { text-align: center; }

/* ── Status filter ── */
.sf-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sf-arrow { font-size: 10px; opacity: .4; margin-left: 2px; }
.sf-lbl { font-weight: 700; }
.sf-lbl-green { color: var(--green-2); }
.sf-lbl-red   { color: var(--red-2); }
.sf-lbl-gray  { color: var(--text-3); }
.sf-th-inner { display: inline-flex; align-items: center; gap: 5px; }
.sf-clear { font-weight: 700; cursor: pointer; opacity: .6; line-height: 1; }
.sf-clear:hover { opacity: 1; }
.sf-popup {
  position: fixed; z-index: 9000;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px;
  min-width: 130px;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
}
.sf-option {
  padding: 9px 14px; cursor: pointer; border-radius: 6px;
  font-size: 13px; color: var(--text-2);
}
.sf-option:hover { background: var(--bg5); color: var(--text); }
.sf-option-active { color: var(--blue-3); font-weight: 600; }

.camp-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
}
.camp-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.camp-status-ativo      { background: rgba(34,197,94,.1);  color: var(--green-2); }
.camp-status-ativo::before   { background: var(--green); box-shadow: 0 0 4px var(--green); }
.camp-status-pausado    { background: rgba(251,191,36,.1); color: var(--yellow); }
.camp-status-pausado::before { background: var(--yellow); }
.camp-status-inativo    { background: var(--bg4); color: var(--text-3); }
.camp-status-inativo::before { background: var(--text-3); }
.camp-status-reprovado  { background: rgba(239,68,68,.1);  color: var(--red-2); }
.camp-status-reprovado::before { background: var(--red); }
.camp-status-rejeitado  { background: rgba(239,68,68,.15); color: #f87171; font-weight: 600; cursor: pointer; }
.camp-status-rejeitado::before { background: #ef4444; }
.camp-status-rejeitado:hover { background: rgba(239,68,68,.28); }

/* ── Reject detail modal ── */
.reject-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.reject-modal.hidden { display: none; }
.reject-modal-box {
  position: relative;
  width: min(520px, 94vw);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.reject-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
  padding-right: 28px;
}
.reject-modal-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 16px;
}
.reject-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg3);
  border: none;
  color: var(--text-2);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reject-modal-close:hover { background: var(--bg4); color: var(--text-1); }
.reject-review-item {
  background: rgba(239,68,68,.07);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.reject-review-item:last-child { margin-bottom: 0; }
.reject-review-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.reject-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; flex-shrink: 0; }
.reject-review-status { font-size: 13px; font-weight: 600; color: #f87171; }
.reject-review-time { font-size: 12px; color: var(--text-3); margin-left: auto; }
.reject-review-reason { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.reject-modal-loading { text-align: center; padding: 28px 0; color: var(--text-3); font-size: 14px; }
.reject-modal-error { text-align: center; padding: 28px 0; color: #f87171; font-size: 14px; }

/* Hide resize handle on the last (auto-stretch) column */
.col-last .col-resize { pointer-events: none; cursor: default; }
.col-last .col-resize::after { display: none; }

/* ── Creative thumbnail ── */
.creative-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  background: var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.creative-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  transition: opacity .15s;
}

.creative-thumb:hover img { opacity: .7; }

.creative-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transition: opacity .15s;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

.creative-thumb:hover .creative-play { opacity: 1; }

.creative-thumb-empty {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--bg4);
  border: 1px solid var(--border);
}

/* ── Video modal ── */
.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.video-modal.hidden { display: none; }

.video-modal-box {
  position: relative;
  max-width: 420px;
  width: 92vw;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
}

.video-modal-box video {
  display: block;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  background: #000;
}

.video-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,.6);
  border: none;
  color: #fff;
  font-size: 15px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background .15s;
}

.video-modal-close:hover { background: rgba(0,0,0,.85); }

/* ── Notifications tab ── */
.notif-layout { display: grid; grid-template-columns: 360px 1fr; gap: 16px; padding: 8px 0; align-items: start; }
@media (max-width: 900px) { .notif-layout { grid-template-columns: 1fr; } }

.notif-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 14px; }
.notif-card-title { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 14px; letter-spacing: .03em; }
.notif-history-card { margin-bottom: 0; }

.notif-wa-status { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.notif-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.notif-dot.green  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.notif-dot.yellow { background: var(--yellow); }
.notif-dot.red    { background: #ef4444; }

.notif-wa-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.notif-qr-wrap { text-align: center; margin-bottom: 14px; }
.notif-qr-hint { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.notif-qr-img  { width: 200px; height: 200px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }

.notif-input { background: var(--bg3); border: 1px solid var(--border); border-radius: 7px; color: var(--text-1); font-size: 13px; padding: 7px 10px; width: 100%; box-sizing: border-box; margin-top: 5px; }
.notif-input:focus { outline: none; border-color: var(--accent); }
.notif-label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 10px; }

.notif-hint { font-size: 12px; color: var(--text-3); margin-bottom: 12px; line-height: 1.5; }

.notif-group-row { display: flex; gap: 8px; align-items: flex-end; }
.notif-group-row .notif-input { flex: 1; margin-top: 0; }

.notif-groups-list { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; max-height: 180px; overflow-y: auto; }
.notif-group-item { padding: 9px 12px; font-size: 13px; color: var(--text-1); cursor: pointer; border-bottom: 1px solid var(--border); }
.notif-group-item:last-child { border-bottom: none; }
.notif-group-item:hover { background: var(--bg4); }
.notif-group-item small { color: var(--text-3); font-size: 11px; display: block; }

.notif-toggle-row { display: flex; align-items: center; margin: 14px 0 16px; }
.notif-toggle-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-1); cursor: pointer; }
.notif-toggle-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.notif-btns-row { display: flex; gap: 8px; flex-wrap: wrap; }

.notif-history-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.notif-history-item:last-child { border-bottom: none; }
.notif-history-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.notif-history-type { font-size: 11px; font-weight: 600; color: #f87171; background: rgba(239,68,68,.12); border-radius: 4px; padding: 2px 7px; }
.notif-history-account { font-size: 11px; color: var(--text-3); }
.notif-history-time { font-size: 11px; color: var(--text-3); margin-left: auto; }
.notif-history-nome { font-size: 13px; font-weight: 500; color: var(--text-1); margin-bottom: 3px; }
.notif-history-meta { font-size: 12px; color: var(--text-3); }

.btn-danger { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.25); border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.btn-danger:hover { background: rgba(239,68,68,.25); }
.btn-secondary { background: var(--bg3); color: var(--text-1); border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.btn-secondary:hover { background: var(--bg4); }

/* Pagination */
.camp-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 24px;
  gap: 12px;
}
.camp-total-label {
  font-size: 12px;
  color: #92989d;
  white-space: nowrap;
}
.camp-page-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-page-nav {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  padding: 0;
}
.btn-page-nav:hover:not(:disabled) { border-color: var(--blue-1); color: var(--blue-3); }
.btn-page-nav:disabled { opacity: .3; cursor: not-allowed; }
.camp-page-nums {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 4px;
}
.btn-page-num {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  padding: 0;
}
.btn-page-num:hover { border-color: var(--blue-1); color: var(--blue-3); }
.btn-page-num.active {
  background: var(--blue-1);
  border-color: var(--blue-1);
  color: #fff;
  font-weight: 600;
}
.camp-page-ellipsis {
  font-size: 12px;
  color: var(--text-3);
  width: 24px;
  text-align: center;
  user-select: none;
}
.camp-page-size-sel {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 6px;
  height: 28px;
  padding: 0 6px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 6px;
  outline: none;
}
.camp-page-size-sel:focus { border-color: var(--blue-1); }

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #a3a3a3;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
  letter-spacing: .1px;
}

.tab-btn:hover { color: var(--text-2); }
.tab-btn.active { color: var(--blue-3); border-bottom-color: var(--blue-2); font-weight: 600; }

/* ── Confirm dialog ── */
.confirm-actions {
  display: flex;
  gap: 10px;
}

.btn-confirm-cancel {
  flex: 1;
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius);
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.btn-confirm-cancel:hover { color: var(--text); border-color: var(--bg5); }

.btn-confirm-ok {
  flex: 1;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.35);
  color: var(--red-2);
  border-radius: var(--radius);
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-confirm-ok:hover {
  background: rgba(239,68,68,.22);
  border-color: var(--red);
  box-shadow: 0 0 12px rgba(239,68,68,.2);
}

/* ── Mobile ── */
@media (max-width: 768px) {

  /* Top bar */
  .mobile-topbar {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 54px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 50;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-logo-text {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .mobile-menu-btn {
    background: var(--bg4);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-btn span {
    display: block;
    width: 17px;
    height: 1.5px;
    background: var(--text-2);
    border-radius: 2px;
  }

  /* Overlay escuro atrás do drawer */
  .mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 35;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  .mobile-overlay.mobile-visible { display: block; }

  /* Sidebar vira drawer deslizante */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    z-index: 40;
    width: min(280px, 82vw);
    overflow-y: auto;
  }
  .sidebar.mobile-open { transform: translateX(0); }

  /* Conteúdo principal */
  .content {
    margin-left: 0;
    padding: 16px;
    padding-top: 70px;
  }

  /* Header da página */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
  }

  .page-header h1 { font-size: 18px; }

  .header-actions {
    display: flex;
    width: 100%;
    gap: 8px;
  }
  .header-actions > * { flex: 1; text-align: center; }

  /* Grid de contas: 1 coluna */
  .accounts-grid {
    grid-template-columns: 1fr;
  }

  /* Ações dos cards lado a lado */
  .account-card-actions {
    flex-direction: row;
  }
  .account-card-actions .btn-action { flex: 1; }

  /* Cards de métricas: 2 colunas */
  .cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric-card { padding: 14px 16px; }
  .metric-card .value { font-size: 20px; }
  .metric-card .label { font-size: 10px; }

  /* Modal ocupa quase tudo */
  .modal-box {
    width: 96vw;
    max-height: 88vh;
    border-radius: 12px;
  }

  .accounts-check-list { max-height: 45vh; }

  /* Botão atualizar ocupa a linha toda */
  #btn-refresh {
    width: 100%;
  }

  /* Reconnect box */
  .reconnect-box { padding: 24px 20px; }

  /* Lápis sempre visível no mobile */
  .btn-rename-card,
  .btn-rename-sidebar { opacity: 1; }

  /* Filtros de campanhas */
  .camp-filters { gap: 8px; }
  .camp-filter-date { font-size: 12px; padding: 6px 8px; }
  .camp-filter-select { font-size: 12px; padding: 6px 8px; }

  /* Tabela de campanhas no mobile — esconde colunas menos importantes */
  .camp-col-hide-mobile { display: none !important; }

  /* Dashboard mobile */
  .dash-top {
    grid-template-columns: 1fr;
  }

  .dash-stats-bar {
    flex-wrap: wrap;
    gap: 18px 0;
  }

  .dash-stat {
    flex: 1 1 45%;
    padding: 0 !important;
    border-left: none !important;
  }

  .dash-bottom-stats {
    flex-wrap: wrap;
    gap: 18px 0;
  }

  .dash-bottom-stat {
    flex: 1 1 45%;
    padding: 0 !important;
    border-left: none !important;
  }

  .dash-stat-value  { font-size: 22px; }
  .ads-live-value   { font-size: 22px; }
  .dash-bottom-stat-value { font-size: 18px; }

  .col-modal-box { width: calc(100vw - 32px); }
  .date-picker-btn { font-size: 11px; padding: 5px 8px; }
}

/* ── Date picker button ── */
.date-picker-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-2);
  font-size: 12px;
  font-family: inherit;
  padding: 0 10px;
  height: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.date-picker-btn:hover { border-color: var(--blue-1); color: var(--text); }

/* ── Calendar popup ── */
.calendar-popup {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  z-index: 300;
  width: 272px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
  user-select: none;
}
.calendar-popup.hidden { display: none; }

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cal-month-lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.cal-nav-btn {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.cal-nav-btn:hover { background: var(--bg4); color: var(--text); }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  padding: 3px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-cell {
  text-align: center;
  font-size: 12px;
  color: var(--text-2);
  padding: 7px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.cal-cell:not(.cal-empty):hover { background: var(--bg4); color: var(--text); }
.cal-cell.cal-empty { cursor: default; }
.cal-cell.cal-today { color: var(--blue-3); font-weight: 600; }
.cal-cell.cal-sel-start,
.cal-cell.cal-sel-end {
  background: var(--blue-1);
  color: #fff;
  font-weight: 700;
  border-radius: 6px;
}
.cal-cell.cal-in-range {
  background: rgba(37,99,235,.18);
  color: var(--text);
  border-radius: 0;
}
.cal-cell.cal-sel-start.cal-in-range { border-radius: 6px 0 0 6px; }
.cal-cell.cal-sel-end.cal-in-range   { border-radius: 0 6px 6px 0; }

.cal-hint {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 8px;
  letter-spacing: .03em;
}
.cal-hint-end { color: var(--blue-3); }

.cal-footer {
  margin-top: 10px;
  text-align: center;
  display: flex;
  gap: 6px;
  justify-content: center;
}
.cal-today-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 5px 14px;
  border-radius: 6px;
  transition: border-color .12s, color .12s;
}
.cal-today-btn:hover { border-color: var(--blue-1); color: var(--text); }

/* ── Column modal ── */
.col-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.col-modal.hidden { display: none; }

.col-modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 320px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,.7);
  overflow: hidden;
}
.col-modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.col-modal-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.col-modal-close {
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
}
.col-modal-close:hover { background: var(--bg4); color: var(--text); }

.col-modal-list {
  overflow-y: auto;
  padding: 6px;
  flex: 1;
}
.col-modal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  user-select: none;
  transition: background .1s;
}
.col-modal-item:hover { background: var(--bg4); }
.col-modal-item.col-dragging { opacity: .4; background: var(--bg4); }

.col-modal-grip {
  color: var(--text-3);
  font-size: 16px;
  cursor: grab;
  line-height: 1;
  padding: 2px;
  flex-shrink: 0;
}
.col-modal-grip:active { cursor: grabbing; }

.col-modal-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
}
.col-modal-label:hover { color: var(--text); }
.col-modal-label input[type=checkbox] {
  width: 14px;
  height: 14px;
  accent-color: var(--blue-1);
  cursor: pointer;
  flex-shrink: 0;
}

.col-modal-arrows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-shrink: 0;
}
.col-arrow-btn {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 9px;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: background .1s, color .1s;
}
.col-arrow-btn:hover:not(:disabled) { background: var(--bg5); color: var(--text-2); }

/* ── Calculadora Financeira ── */
.calc-page .content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  padding: 20px 36px 16px;
}
.calc-page .page-header {
  flex-shrink: 0;
  margin-bottom: 10px;
}
.calc-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 0;
  padding-bottom: 8px;
}
.calc-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2vh 22px;
  width: 100%;
  max-width: 500px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
}
.calc-title {
  font-size: clamp(13px, 1.6vh, 17px);
  font-weight: 700;
  color: var(--text);
  text-align: center;
}
.calc-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.calc-label {
  font-size: clamp(10px, 1.2vh, 13px);
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .2px;
}
.calc-row-inputs {
  display: flex;
  gap: 6px;
  align-items: center;
}
.calc-input {
  flex: 1;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: clamp(12px, 1.5vh, 15px);
  padding: clamp(6px, 1vh, 11px) 10px;
  outline: none;
  transition: border-color .15s;
  min-width: 0;
}
.calc-input:focus { border-color: var(--blue-2); }
.calc-input::placeholder { color: var(--text-3); }
.calc-input:disabled { opacity: .35; cursor: not-allowed; }
.calc-input::-webkit-outer-spin-button,
.calc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.calc-input-full { width: 100%; }
.calc-input-cpa2 { flex: 1; }

/* Dropdown plataforma */
.calc-dropdown-wrap { position: relative; }
.calc-dropdown-btn {
  width: 100%;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: clamp(12px, 1.5vh, 15px);
  padding: clamp(6px, 1vh, 11px) 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color .15s;
}
.calc-dropdown-btn:hover { border-color: var(--border2); }
.calc-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.calc-dropdown-item {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background .1s;
}
.calc-dropdown-item:hover { background: var(--bg5); }

/* Checkbox */
.calc-checkbox-wrap {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.calc-checkbox-wrap input[type="checkbox"] { display: none; }
.calc-checkbox-box {
  width: clamp(28px, 3.8vh, 40px);
  height: clamp(28px, 3.8vh, 40px);
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
  flex-shrink: 0;
}
.calc-checkbox-wrap input:checked + .calc-checkbox-box {
  background: var(--blue-1);
  border-color: var(--blue-1);
}
.calc-checkbox-wrap input:checked + .calc-checkbox-box::after {
  content: '✓';
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* Botão calcular */
.calc-btn-calcular {
  width: 100%;
  background: var(--blue-1);
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: clamp(12px, 1.5vh, 14px);
  font-weight: 700;
  padding: clamp(7px, 1.1vh, 12px);
  cursor: pointer;
  letter-spacing: .5px;
  transition: opacity .15s;
  flex-shrink: 0;
}
.calc-btn-calcular:hover { opacity: .88; }

/* Resultado */
.calc-resultado-wrap {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: clamp(8px, 1.2vh, 14px) 12px;
  height: clamp(120px, 20vh, 220px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}
.calc-resultado-title {
  font-size: clamp(10px, 1.2vh, 13px);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: .2px;
  flex-shrink: 0;
}
.calc-resultado-box {
  font-size: clamp(10px, 1.1vh, 13px);
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.7;
  overflow: hidden;
}

/* Botão copiar */
.calc-btn-copiar {
  width: 100%;
  background: #16a34a;
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: clamp(12px, 1.5vh, 14px);
  font-weight: 700;
  padding: clamp(7px, 1.1vh, 12px);
  cursor: pointer;
  letter-spacing: .5px;
  transition: background .15s;
  flex-shrink: 0;
}
.calc-btn-copiar:hover { background: #15803d; }
.calc-btn-copiar.copiado { background: #15803d; }
.col-arrow-btn:disabled { opacity: .25; cursor: default; }

/* ── Multi-agência ── */
.agencies-label {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 14px;
  font-weight: 500;
}

.agencies-empty {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  padding: 20px 0;
}

.agency-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s;
}

.agency-item:hover { border-color: var(--blue-1); }

.agency-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.agency-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: agdotpulse 2.2s ease-in-out infinite;
}

@keyframes agdotpulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 5px var(--green), 0 0 10px rgba(34,197,94,.4); }
  50%       { opacity: .6; box-shadow: 0 0 2px var(--green); }
}

.agency-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agency-item-count {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
}

.agency-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 10px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg5);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.btn-icon:hover { background: var(--bg3); color: var(--text); border-color: var(--border2); }

.btn-icon-danger:hover { background: rgba(239,68,68,.12); color: var(--red); border-color: rgba(239,68,68,.3); }

.agency-rename-inline {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 0 4px;
  flex-wrap: wrap;
}

.agency-rename-inline input {
  flex: 1;
  min-width: 0;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}

.agency-rename-inline input:focus { border-color: var(--blue-1); }

.agency-inline-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 2px 4px;
  outline: none;
  width: 100%;
  min-width: 0;
}

.btn-icon-confirm:hover { background: rgba(34,197,94,.12); color: var(--green); border-color: rgba(34,197,94,.3); }
.btn-icon-cancel:hover  { background: rgba(239,68,68,.12); color: var(--red);   border-color: rgba(239,68,68,.3); }

.agency-item.disconnected {
  border-color: rgba(239,68,68,.45);
  box-shadow: 0 0 0 1px rgba(239,68,68,.2);
}

.agency-item.disconnected .agency-dot {
  background: var(--red);
  animation: agdotpulse-red 2.2s ease-in-out infinite;
}

@keyframes agdotpulse-red {
  0%, 100% { opacity: 1; box-shadow: 0 0 5px var(--red), 0 0 10px rgba(239,68,68,.4); }
  50%       { opacity: .6; box-shadow: 0 0 2px var(--red); }
}

.btn-reconnect {
  display: none;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.35);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  margin: 0 8px;
  transition: background .15s, border-color .15s;
}

.btn-reconnect:not(.hidden) { display: inline-flex; align-items: center; }
.btn-reconnect:hover { background: rgba(239,68,68,.2); border-color: rgba(239,68,68,.6); }

#btn-manage:hover {
  background: var(--blue-2);
}

.agency-section { margin-bottom: 8px; }

.agency-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.agency-section-header h1 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.agency-section-name {
  color: var(--text-2);
  font-weight: 400;
}

.agency-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.accounts-sections {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.agency-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #a3a3a3;
  margin-bottom: 4px;
}
