:root {
  --bg: #0a0a0a;
  --card: #111;
  --card2: #161616;
  --border: #222;
  --border2: #2a2a2a;
  --text: #f0ebe2;
  --muted: #666;
  --muted2: #444;
  --gold: #A855F7;
  --gold-bg: #1a0a2e;
  --green: #1D9E75;
  --green-bg: #0a2419;
  --red: #e74c3c;
  --red-bg: #1a0808;
  --blue: #3b82f6;
  --blue-bg: #0a1628;
  --sidebar-w: 220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: 'Sora', sans-serif; letter-spacing: -.015em; line-height: 1.25; }

/* LOGIN */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; }
.login-logo { text-align: center; margin-bottom: 2rem; }
.logo-text { font-family: 'Sora', sans-serif; font-size: 36px; font-weight: 800; color: var(--gold); }
.logo-sub { font-size: 14px; color: var(--muted); margin-left: 6px; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; width: 100%; max-width: 420px; }
.login-card h2 { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 1.5rem; }
.login-link { text-align: center; margin-top: 1rem; font-size: 14px; color: var(--muted); }
.login-link a { color: var(--gold); text-decoration: none; }

/* PAGES */
.page { display: none; }
.page.active { display: block; }

/* SISTEMA */
#page-sistema { display: none; }
#page-sistema.active { display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
#sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #0d0d0d;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: width .25s ease, transform .25s ease;
  overflow: hidden;
  position: relative;
  z-index: 50;
}

#sidebar.collapsed { width: 56px; }
#sidebar.collapsed .nav-label { display: none; }
#sidebar.collapsed .sidebar-logo-text { display: none; }
#sidebar.collapsed .sidebar-footer-name { display: none; }
#sidebar.collapsed .nav-badge { display: none; }
#sidebar.collapsed .btn-logout { display: none; }
#sidebar.collapsed .sidebar-logo { justify-content: center; padding: 1.25rem .75rem; }
#sidebar.collapsed .nav-item { justify-content: center; padding: 11px; }
#sidebar.collapsed .nav-item::before { display: none; }
#sidebar.collapsed .nav-icon { margin: 0; }
#sidebar.collapsed .nav-icon svg { width: 20px; height: 20px; }
#sidebar.collapsed .sidebar-footer { justify-content: center; padding: .75rem; }

.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 64px;
}
.sidebar-logo-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.logo-text { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.logo-sub { font-size: 11px; color: var(--muted); white-space: nowrap; }

.toggle-sidebar {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  transition: all .15s;
}
.toggle-sidebar:hover { border-color: var(--gold); color: var(--gold); }

.sidebar-nav { flex: 1; padding: .5rem 0 .75rem; overflow-y: auto; overflow-x: hidden; }

.nav-group { padding: 0 .625rem; }
.nav-group + .nav-group { margin-top: .875rem; padding-top: .875rem; border-top: 1px solid #1a1a1a; }
.nav-group-title {
  font-size: 10px; font-weight: 700; color: #4a4a4a;
  text-transform: uppercase; letter-spacing: .14em;
  padding: 0 .75rem; margin-bottom: 6px; white-space: nowrap;
  user-select: none;
}
#sidebar.collapsed .nav-group-title { visibility: hidden; height: 4px; margin-bottom: 2px; }
#sidebar.collapsed .nav-group { padding: 0 .5rem; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin: 2px 0;
  color: #9a9a9a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 9px;
  transition: color .18s ease, background .18s ease, transform .18s ease;
  position: relative;
  white-space: nowrap;
}
.nav-item::before {
  content: '';
  position: absolute; left: -10px; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px; height: 60%;
  background: var(--gold); border-radius: 0 3px 3px 0;
  transition: transform .2s ease;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.05); transform: translateX(2px); }
.nav-item.active {
  color: var(--gold);
  background: linear-gradient(90deg, rgba(245,166,35,.14), rgba(245,166,35,.04));
  font-weight: 600;
}
.nav-item.active::before { transform: translateY(-50%) scaleY(1); }
.nav-item.dragging { opacity: .4; }
.nav-item.drag-over { box-shadow: 0 -2px 0 var(--gold); }

.nav-icon { flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.8; color: #8a8a8a; transition: color .18s ease, transform .18s ease; }
.nav-item:hover .nav-icon svg { color: var(--text); }
.nav-item.active .nav-icon svg { color: var(--gold); transform: scale(1.06); }
.nav-label { flex: 1; }
.nav-badge { background: var(--red); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 10px; flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
}
.sidebar-footer-name { font-size: 13px; color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-logout { background: none; border: 1px solid var(--border2); color: var(--muted); padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all .15s; white-space: nowrap; }
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* MOBILE SIDEBAR OVERLAY */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 49; }
.sidebar-overlay.show { display: block; }

/* MAIN */
#main-content { flex: 1; overflow-y: auto; background: var(--bg); min-width: 0; }
.view { display: none; padding: 1.75rem; }
.view.active { display: block; }
.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.view-header h1 { font-family: 'Sora', sans-serif; font-size: 25px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.badge-count { background: var(--card2); border: 1px solid var(--border); font-size: 13px; font-weight: 500; padding: 2px 10px; border-radius: 20px; color: var(--muted); font-family: 'DM Sans', sans-serif; }

/* TOP BAR MOBILE */
.top-bar { display: none; align-items: center; gap: 12px; padding: .875rem 1.25rem; background: #0d0d0d; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.top-bar-logo { font-family: 'Sora', sans-serif; font-size: 20px; font-weight: 800; color: var(--gold); }
.top-bar-toggle { background: none; border: 1px solid var(--border); color: var(--muted); width: 32px; height: 32px; border-radius: 6px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }

/* DASHBOARD */
.dash-section-title { font-size: 12px; font-weight: 700; color: #888; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .75rem; padding: 4px 0; border-bottom: 1px solid #1a1a1a; }
.stats-grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.stats-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stats-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.charts-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.charts-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.1rem; }
.stat-card.green { background: #0a2419; border-color: #1D9E75; }
.stat-card.red { background: #1a0808; border-color: #e74c3c; }
.stat-card.gold { background: #1a1200; border-color: #d4a017; }
.stat-card.amber { background: #1a1000; border-color: #f39c12; }
.stat-card.purple { background: #110a1f; border-color: #8b5cf6; }
.stat-card.blue { background: #0a1628; border-color: #3b82f6; }
.stat-card.dark { background: #0f0f0f; border-color: #2a2a2a; }

.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.stat-icon { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.06); }
.stat-icon svg { width: 15px; height: 15px; stroke-width: 2; }
.stat-card.green .stat-icon { background: rgba(29,158,117,.18); } .stat-card.green .stat-icon svg { color: #4caf7d; }
.stat-card.red .stat-icon { background: rgba(231,76,60,.15); } .stat-card.red .stat-icon svg { color: #e74c3c; }
.stat-card.amber .stat-icon { background: rgba(243,156,18,.15); } .stat-card.amber .stat-icon svg { color: #f39c12; }
.stat-card.gold .stat-icon { background: rgba(212,160,23,.15); } .stat-card.gold .stat-icon svg { color: #f5c842; }
.stat-card.purple .stat-icon { background: rgba(139,92,246,.15); } .stat-card.purple .stat-icon svg { color: #a78bfa; }
.stat-card.blue .stat-icon { background: rgba(59,130,246,.15); } .stat-card.blue .stat-icon svg { color: #60a5fa; }
.stat-pct { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 20px; opacity: .75; }
.stat-card.green .stat-pct { background: rgba(29,158,117,.2); color: #4caf7d; }
.stat-card.red .stat-pct { background: rgba(231,76,60,.2); color: #e74c3c; }
.stat-card.gold .stat-pct { background: rgba(212,160,23,.2); color: #f5c842; }
.stat-card.amber .stat-pct { background: rgba(243,156,18,.2); color: #f39c12; }
.stat-card.purple .stat-pct { background: rgba(139,92,246,.2); color: #a78bfa; }
.stat-card.blue .stat-pct { background: rgba(59,130,246,.2); color: #60a5fa; }

.stat-label { font-size: 11px; color: #7a7a7a; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
.stat-val { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: #f0ebe2; line-height: 1.1; }
.stat-card { transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.stat-card.green .stat-val { color: #4caf7d; }
.stat-card.red .stat-val { color: #e74c3c; }
.stat-card.gold .stat-val { color: #f5c842; }
.stat-card.amber .stat-val { color: #f39c12; }
.stat-card.purple .stat-val { color: #a78bfa; }
.stat-card.blue .stat-val { color: #60a5fa; }
.stat-val[onclick]:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.stat-money { font-size: 12px; color: #555; }
.stat-sub-row { display: flex; justify-content: space-between; font-size: 12px; color: #666; margin-top: 4px; border-top: 1px solid rgba(255,255,255,.05); padding-top: 4px; }
.stat-lucro-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; }
.lucro-up { font-size: 14px; font-weight: 500; color: #4caf7d; }
.lucro-down { font-size: 14px; font-weight: 500; color: #e74c3c; }

.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.25rem; }
.chart-title { font-size: 12px; font-weight: 600; color: #888; margin-bottom: .75rem; text-transform: uppercase; letter-spacing: .06em; }

/* FILTERS */
.filters-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1.25rem; align-items: center; }
.filters-bar input { flex: 2; min-width: 180px; }
.filters-bar select { flex: 1; min-width: 130px; max-width: 180px; }

/* TABLE */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 11px 14px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--border); background: var(--card2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--card2); }

/* STATUS BADGES */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.status-Ativo { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.status-Inativo { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.status-Suspenso { background: var(--gold-bg); color: var(--gold); border: 1px solid var(--gold); }
.status-vencendo { background: #1a1000; color: #f39c12; border: 1px solid #f39c12; }

/* ACTIONS */
.actions { display: flex; gap: 4px; }
.btn-icon { width: 30px; height: 30px; border-radius: 6px; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: opacity .15s; }
.btn-icon:hover { opacity: .8; }
.btn-icon-blue { background: #1a3a6a; color: #60a5fa; }
.btn-icon-green { background: var(--green-bg); color: var(--green); }
.btn-icon-gold { background: var(--gold-bg); color: var(--gold); }
.btn-icon-red { background: var(--red-bg); color: var(--red); }

/* FORMS */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: .85rem; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--muted); }
.form-full { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
input, select, textarea { background: var(--card2); border: 1px solid var(--border2); border-radius: 8px; padding: 10px 13px; color: var(--text); font-size: 14px; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color .15s; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
select option { background: var(--card); }
textarea { resize: vertical; }
small.text-muted { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* BUTTONS */
.btn { padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; font-family: 'DM Sans', sans-serif; transition: opacity .15s, transform .1s; display: inline-flex; align-items: center; gap: 6px; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--gold); color: #1a0a2e; }
.btn-primary:hover { opacity: .88; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border2); }
.btn-ghost:hover { color: var(--text); border-color: #444; }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }

/* MODAL */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1000; align-items: center; justify-content: center; padding: 1rem; }
.modal.open { display: flex; }
.modal-box { background: var(--card); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 520px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-lg { max-width: 820px; }
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.modal-header h3 { font-family: 'Sora', sans-serif; font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }

/* CARDS GRID */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.msg-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.msg-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.msg-card-name { font-weight: 600; font-size: 15px; }
.msg-card-body { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.msg-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.meta-tag { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: var(--card2); color: var(--muted); border: 1px solid var(--border); }
.msg-card-footer { display: flex; gap: 6px; }
.badge-auto { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.badge-manual { background: var(--card2); color: var(--muted); border: 1px solid var(--border); font-size: 11px; padding: 2px 8px; border-radius: 20px; }

/* DETALHE */
.detalhe-row { display: flex; padding: 9px 0; border-bottom: 1px solid var(--border); }
.detalhe-label { font-size: 13px; color: var(--muted); width: 150px; flex-shrink: 0; }
.detalhe-value { font-size: 14px; color: var(--text); }
.detalhe-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 1.5rem; }
.detalhe-stat { background: var(--card2); border: 1px solid var(--border); border-radius: 10px; padding: .85rem; text-align: center; }
.detalhe-stat-val { font-family: 'DM Sans', sans-serif; font-size: 20px; font-weight: 700; }
.detalhe-stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ALERTS */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 1rem; }
.alert-error { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }

/* TOAST */
.toast { position: fixed; bottom: 2rem; right: 2rem; padding: 11px 20px; border-radius: 10px; font-size: 14px; z-index: 9999; display: none; }
.toast.show { display: block; }
.toast.ok { background: var(--green-bg); color: var(--green); border: 1px solid var(--green); }
.toast.err { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); }

/* PAGINATION */
.pagination { display: flex; align-items: center; gap: 4px; padding: 1rem 0; flex-wrap: wrap; }
.pag-btn { background: var(--card); border: 1px solid var(--border); color: var(--muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all .15s; font-family: 'DM Sans', sans-serif; }
.pag-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.pag-btn.active { background: var(--gold); color: #1a0a2e; border-color: var(--gold); font-weight: 600; }
.pag-btn:disabled { opacity: .3; cursor: not-allowed; }
.pag-dots { color: var(--muted); padding: 0 4px; font-size: 14px; }
.pag-info { margin-left: auto; font-size: 13px; color: var(--muted); }
.pag-size { background: var(--card); border: 1px solid var(--border); color: var(--muted); padding: 6px 10px; border-radius: 6px; font-size: 13px; font-family: 'DM Sans', sans-serif; cursor: pointer; }

/* MISC */
.text-muted { color: var(--muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-gold { color: var(--gold); }

/* MOBILE */
@media(max-width: 768px) {
  #sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); z-index: 50; width: var(--sidebar-w) !important; }
  #sidebar.mobile-open { transform: translateX(0); }
  .toggle-sidebar { display: none; }
  .top-bar { display: flex; }
  #main-content { padding-top: 0; }
  .view { padding: 1rem; }
  .stats-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-3 { grid-template-columns: repeat(1, 1fr); }
  .charts-grid-2 { grid-template-columns: 1fr; }
  .charts-grid-3 { grid-template-columns: 1fr; }
  .filters-bar input { min-width: 100%; }
  .filters-bar select { min-width: calc(50% - 4px); max-width: 100%; }
  .modal-box { max-height: 95vh; }
  .modal-lg { max-width: 100%; }
  .detalhe-stats { grid-template-columns: repeat(3,1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .view-header h1 { font-size: 20px; }
}

/* ===== NOTIFICAÇÕES EMPILHADAS ===== */
.notify-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
  width: calc(100% - 2rem);
  pointer-events: none;
}
.notify {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  border: 1px solid;
  background: var(--card);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.notify.show { opacity: 1; transform: translateX(0); }
.notify-icon { font-weight: 700; flex-shrink: 0; font-size: 15px; line-height: 1.4; }
.notify-msg { flex: 1; line-height: 1.4; }
.notify-close { background: none; border: none; color: inherit; opacity: .5; cursor: pointer; font-size: 14px; padding: 0 2px; flex-shrink: 0; }
.notify-close:hover { opacity: 1; }
.notify-success { border-color: var(--green); background: #0a2419; color: #6dd4a0; }
.notify-error { border-color: var(--red); background: #1a0808; color: #f08a7e; }
.notify-warning { border-color: #f39c12; background: #1a1000; color: #f5c842; }
.notify-info { border-color: var(--blue); background: #0a1628; color: #8fc0f5; }

/* ===== BOTÕES DE AÇÃO EXTRAS ===== */
.btn-icon-purple { background: #1a1430; color: #a78bfa; }
.btn-icon-dark { background: #1c1c1c; color: #888; border: 1px solid #2a2a2a; }

/* ===== CHECKBOXES INLINE ===== */
.chk-inline { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.chk-inline input { width: auto; margin: 0; }
.chk-arquivado { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.chk-arquivado input { width: auto; margin: 0; }

/* ===== AVISO BLOQUEIO ===== */
.aviso-bloqueio {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #1a1000;
  border: 1px solid #f39c12;
  color: #f5c842;
  font-size: 13px;
}

@media(max-width: 768px) {
  .notify-stack { top: .5rem; right: .5rem; left: .5rem; max-width: none; }
}

/* ===== ESTATÍSTICAS DE CAMPANHA ===== */
.campanha-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  background: var(--card2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.campanha-stats .cstat { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cstat-n { font-family: 'DM Sans', sans-serif; font-size: 20px; font-weight: 700; }
.cstat-l { font-size: 11px; color: var(--muted); margin-top: 2px; }

@media(max-width: 768px) {
  .campanha-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Corrige alinhamento dos botões no rodapé dos cards de campanha */
.msg-card-footer { align-items: stretch; flex-wrap: wrap; }
.msg-card-footer .btn { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }

/* ===== CUSTOS POR SERVIDOR ===== */
.custos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.custo-servidor-item { display: flex; flex-direction: column; gap: 6px; }
.custo-servidor-item label { font-size: 13px; color: var(--muted); }
.custo-input-wrap { display: flex; align-items: center; gap: 6px; background: var(--card2); border: 1px solid var(--border2); border-radius: 8px; padding: 0 10px; }
.custo-input-wrap span { color: var(--muted); font-size: 14px; }
.custo-input-wrap input { border: none; background: transparent; padding: 10px 0; }
.custo-input-wrap input:focus { border: none; }

/* ===== MÉTRICAS FINANCEIRAS ===== */
.margem-header { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 0; border-bottom: 1px solid var(--border); }
.margem-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center; }
.margem-row:last-child { border-bottom: none; }
.margem-sv { font-weight: 500; }
.margem-val { text-align: right; font-family: 'DM Sans', sans-serif; }

#lucro-clientes .margem-row { grid-template-columns: 2fr 1fr 1fr; }

@media(max-width: 768px) {
  .margem-header, .margem-row { grid-template-columns: 1.5fr 1fr 1fr 1fr; font-size: 11px; }
}

/* ===== CARDS LUCRO X CUSTO (2 linhas) ===== */
.lucro-linha { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.lucro-tag { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.lucro-linha .lucro-up { font-size: 17px; font-weight: 700; color: #4caf7d; }
.lucro-linha .lucro-down { font-size: 17px; font-weight: 700; color: #e74c3c; }

/* ===== INDIQUE & GANHE ===== */
/* Autocomplete (busca de indicador / participante) */
.autocomplete-box { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 50; background: var(--card2, #1c1c1c); border: 1px solid var(--border2, #2a2a2a); border-radius: 10px; margin-top: 4px; max-height: 240px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.autocomplete-item { padding: 10px 14px; font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--border, #222); transition: background .1s; }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: rgba(245,166,35,.1); }

/* Código de consulta (pill clicável) */
.codigo-pill { display: inline-block; font-family: 'DM Sans', sans-serif; font-weight: 700; letter-spacing: .08em; background: #2a1f00; color: var(--gold, #A855F7); border: 1px solid #5a3d00; padding: 4px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: opacity .1s; }
.codigo-pill:hover { opacity: .8; }

/* Badge de nível */
.nivel-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.nivel-1, .nivel-2, .nivel-3, .nivel-4 { background: #2a1f00; color: #A855F7; border: 1px solid #5a3d00; }
.nivel-5 { background: #1a1430; color: #AFA9EC; border: 1px solid #534AB7; }
.nivel-6 { background: #0a2419; color: #4caf7d; border: 1px solid #1D9E75; }

/* ===== INDIQUE ETAPA 2 ===== */
/* Sub-abas */
.subtabs { display: flex; gap: 6px; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border, #222); flex-wrap: wrap; }
.subtab { background: none; border: none; color: var(--muted, #888); font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500; padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; width: auto; }
.subtab:hover { color: var(--text, #f0ebe2); }
.subtab.active { color: var(--gold, #A855F7); border-bottom-color: var(--gold, #A855F7); }

/* Badge de alertas */
.alertas-badge { display: inline-block; background: #e74c3c; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; padding: 0 5px; margin-left: 4px; }

/* Árvore de indicações */
.arvore-no { margin: 2px 0; }
.arvore-linha { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card2, #1c1c1c); border: 1px solid var(--border, #222); border-radius: 8px; transition: border-color .1s; }
.arvore-linha:hover { border-color: var(--gold, #A855F7); }
.arvore-toggle { cursor: pointer; color: var(--gold, #A855F7); font-size: 11px; width: 16px; text-align: center; user-select: none; }
.arvore-toggle-vazio { color: var(--muted, #555); font-size: 11px; width: 16px; text-align: center; }
.arvore-nome { font-weight: 500; font-size: 14px; }

/* ===== MIGRAÇÃO DE INDICAÇÕES ===== */
.migracao-item { display: grid; grid-template-columns: 1.5fr 1.5fr auto; gap: 14px; align-items: center; padding: 14px; background: var(--card2, #1c1c1c); border: 1px solid var(--border, #222); border-radius: 10px; margin-bottom: 10px; }
.migracao-info { min-width: 0; }
.migracao-acao input { width: 100%; }
.migracao-botoes { display: flex; gap: 6px; }
.btn-sm { padding: 7px 12px !important; font-size: 13px !important; width: auto !important; margin: 0 !important; }

@media(max-width: 768px) {
  .migracao-item { grid-template-columns: 1fr; gap: 10px; }
}

/* ===== LOGO DIGITAL NET (imagem) ===== */
.logo-img { display:block; height:auto; width:140px; max-width:100%; object-fit:contain; }
.sidebar .logo-img, .sidebar-header .logo-img { width:150px; margin:4px auto 0; }
.top-bar .logo-img, .top-bar-logo.logo-img { height:34px !important; width:auto !important; }
.login-logo .logo-img { width:200px; margin:0 auto; }
