/* ============================================================
   Creator Shout - admin dashboard page styles
   Uses shared theme vars/classes from css/main.css
   ============================================================ */

/* ---------- Passcode gate ---------- */

/* Dashboards: all grey/muted text renders white */
:root { --muted: #fff; --muted-2: #fff; }
.gate {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(5,5,18,.86); backdrop-filter: blur(14px);
  transition: opacity .4s ease, visibility .4s;
}
.gate.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
/* Signed-out visitors never see the dashboard shell: it stays hidden until
   a valid admin session unlocks it. */
body.gated .topbar, body.gated .main, body.gated #sidebar,
body.gated #sidebar-scrim, body.gated #drawer { display: none !important; }
.gate-card { width: 100%; max-width: 420px; text-align: center; }
.gate-card h2 { font-size: 1.9rem; margin-bottom: 8px; }
.gate-sub { color: var(--muted); margin-bottom: 22px; }
.gate-note { margin-top: 18px; font-size: .8rem; color: var(--muted-2); }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-10px)} 40%{transform:translateX(10px)} 60%{transform:translateX(-7px)} 80%{transform:translateX(7px)} }
.gate-card.shake { animation: shake .4s ease; border-color: rgba(248,113,113,.6); }
.auth-error { display: none; color: #ff8a8a; font-size: .88rem; text-align: center; margin: 12px 0 0; }
.bio-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: rgba(139,92,246,.1); border: 1px solid rgba(139,92,246,.35); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 20px; font-size: .9rem; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px;
  background: rgba(7,7,26,.8); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
}
.topbar-logo { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.clock { font-family: var(--font-head); font-weight: 600; color: var(--muted); font-size: .95rem; min-width: 88px; text-align: right; }
.hamburger { display: none; background: none; border: 1px solid var(--card-border); border-radius: 10px; padding: 9px 11px; cursor: pointer; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }

/* ---------- Dashboard switcher pills (mirrors the back-office) ---------- */
.role-pills { display: flex; gap: 6px; background: rgba(0,0,0,.35);
  border: 1px solid var(--card-border); border-radius: 999px; padding: 4px; }
.role-pills a {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--font-head); font-weight: 700; font-size: .82rem; text-decoration: none;
  padding: 8px 18px; border-radius: 999px; transition: all .2s; white-space: nowrap;
}
.role-pills a.active { background: var(--gradient); color: #fff;
  box-shadow: 0 4px 14px rgba(124,58,237,.5); }

/* ---------- Emails tab: provider filter pills ---------- */
.email-filters { display: inline-flex; gap: 6px; background: rgba(0,0,0,.35);
  border: 1px solid var(--card-border); border-radius: 999px; padding: 4px; margin: 4px 0 18px; }
.email-filter {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--font-head); font-weight: 700; font-size: .82rem;
  padding: 8px 18px; border-radius: 999px; transition: all .2s; white-space: nowrap;
}
.email-filter.is-on { background: var(--gradient); color: #fff;
  box-shadow: 0 4px 14px rgba(124,58,237,.5); }

/* ---------- Shell / sidebar ---------- */
.admin-shell { display: flex; min-height: calc(100vh - 66px); }
.sidebar {
  width: 250px; flex-shrink: 0; padding: 24px 16px;
  border-right: 1px solid var(--card-border);
  background: rgba(10,10,32,.55); backdrop-filter: blur(10px);
  display: flex; flex-direction: column; justify-content: space-between;
  position: sticky; top: 66px; height: calc(100vh - 66px);
}
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: none; cursor: pointer; text-align: left;
  color: var(--muted); font-family: var(--font-head); font-weight: 600; font-size: .98rem;
  padding: 13px 16px; border-radius: 12px; margin-bottom: 6px;
  transition: background .2s, color .2s, transform .15s;
}
.nav-item:hover { background: rgba(139,92,246,.1); color: var(--text); }
a.nav-item { text-decoration: none; }
.nav-item.active { background: var(--gradient); color: #fff; box-shadow: 0 6px 22px rgba(124,58,237,.4); }
.nav-ico { font-size: 1.1rem; width: 22px; text-align: center; }
.nav-count { margin-left: auto; font-size: .72rem; font-weight: 700; background: rgba(139,92,246,.2);
  border: 1px solid rgba(139,92,246,.4); border-radius: 999px; padding: 2px 10px; }
.nav-item.active .nav-count { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.35); }
.sidebar-foot { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.sidebar nav { flex: 1; min-height: 0; overflow-y: auto; }
.sidebar-scrim { display: none; }

/* ---------- Main panels ---------- */
.main { flex: 1; padding: 32px; max-width: 1200px; min-width: 0; }
.panel { display: none; animation: fadeUp .35s ease; }
.panel.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
.panel-title { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; margin-bottom: 6px; }
.panel-sub { color: var(--muted); margin-bottom: 26px; }
.subhead { margin: 30px 0 14px; font-size: 1.15rem; display: flex; align-items: center; gap: 12px; }

/* ---------- Stat cards ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { padding: 22px; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient); opacity: .7; }
.stat-card.accent { border-color: rgba(139,92,246,.55); box-shadow: var(--glow); }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-family: var(--font-head); font-size: 1.9rem; font-weight: 800; }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.stat-value.flash { animation: pulse .5s ease; color: var(--cyan); }

/* ---------- Charts ---------- */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.chart-card h3 { margin-bottom: 14px; font-size: 1.05rem; }
.chart { width: 100%; height: 240px; display: block; }

/* ---------- Activity feed ---------- */
.activity-feed { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.activity-feed li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 6px; border-bottom: 1px solid rgba(139,92,246,.12); font-size: .95rem; }
.activity-feed li:last-child { border-bottom: none; }
.activity-feed .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gradient); margin-top: 7px; flex-shrink: 0; box-shadow: 0 0 10px rgba(139,92,246,.8); }
.activity-feed time { margin-left: auto; color: var(--muted-2); font-size: .8rem; white-space: nowrap; flex-shrink: 0; }

/* ---------- Tables ---------- */
.toolbar { margin-bottom: 16px; max-width: 420px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--card); backdrop-filter: blur(14px); }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: .93rem; }
.data-table th, .data-table td { padding: 14px 16px; text-align: left; white-space: nowrap; }
.data-table thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); border-bottom: 1px solid var(--card-border); cursor: pointer; user-select: none; }
.data-table thead th:hover { color: var(--text); }
.data-table tbody tr { border-bottom: 1px solid rgba(139,92,246,.1); transition: background .15s; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.clickable:hover { background: rgba(139,92,246,.08); }
.sort-arrow { color: var(--purple-light); font-size: .7rem; }
.role-badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 5px 12px; border-radius: 999px; }
.role-badge.creator { background: rgba(139,92,246,.16); color: var(--purple-light); border: 1px solid rgba(139,92,246,.45); }
.role-badge.advertiser { background: rgba(59,130,246,.14); color: #93c5fd; border: 1px solid rgba(59,130,246,.45); }
.status-dot { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .88rem; }
.status-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; }
.status-dot.active::before { background: #34d399; box-shadow: 0 0 10px rgba(52,211,153,.8); }
.status-dot.suspended::before { background: #f87171; box-shadow: 0 0 10px rgba(248,113,113,.8); }
.status-dot.paid::before { background: #34d399; box-shadow: 0 0 10px rgba(52,211,153,.8); }
.status-dot.rejected::before, .status-dot.banned::before { background: #f87171; }
.row-actions { display: flex; gap: 8px; }
.btn-xs { padding: 7px 14px; font-size: .78rem; border-radius: 999px; font-family: var(--font-head); font-weight: 700; cursor: pointer; border: none; transition: transform .15s, box-shadow .2s; }
.btn-xs:hover { transform: translateY(-2px); }
.btn-approve { background: linear-gradient(135deg, #10b981, #34d399); color: #04120c; box-shadow: 0 4px 16px rgba(16,185,129,.35); }
.btn-reject { background: rgba(248,113,113,.14); color: #fca5a5; border: 1px solid rgba(248,113,113,.5); }

/* ---------- Note banner ---------- */
.note-strip { background: var(--gradient-soft); border: 1px solid var(--card-border); border-radius: 12px;
  padding: 14px 20px; margin-bottom: 8px; font-weight: 600; color: var(--purple-light); }

/* ---------- Reports ---------- */
.reports-list { display: flex; flex-direction: column; gap: 14px; }
.report-card { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 20px 22px; }
.report-info { flex: 1; min-width: 220px; }
.report-info .reason { font-weight: 700; margin-bottom: 4px; }
.report-info .meta { color: var(--muted); font-size: .88rem; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Moderation ---------- */
.mod-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.mod-card { overflow: hidden; padding: 0; }
.creative-thumb { height: 130px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; letter-spacing: .05em; color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.creative-thumb.t1 { background: linear-gradient(135deg, #7c3aed, #2563eb); }
.creative-thumb.t2 { background: linear-gradient(135deg, #0ea5e9, #22d3ee); }
.creative-thumb.t3 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.creative-thumb.t4 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.mod-body { padding: 20px 22px; }
.mod-body .who { font-weight: 700; margin-bottom: 4px; }
.mod-body .slot { color: var(--muted); font-size: .88rem; margin-bottom: 4px; }
.mod-body .flag { color: #fca5a5; font-size: .85rem; font-weight: 600; margin-bottom: 14px; }
.mod-actions { display: flex; gap: 8px; }
.mod-actions .btn-xs { flex: 1; }

/* ---------- Drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 210; background: rgba(4,4,16,.6); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.drawer-scrim.open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 220; width: min(420px, 92vw);
  background: rgba(14,14,38,.97); border-left: 1px solid var(--card-border);
  transform: translateX(105%); transition: transform .38s cubic-bezier(.2,.9,.3,1);
  padding: 28px 26px; overflow-y: auto; box-shadow: -20px 0 60px rgba(0,0,0,.5); }
.drawer.open { transform: translateX(0); }
.drawer-close { position: absolute; top: 18px; right: 18px; background: none; border: 1px solid var(--card-border);
  color: var(--text); border-radius: 10px; width: 36px; height: 36px; cursor: pointer; font-size: .95rem; }
.drawer-close:hover { background: rgba(139,92,246,.15); }
.drawer-profile { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.drawer-profile img { width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--purple); box-shadow: var(--glow); }
.drawer-profile h3 { font-size: 1.25rem; }
.drawer-profile .email { color: var(--muted); font-size: .88rem; }
.drawer-sec { margin-bottom: 22px; }
.drawer-sec h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 10px; }
.drawer-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drawer-stat { background: rgba(139,92,246,.08); border: 1px solid var(--card-border); border-radius: 12px; padding: 12px 14px; }
.drawer-stat .v { font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; }
.drawer-stat .k { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.drawer-activity { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; color: var(--muted); }
.drawer-actions { display: flex; flex-direction: column; gap: 10px; }
.drawer-actions .btn { width: 100%; }

/* ---------- Modal extras ---------- */
#modal-body textarea { min-height: 120px; resize: vertical; margin: 14px 0; }
#modal-body .btn { width: 100%; }
.fake-url { display: block; margin: 14px 0; padding: 14px 16px; background: rgba(0,0,0,.35);
  border: 1px dashed rgba(139,92,246,.5); border-radius: 12px; color: var(--cyan);
  font-family: monospace; font-size: .92rem; word-break: break-all; }

/* ---------- Settings ---------- */
.settings-card { max-width: 760px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 26px; }
.toggles { display: flex; flex-direction: column; gap: 6px; margin-bottom: 26px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px;
  border-bottom: 1px solid rgba(139,92,246,.12); font-weight: 600; cursor: pointer; }
.toggle-row em { font-style: normal; color: var(--muted-2); font-size: .85rem; }
.toggle { width: 54px; height: 30px; border-radius: 999px; border: 1px solid var(--card-border);
  background: rgba(0,0,0,.4); cursor: pointer; position: relative; transition: background .25s, border .25s; flex-shrink: 0; }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #7c79a8; transition: left .25s, background .25s; }
.toggle.on { background: var(--gradient); border-color: transparent; box-shadow: 0 4px 16px rgba(124,58,237,.45); }
.toggle.on .knob { left: 27px; background: #fff; }
.settings-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .main { padding: 22px 16px; }
}
@media (max-width: 768px) {
  /* Compact two-row topbar: controls row, then full-width dashboard pills. */
  .topbar { flex-wrap: wrap; gap: 10px; }
  .role-pills { order: 5; flex: 1 1 100%; }
  .role-pills a { flex: 1; text-align: center; padding: 8px 10px; font-size: .76rem; }
  .hamburger { display: block; }
  .clock { display: none; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 210; height: 100vh;
    transform: translateX(-105%); transition: transform .35s cubic-bezier(.2,.9,.3,1); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 200; background: rgba(4,4,16,.6);
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
  .sidebar-scrim.open { opacity: 1; visibility: visible; }
  .settings-grid { grid-template-columns: 1fr; }
  .topbar { padding: 12px 14px; }
  .topbar .btn-sm { padding: 8px 14px; font-size: .78rem; }
}

/* ---------- Push broadcast composer ---------- */
.push-grid { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 920px; }
@media (min-width: 960px) { .push-grid { grid-template-columns: 1.1fr .9fr; } }
.push-grid .lbl { display: block; margin-bottom: 6px; }
.push-preview { display: flex; gap: 12px; align-items: flex-start; background: rgba(0,0,0,.35);
  border: 1px solid rgba(139,92,246,.3); border-radius: 14px; padding: 14px; margin: 12px 0; }
.push-preview img { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
.push-preview-title { font-weight: 800; font-size: .92rem; }
.push-preview-body { color: var(--muted); font-size: .85rem; margin-top: 2px; word-break: break-word; }
.push-preview-image { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
/* ---------- Push Alerts tab (editable automatic alerts) ---------- */
#panel-push .hidden { display: none !important; }
#push-tabs { margin-bottom: 4px; }
.push-alerts-grid { display: grid; grid-template-columns: 1fr; gap: 14px; max-width: 920px; }
@media (min-width: 960px) { .push-alerts-grid { grid-template-columns: 1fr 1fr; } }
.push-alert-card .lbl { display: block; margin-bottom: 6px; }
.push-alert-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.push-alert-head h3 { margin: 0 0 2px; font-size: 1rem; }
.push-alert-key { font-family: ui-monospace, monospace; font-size: .72rem; color: var(--muted); word-break: break-all; }
.push-alert-group { flex-shrink: 0; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border: 1px solid rgba(139,92,246,.35); border-radius: 999px; padding: 4px 10px; }
.push-alert-imgrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.push-alert-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.push-alert-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.push-alert-status { font-size: .82rem; color: var(--muted); }
.push-alert-status.err { color: #f87171; }
.push-alert-vars { word-break: break-word; }
/* ---------- Push "To" recipient picker ---------- */
.push-to-wrap { position: relative; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chips:empty { margin-bottom: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(139,92,246,.18);
  border: 1px solid rgba(139,92,246,.45); border-radius: 999px; padding: 4px 6px 4px 12px;
  font-size: .8rem; font-weight: 600; }
.chip button { background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: .9rem; line-height: 1; padding: 2px 6px; border-radius: 999px; }
.chip button:hover { color: #fff; background: rgba(255,255,255,.12); }
.drop { position: absolute; top: 100%; left: 0; right: 0; z-index: 40; background: #141432;
  border: 1px solid rgba(139,92,246,.4); border-radius: 10px; margin-top: 4px; overflow: hidden;
  max-height: 220px; overflow-y: auto; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.drop-item { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px; cursor: pointer; font-size: .85rem; }
.drop-item:hover { background: rgba(139,92,246,.15); }
.drop-item .sub { color: var(--muted); font-size: .75rem; }
.drop-empty { padding: 10px 12px; color: var(--muted); font-size: .85rem; }
.drop.hidden { display: none; }

/* ---------- Bulletin composer ---------- */
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  background: rgba(0,0,0,.3); border: 1px solid rgba(139,92,246,.3);
  border-radius: 10px 10px 0 0; padding: 8px; }
.rte-toolbar button { background: rgba(139,92,246,.12); border: 1px solid transparent;
  color: var(--text); border-radius: 8px; min-width: 32px; height: 32px; padding: 0 8px;
  font-size: .85rem; cursor: pointer; }
.rte-toolbar button:hover { background: rgba(139,92,246,.3); border-color: rgba(139,92,246,.4); }
.rte-toolbar select { background: #141432; color: var(--text); border: 1px solid rgba(139,92,246,.3);
  border-radius: 8px; height: 32px; padding: 0 6px; font-size: .8rem; max-width: 110px; cursor: pointer; }
.rte-sep { width: 1px; height: 24px; background: rgba(139,92,246,.3); margin: 0 2px; }
.rte-color { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 32px; border-radius: 8px; background: rgba(139,92,246,.12);
  font-weight: 800; font-size: .85rem; cursor: pointer; overflow: hidden; }
.rte-color:hover { background: rgba(139,92,246,.3); }
.rte-hl { background: rgba(139,92,246,.35); }
.rte-color input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rte-editor { min-height: 220px; max-height: 480px; overflow-y: auto;
  background: rgba(0,0,0,.25); border: 1px solid rgba(139,92,246,.3); border-top: none;
  border-radius: 0 0 10px 10px; padding: 14px; font-size: .95rem; line-height: 1.6; outline: none; }
.rte-editor:empty:before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.rte-editor img { max-width: 100%; border-radius: 10px; margin: 8px 0; }
.rte-editor a { color: var(--cyan); }
.rte-editor .bul-btn { display: inline-block; background: var(--gradient); color: #fff !important;
  padding: 10px 22px; border-radius: 999px; font-weight: 700; text-decoration: none; margin: 8px 0; }
.rte-editor ul, .rte-editor ol { padding-left: 24px; margin: 8px 0; }
.rte-editor hr { border: none; border-top: 1px solid rgba(139,92,246,.35); margin: 14px 0; }
.bul-item { border: 1px solid rgba(139,92,246,.25); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 10px; background: rgba(0,0,0,.25); }
.bul-item .subj { font-weight: 700; font-size: .95rem; }
.bul-item .meta { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.bul-item .row { display: flex; gap: 8px; margin-top: 10px; }
.bul-item .btn-xs { font-size: .75rem; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(139,92,246,.4); background: rgba(139,92,246,.12); color: var(--text); }
.bul-item .btn-xs.danger { border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.12); }
.bul-item .btn-xs:hover { filter: brightness(1.25); }

/* ---------- Collapsible sidebar ---------- */
@media (min-width: 769px) {
  .sidebar { position: relative; }
}
.sidebar-tab {
  position: absolute; top: 80px; right: -14px; z-index: 5;
  width: 28px; height: 48px; border-radius: 0 10px 10px 0;
  background: #1a1a3a; border: 1px solid var(--card-border); border-left: 0;
  color: #a78bfa; cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.sidebar-tab:hover { background: #23234d; color: #fff; }
.sidebar.collapsed { width: 64px; padding: 24px 8px; }
.sidebar.collapsed .nav-item {
  font-size: 0; justify-content: center; padding: 13px 0;
}
.sidebar.collapsed .nav-ico { font-size: 1.15rem; width: auto; }
.sidebar.collapsed .nav-count,
.sidebar.collapsed .sidebar-foot .btn { display: none; }
.sidebar.collapsed .sidebar-tab .tab-ico { transform: rotate(180deg); display: inline-block; }
@media (max-width: 768px) {
  .sidebar-tab { display: none; }
  .sidebar.collapsed { width: 250px; padding: 24px 16px; }
  .sidebar.collapsed .nav-item { font-size: .98rem; justify-content: flex-start; padding: 13px 16px; }
  .sidebar.collapsed .nav-count { display: inline-block; }
}

/* ---------- Emails tab ---------- */
.badge.ok { background: rgba(52,211,153,.14); color: #34d399;
  border: 1px solid rgba(52,211,153,.4); box-shadow: none; }
.badge.warn { background: rgba(251,191,36,.14); color: #fbbf24;
  border: 1px solid rgba(251,191,36,.4); box-shadow: none; }
.email-card { margin-bottom: 16px; }
.email-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.email-head { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.email-head .hint { margin: 0; }
.email-badges { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.email-body { width: 100%; resize: vertical; min-height: 180px; font-family: inherit;
  line-height: 1.6; }
.email-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.email-foot .email-msg { color: var(--cyan, #22d3ee); }
.email-upd { margin-left: auto; }

/* ---------- Accounts: create form + member picker ---------- */
.create-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .create-grid { grid-template-columns: repeat(2, 1fr); } }
.drop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
  background: #171740; border: 1px solid rgba(139,92,246,.45); border-radius: 12px;
  max-height: 260px; overflow: auto; box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.drop.hidden { display: none; }
.drop-item { display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.05); }
.drop-item:hover { background: rgba(139,92,246,.12); }
.drop-item .sub { font-size: .8rem; color: var(--muted); }
.drop-item span:last-child { font-size: .8rem; color: var(--violet); white-space: nowrap; }
.drop-empty { padding: 12px 14px; color: var(--muted); font-size: .9rem; }
.drawer-avatar { width: 56px; height: 56px; border-radius: 16px; flex: 0 0 56px;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  font-weight: 800; color: #fff; background: linear-gradient(135deg, #7c3aed, #4c1d95); }

/* ---------- Gamify ---------- */
.gam-row { display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.06); flex-wrap: wrap; }
.gam-row:last-child { border-bottom: 0; }
.gam-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gam-img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover;
  background: rgba(139,92,246,.12); flex: 0 0 48px; }
.gam-img.gam-none { display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 1.2rem; }
.gam-name { font-weight: 700; }
.gam-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.gam-actions { display: flex; gap: 8px; }
.gam-imgrow { display: flex; align-items: center; gap: 12px; }
.gam-imgrow .input[type="file"] { flex: 1; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; }
.checkline input { width: 18px; height: 18px; accent-color: #8b5cf6; }
.badge.title { background: rgba(34,211,238,.14); color: #22d3ee; border: 1px solid rgba(34,211,238,.4); }
.badge.badge { background: rgba(251,191,36,.14); color: #fbbf24; border: 1px solid rgba(251,191,36,.4); }
#gam-form-card { margin-bottom: 16px; }

/* ---------- Audience review ---------- */
.aud-card { margin-bottom: 16px; }
.aud-row { display: flex; gap: 16px; flex-wrap: wrap; }
.aud-shot { display: block; width: 100%; max-width: 280px; border-radius: 12px;
  overflow: hidden; border: 1px solid rgba(139,92,246,.35); flex: 0 0 auto; }
.aud-shot img { display: block; width: 100%; height: auto; }
.aud-none { display: flex; align-items: center; justify-content: center; min-height: 120px;
  color: var(--muted); font-size: .9rem; background: rgba(255,255,255,.03); }
.aud-info { flex: 1 1 220px; min-width: 0; }
.aud-name { font-size: 1.1rem; font-weight: 800; }
.aud-meta { font-size: .88rem; color: var(--muted); margin-top: 4px; }
.aud-actions { display: flex; gap: 10px; margin-top: 14px; }
.status-dot.pending::before { background: #fbbf24; box-shadow: 0 0 10px rgba(251,191,36,.8); }
.status-dot.confirmed::before { background: #34d399; box-shadow: 0 0 10px rgba(52,211,153,.8); }
.status-dot.rejected::before { background: #f87171; box-shadow: 0 0 10px rgba(248,113,113,.8); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
