/* ── Reset & base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0F172A; color: #E2E8F0; min-height: 100vh; }

/* ── Auth gate ── */
#auth-gate {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 20px;
}
#auth-gate .logo { font-size: 48px; margin-bottom: 8px; }
#auth-gate h1 { font-size: 22px; font-weight: 700; color: #F1F5F9; }
#auth-gate p { font-size: 14px; color: #94A3B8; }
#sign-in-btn {
  display: flex; align-items: center; gap: 12px;
  background: #fff; color: #1E293B; border: none; border-radius: 12px;
  padding: 13px 24px; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3); margin-top: 8px;
  transition: transform 0.1s;
}
#sign-in-btn:hover { transform: translateY(-1px); }
#sign-in-btn svg { width: 20px; height: 20px; }

/* ── App shell layout ── */
#dashboard { display: none; }
#app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
#sidebar {
  width: 220px; flex-shrink: 0;
  background: #1E293B; border-right: 1px solid #334155;
  display: flex; flex-direction: column;
  overflow-y: auto; z-index: 20;
  transition: left 0.25s ease;
}
.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
}
.sidebar-logo-icon { font-size: 26px; }
.sidebar-title { font-size: 14px; font-weight: 700; color: #F1F5F9; }
.sidebar-sub { font-size: 11px; color: #64748B; }
.nav-group { flex: 1; padding: 10px 8px; }
.nav-section-label {
  font-size: 10px; font-weight: 700; color: #475569;
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 8px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: none; background: none; color: #64748B;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left; margin-bottom: 2px;
}
.nav-item:hover { background: #0F172A; color: #CBD5E1; }
.nav-item.active { background: #1D3A6E; color: #93C5FD; }
.nav-icon { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 14px 12px; border-top: 1px solid #334155;
  display: flex; flex-direction: column; gap: 8px; flex-shrink: 0;
}
#sign-out-btn {
  background: transparent; border: 1px solid #334155; color: #64748B;
  padding: 8px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
  transition: background 0.15s, color 0.15s; width: 100%; text-align: center;
}
#sign-out-btn:hover { background: #0F172A; color: #F1F5F9; }

/* ── Sidebar overlay (mobile tap-to-close) ── */
#sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 19;
}
#sidebar-overlay.show { display: block; }

/* ── Member list modal ── */
.member-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 50;
  align-items: center; justify-content: center; padding: 20px;
}
.member-modal-overlay.show { display: flex; }
.member-modal-card {
  background: #1E293B; border: 1px solid #334155; border-radius: 12px;
  width: 100%; max-width: 460px; max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.member-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid #334155; flex-shrink: 0;
}
.member-modal-title { font-size: 15px; font-weight: 700; color: #F1F5F9; }
.member-modal-close {
  background: transparent; border: none; color: #94A3B8; font-size: 16px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.member-modal-close:hover { background: #334155; color: #F1F5F9; }
.member-modal-body { overflow-y: auto; padding: 8px 0; }
.member-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; border-bottom: 1px solid #263449;
}
.member-row:last-child { border-bottom: none; }
.member-row-name { font-size: 13px; font-weight: 600; color: #F1F5F9; }
.member-row-email { font-size: 11px; color: #64748B; margin-top: 2px; }
.member-row-empty { padding: 24px 18px; text-align: center; color: #64748B; font-size: 13px; }
.member-count-link {
  background: transparent; border: none; color: #67E8F9; font-weight: 700;
  font-size: 13px; cursor: pointer; padding: 2px 6px; border-radius: 6px;
  text-decoration: underline;
}
.member-count-link:hover { background: #083344; }

/* ── Main panel ── */
.main-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.main-topbar {
  background: #1E293B; border-bottom: 1px solid #334155;
  padding: 12px 20px; display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: 16px; font-weight: 700; color: #F1F5F9; }
#hamburger-btn {
  display: none;
  background: none; border: 1px solid #334155; border-radius: 8px;
  color: #94A3B8; font-size: 20px; padding: 4px 10px; cursor: pointer; line-height: 1;
}
.admin-badge {
  background: #0F766E; color: #CCFBF1; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; letter-spacing: 0.5px;
}
#refresh-btn {
  background: #1D4ED8; color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s;
}
#refresh-btn:hover { background: #2563EB; }
/* Secondary to Refresh — same shape, muted, since it's the rarer "the console
   itself looks stale" action rather than the everyday data reload. */
#hard-refresh-btn {
  background: #E2E8F0; color: #334155; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  margin-left: 8px; transition: background 0.15s;
}
#hard-refresh-btn:hover { background: #CBD5E1; }
#hard-refresh-btn:disabled { opacity: 0.6; cursor: default; }
.main-scroll { flex: 1; overflow-y: auto; }
.content { padding: 20px 24px 60px; max-width: 1300px; }

/* ── KPI cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 28px;
}
.kpi-card {
  background: #1E293B; border-radius: 16px; padding: 18px 16px;
  border: 1px solid #334155; position: relative; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent, #3B82F6); border-radius: 16px 16px 0 0;
}
.kpi-icon { font-size: 22px; margin-bottom: 8px; }
.kpi-value { font-size: 34px; font-weight: 800; color: #F1F5F9; line-height: 1; margin-bottom: 4px; }
.kpi-label { font-size: 11px; color: #64748B; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-sub { font-size: 11px; color: #475569; margin-top: 6px; }

/* ── Chart grid ── */
.chart-row { display: grid; gap: 16px; margin-bottom: 20px; }
.chart-row-2 { grid-template-columns: 1fr 1fr; }
.chart-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.chart-row-1 { grid-template-columns: 1fr; }
.chart-card {
  background: #1E293B; border-radius: 16px; border: 1px solid #334155;
  padding: 20px 22px;
}
.chart-card-title {
  font-size: 13px; font-weight: 700; color: #94A3B8;
  text-transform: uppercase; letter-spacing: 0.7px;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.chart-wrap { position: relative; }
.chart-wrap-donut { max-width: 260px; margin: 0 auto; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; justify-content: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #94A3B8; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Section header ── */
.section { margin-bottom: 24px; }
.section-title {
  font-size: 13px; font-weight: 700; color: #94A3B8;
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: #334155; }

/* ── Table ── */
.table-wrap {
  background: #1E293B; border-radius: 14px;
  border: 1px solid #334155; overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 480px; }
.data-table th {
  text-align: left; padding: 10px 14px; background: #1E293B;
  color: #64748B; font-weight: 600; text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.5px; border-bottom: 1px solid #334155;
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid #1E293B44; color: #CBD5E1; }
.data-table tr:hover td { background: rgba(255,255,255,0.03); }

/* ── Pill badges ── */
.pill { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill-green  { background: #064E3B; color: #6EE7B7; }
.pill-blue   { background: #1E3A5F; color: #93C5FD; }
.pill-amber  { background: #451A03; color: #FCD34D; }
.pill-purple { background: #2E1065; color: #C4B5FD; }
.pill-gray   { background: #1F2937; color: #94A3B8; border: 1px solid #374151; }
.pill-red    { background: #450A0A; color: #FCA5A5; }

/* ── Progress bars ── */
.bar-track { flex: 1; background: #0F172A; border-radius: 4px; height: 6px; overflow: hidden; margin: 0 10px; }
.bar-fill  { height: 100%; border-radius: 4px; background: #3B82F6; transition: width 0.6s ease; }

/* ── Loading / error ── */
.loading { text-align: center; padding: 60px 48px; color: #475569; font-size: 14px; }
.spinner {
  width: 36px; height: 36px; border: 3px solid #334155; border-top-color: #3B82F6;
  border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { background: #450A0A; border: 1px solid #991B1B; border-radius: 12px; padding: 16px 20px; color: #FCA5A5; font-size: 14px; }

/* ── Timestamp ── */
.footer-ts { font-size: 11px; color: #334155; text-align: center; margin-top: 28px; }

/* ── Firestore Usage Snapshot ── */
.usage-section { margin-bottom: 28px; }
.coll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.coll-card {
  background: #1E293B; border: 1px solid #334155; border-radius: 12px;
  padding: 14px 10px; text-align: center; transition: transform 0.15s;
}
.coll-card:hover { transform: translateY(-2px); }
.coll-card-total { border-color: #92400E; background: #1C1007; }
.coll-icon { font-size: 20px; margin-bottom: 6px; }
.coll-count { font-size: 22px; font-weight: 800; color: #F1F5F9; line-height: 1; margin-bottom: 3px; }
.coll-label { font-size: 10px; color: #64748B; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }

.usage-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.usage-card { background: #1E293B; border: 1px solid #334155; border-radius: 14px; padding: 16px 18px; }
.usage-card-title {
  font-size: 12px; font-weight: 700; color: #94A3B8;
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 12px; border-bottom: 1px solid #334155; padding-bottom: 8px;
}
.usage-stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; border-bottom: 1px solid #0F172A;
}
.usage-stat-label { font-size: 12px; color: #64748B; }
.usage-stat-value { font-size: 13px; font-weight: 700; color: #CBD5E1; }
.usage-highlight { color: #F1F5F9 !important; }
.usage-green { color: #34D399 !important; }
.usage-note {
  margin-top: 10px; font-size: 11px; color: #475569; line-height: 1.5;
  background: #0F172A; border-radius: 8px; padding: 8px 10px;
}
.usage-limit-bar-wrap { height: 5px; background: #334155; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.usage-limit-bar { height: 100%; border-radius: 4px; transition: width 0.8s ease; }
.usage-price-table { display: flex; flex-direction: column; gap: 0; }
.price-row {
  display: flex; justify-content: space-between;
  padding: 5px 0; border-bottom: 1px solid #0F172A; font-size: 12px; color: #64748B;
}
.price-val { color: #F59E0B; font-weight: 700; }
.spark-limits { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.spark-row { display: flex; align-items: center; gap: 10px; }
.spark-label { display: flex; justify-content: space-between; width: 260px; font-size: 12px; color: #94A3B8; flex-shrink: 0; }
.spark-nums { color: #64748B; font-size: 11px; }
.spark-track { flex: 1; height: 8px; background: #334155; border-radius: 4px; overflow: hidden; }
.spark-fill { height: 100%; border-radius: 4px; transition: width 0.8s ease; }
.spark-pct { width: 38px; text-align: right; font-size: 12px; color: #64748B; font-weight: 700; }

/* ── Broadcast ── */
.broadcast-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.bc-panel { background: #1E293B; border: 1px solid #334155; border-radius: 16px; padding: 22px; }
.bc-panel-title {
  font-size: 13px; font-weight: 700; color: #94A3B8;
  text-transform: uppercase; letter-spacing: 0.7px;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid #334155;
  display: flex; align-items: center; gap: 8px;
}
.bc-label {
  font-size: 12px; font-weight: 600; color: #64748B;
  text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; margin-top: 14px;
}
.bc-label:first-of-type { margin-top: 0; }
.bc-select, .bc-input, .bc-textarea {
  width: 100%; background: #0F172A; border: 1px solid #334155; border-radius: 10px;
  color: #E2E8F0; font-size: 14px; padding: 10px 12px;
  font-family: inherit; outline: none; transition: border-color 0.15s;
}
.bc-select:focus, .bc-input:focus, .bc-textarea:focus { border-color: #3B82F6; }
.bc-textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.bc-char-count { font-size: 11px; color: #475569; text-align: right; margin-top: 3px; }
/* ── Rich HTML mode (Broadcast + Marketing) ── */
.bc-html-toggle-row {
  display: flex; align-items: center; gap: 8px; margin-top: 16px;
  padding-top: 14px; border-top: 1px dashed #334155;
}
.bc-html-toggle-row label { font-size: 13px; font-weight: 600; color: #CBD5E1; cursor: pointer; }
.bc-html-toggle-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: #3B82F6; cursor: pointer; }
.bc-html-panel { margin-top: 12px; }
.bc-html-toolbar { display: flex; gap: 8px; margin-bottom: 8px; }
.bc-secondary-btn {
  background: #0F172A; border: 1px solid #334155; color: #93C5FD;
  font-size: 12px; font-weight: 700; padding: 8px 14px; border-radius: 8px;
  cursor: pointer; transition: all 0.15s;
}
.bc-secondary-btn:hover:not(:disabled) { border-color: #3B82F6; background: #1E3A5F; }
.bc-secondary-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bc-html-status { font-size: 12px; margin-top: 6px; min-height: 14px; }
.bc-html-hint { font-size: 11px; color: #475569; margin-top: 6px; line-height: 1.5; }
#bc-html-body, #mkt-html-body { min-height: 260px; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; }
.bc-html-preview {
  display: none; border: 1px solid #334155; border-radius: 10px; overflow: hidden;
  background: #fff; min-height: 260px;
}
.bc-html-preview iframe { width: 100%; height: 420px; border: none; display: block; }

/* ── Campaigns (recipient mode toggle, draft/publish actions, drafts list) ── */
.mode-toggle { display: flex; gap: 8px; margin-top: 4px; }
.mode-btn {
  flex: 1; padding: 10px 12px; border-radius: 10px; border: 1.5px solid #334155;
  background: #0F172A; color: #64748B; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
}
.mode-btn:hover { border-color: #475569; color: #94A3B8; }
.mode-btn.active { border-color: #3B82F6; background: #1E3A5F; color: #93C5FD; }
.campaign-actions { display: flex; gap: 8px; margin-top: 18px; }
.campaign-action-btn { flex: 1; padding: 11px 10px; }
#camp-send-btn {
  width: 100%; padding: 14px; margin-top: 10px;
  background: #1D4ED8; color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
#camp-send-btn:hover:not(:disabled) { background: #2563EB; }
#camp-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.draft-item {
  display: flex; align-items: center; gap: 8px;
  background: #0F172A; border: 1px solid #1E293B; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px;
}
.draft-item-main { flex: 1; min-width: 0; cursor: pointer; }
.draft-item-name { font-size: 13px; font-weight: 700; color: #E2E8F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draft-item-meta { font-size: 11px; color: #64748B; margin-top: 2px; }
.draft-delete-btn {
  background: none; border: none; color: #64748B; font-size: 14px;
  cursor: pointer; padding: 4px 6px; border-radius: 6px; flex-shrink: 0; transition: all 0.15s;
}
.draft-delete-btn:hover { color: #FCA5A5; background: #1A0000; }
.type-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.type-chip {
  padding: 7px 14px; border-radius: 20px; border: 1.5px solid #334155;
  background: #0F172A; color: #64748B; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
}
.type-chip.active-promo        { border-color: #3B82F6; background: #1E3A5F; color: #93C5FD; }
.type-chip.active-announcement { border-color: #10B981; background: #064E3B; color: #6EE7B7; }
.type-chip.active-info         { border-color: #8B5CF6; background: #2E1065; color: #C4B5FD; }
.type-chip.active-warning      { border-color: #F59E0B; background: #451A03; color: #FCD34D; }
.type-chip.active-marketing    { border-color: #10B981; background: #064E3B; color: #6EE7B7; }
.recipient-count { font-size: 28px; font-weight: 800; color: #F1F5F9; margin-bottom: 4px; }
.recipient-sublabel { font-size: 12px; color: #64748B; margin-bottom: 14px; }
.recipient-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.recipient-list::-webkit-scrollbar { width: 4px; }
.recipient-list::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.recipient-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: #0F172A; border-radius: 8px; border: 1px solid #1E293B;
}
.recipient-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: #1D4ED8;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.recipient-name { font-size: 13px; color: #CBD5E1; font-weight: 600; }
.recipient-email { font-size: 11px; color: #475569; }
#send-btn {
  width: 100%; padding: 14px; margin-top: 18px;
  background: #1D4ED8; color: #fff; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
#send-btn:hover:not(:disabled) { background: #2563EB; }
#send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.send-status { padding: 12px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-top: 12px; display: none; }
.send-status.success { background: #064E3B; color: #6EE7B7; border: 1px solid #065F46; }
.send-status.error   { background: #450A0A; color: #FCA5A5; border: 1px solid #991B1B; }
.history-empty { text-align: center; padding: 40px 20px; color: #475569; font-size: 14px; }
.history-item { background: #0F172A; border: 1px solid #1E293B; border-radius: 12px; padding: 16px 18px; margin-bottom: 10px; }
.history-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.history-subject { font-size: 15px; font-weight: 700; color: #F1F5F9; }
.history-meta { font-size: 11px; color: #475569; margin-top: 3px; }
.history-body { font-size: 13px; color: #94A3B8; line-height: 1.5; margin-top: 8px; white-space: pre-wrap; }
.history-stats { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.history-stat { font-size: 11px; color: #64748B; }
.history-stat strong { color: #CBD5E1; }

/* ── Activity ── */
.act-filter-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #1E293B; border: 1px solid #334155; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 4px;
}
.act-filter-label { font-size: 13px; color: #64748B; font-weight: 600; white-space: nowrap; }
.act-date-input { width: 160px !important; padding: 8px 12px !important; color-scheme: dark; }
.act-result-label { font-size: 13px; color: #64748B; margin-left: auto; }
.act-result-label strong { color: #F1F5F9; }

/* ── Marketing ── */
.mkt-templates-grid {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px;
}
.mkt-template-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 14px 16px; min-width: 110px;
  background: #1E293B; border: 1.5px solid #334155; border-radius: 14px;
  cursor: pointer; transition: all 0.15s; text-align: center;
}
.mkt-template-card:hover { border-color: #3B82F6; background: #1E3A5F; }
.mkt-template-active   { border-color: #10B981 !important; background: #064E3B !important; }
.mkt-template-icon { font-size: 24px; }
.mkt-template-name { font-size: 12px; font-weight: 700; color: #CBD5E1; }

.mkt-layout { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }

.mkt-filter-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.mkt-toggle-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #64748B; white-space: nowrap; cursor: pointer;
}
.mkt-toggle-label input[type="checkbox"] { accent-color: #3B82F6; cursor: pointer; }

.mkt-user-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid #334155;
}
.mkt-user-stat { font-size: 12px; color: #64748B; }
.mkt-quick-btn {
  padding: 5px 10px; border-radius: 8px; border: 1px solid #334155;
  background: #0F172A; color: #94A3B8; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.mkt-quick-btn:hover { border-color: #3B82F6; color: #93C5FD; }

.mkt-user-list {
  max-height: 440px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.mkt-user-list::-webkit-scrollbar { width: 4px; }
.mkt-user-list::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.mkt-group-label {
  font-size: 11px; font-weight: 700; color: #475569;
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 4px 4px 2px;
}

.mkt-user-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: #0F172A; border-radius: 8px;
  border: 1px solid #1E293B; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.mkt-user-row:hover { border-color: #334155; background: #111827; }
.mkt-user-selected { border-color: #1D4ED8 !important; background: #0C1A3A !important; }

.mkt-checkbox { accent-color: #3B82F6; width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }

#mkt-send-btn:hover:not(:disabled) { background: #047857 !important; }
#mkt-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  #sidebar {
    position: fixed; left: -220px; top: 0; height: 100%;
    border-right: none; box-shadow: 4px 0 20px rgba(0,0,0,0.4);
  }
  #sidebar.open { left: 0; }
  #hamburger-btn { display: block; }
  .topbar-right .admin-badge { display: none; }
  .content { padding: 14px 12px 60px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .chart-row-2, .chart-row-3 { grid-template-columns: 1fr; }
  .usage-row { grid-template-columns: 1fr; }
  .spark-label { width: 150px; }
  .broadcast-layout { grid-template-columns: 1fr; }
  .mkt-layout { grid-template-columns: 1fr; }
  .mkt-templates-grid { flex-wrap: nowrap; overflow-x: auto; }
  .mkt-user-header { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 480px) {
  .kpi-value { font-size: 26px; }
  .kpi-grid { gap: 8px; }
  .spark-label { width: 120px; }
  .spark-nums { display: none; }
}
