/* ===========================================================================
   Advaxx AI — dashboard shell & components
   =========================================================================== */

.shell { display: flex; min-height: 100vh; background: var(--bg); position: relative; }

/* ------------------------------------------------------------------ sidebar */
.sidebar {
  width: 262px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 16px; padding: 20px 16px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 4px 6px 6px; }
.sidebar .brand-name { color: var(--ink); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); padding: 10px 12px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px;
  font-size: 13.5px; font-weight: 600; color: var(--muted); transition: background 0.12s, color 0.12s;
}
.nav-item i { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: #f6f7fb; color: #3a3d52; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.nav-item .badge {
  margin-left: auto; font-size: 11px; font-weight: 700; color: #fff; background: #e0344a;
  border-radius: 99px; padding: 1px 7px; min-width: 18px; text-align: center;
}
.sidebar .spacer { flex: 1; }
.side-user {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 13px;
  background: #fafafe; border: 1px solid var(--line);
}
.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--grad);
}
.side-user .who { min-width: 0; }
.side-user .who b { font-size: 13px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who span { font-size: 11.5px; color: var(--faint); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user a { margin-left: auto; color: var(--faint); display: flex; }
.side-user a:hover { color: var(--ink); }
.side-user a i { width: 17px; height: 17px; }

/* backdrop for mobile drawer */
.backdrop { display: none; }

/* ------------------------------------------------------------------- topbar */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; flex-shrink: 0; background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.burger { display: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2);
  background: #fff; align-items: center; justify-content: center; color: var(--ink); }
.burger i { width: 18px; height: 18px; }
.topbar h1 { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -0.5px; margin: 0; }
.topbar .grow { flex: 1; }
.topbar-search {
  position: relative; width: 280px; max-width: 34vw;
}
.topbar-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.topbar-search input {
  width: 100%; height: 40px; border: 1px solid var(--line-2); border-radius: 11px; background: #f8f9fd;
  padding: 0 12px 0 36px; font-size: 13.5px; color: var(--ink);
}
.topbar-search input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(45, 59, 240, 0.1); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line-2); background: #fff;
  display: flex; align-items: center; justify-content: center; color: var(--muted); position: relative; flex-shrink: 0;
}
.icon-btn:hover { background: #f6f7fb; border-color: #e2e4ef; }
.icon-btn i { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #e0344a; border: 2px solid #fff; }

/* wallet pill */
.topbar-wallet {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px;
  border-radius: 11px; border: 1px solid var(--line-2); background: #fff; flex-shrink: 0;
}
.topbar-wallet i, .topbar-wallet svg { width: 16px; height: 16px; color: var(--primary); }
.topbar-wallet span { font-family: var(--display); font-size: 14px; font-weight: 700; color: var(--ink); }
.topbar-wallet:hover { border-color: #e2e4ef; }

/* avatar tile */
.topbar-avatar {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; color: #fff; font-weight: 700;
  font-size: 13.5px; font-family: var(--display); background: var(--grad);
}

/* notification bell dropdown */
.topbar-bell { position: relative; }
.bell-dd {
  position: absolute; top: 50px; right: 0; width: 368px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 60px -16px rgba(20, 21, 42, 0.28); z-index: 60; overflow: hidden;
}
.bell-dd[hidden] { display: none; }
.bell-dd-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.bell-dd-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.bell-dd-count { font-size: 11px; font-weight: 700; color: #fff; background: #e0344a; border-radius: 99px; padding: 1px 7px; }
.bell-dd-mark { font-size: 12.5px; font-weight: 700; color: var(--primary); }
.bell-dd-list { max-height: 340px; overflow-y: auto; }
.bell-dd-item { display: flex; align-items: flex-start; gap: 11px; padding: 13px 16px; border-top: 1px solid #f4f5fa; }
.bell-dd-item:first-child { border-top: none; }
.bell-dd-item:hover { background: #fafafe; }
.bell-dd-ico { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.bell-dd-ico i, .bell-dd-ico svg { width: 17px; height: 17px; }
.bell-dd-body { flex: 1; min-width: 0; }
.bell-dd-row { display: flex; align-items: center; gap: 7px; }
.bell-dd-row b { font-size: 13px; font-weight: 700; color: var(--ink); }
.bell-dd-unread { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.bell-dd-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: var(--faint); margin-top: 3px; line-height: 1.45; }
.bell-dd-time { display: block; font-size: 11px; color: #a2a7bc; margin-top: 4px; }
.bell-dd-foot { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 13px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--primary); }
.bell-dd-foot i, .bell-dd-foot svg { width: 15px; height: 15px; }

/* notification icon tones (shared with notifications page) */
.n-approved  { background: #e5f6ec; color: #0e7a41; }
.n-running   { background: #eef0fe; color: #2d3bf0; }
.n-budget    { background: #fcf1dc; color: #9a5b00; }
.n-rejected  { background: #fce7ea; color: #b11f31; }
.n-completed { background: #eef1f6; color: #5c6679; }
.n-payment   { background: #f1eafe; color: #7b36f0; }

/* ------------------------------------------------------------------ content */
.scroll { padding: 26px 28px 48px; }
.page { max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: -0.6px; margin: 0 0 4px; }
.page-head p { font-size: 14px; color: var(--muted); margin: 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- greeting */
.greeting {
  position: relative; overflow: hidden; border-radius: 20px; color: #fff; padding: 26px 28px;
  background: var(--grad-brand); box-shadow: 0 20px 44px -18px rgba(78, 52, 224, 0.6);
  display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap;
}
.greeting .blob { position: absolute; border-radius: 50%; }
.greeting .blob.a { width: 320px; height: 320px; top: -150px; right: -60px; background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 65%); }
.greeting h2 { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.8px; margin: 0 0 6px; position: relative; }
.greeting p { font-size: 14.5px; color: rgba(255, 255, 255, 0.85); margin: 0; position: relative; max-width: 440px; }
.greeting .btn-primary { width: auto; background: #fff; color: var(--primary); box-shadow: 0 12px 26px -12px rgba(0,0,0,0.35); position: relative; }
.greeting .btn-primary:hover { transform: translateY(-1px); }

/* --------------------------------------------------------------- stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  animation: advFade 0.5s ease both;
}
.stat .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tile { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tile i { width: 19px; height: 19px; }
.tile.lg { width: 46px; height: 46px; border-radius: 13px; }
.tile.lg i { width: 22px; height: 22px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; }
.delta i { width: 12px; height: 12px; }
.stat .value { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.8px; line-height: 1; }
.stat .label { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

/* tone helpers */
.t-blue { background: var(--primary-soft); color: var(--primary); }
.t-green { background: var(--green-soft); color: var(--green); }
.t-amber { background: var(--amber-soft); color: var(--amber); }
.t-slate { background: var(--slate-soft); color: var(--slate); }
.t-purple { background: var(--purple-soft); color: var(--purple); }
.d-green { color: var(--green); background: var(--green-soft); }
.d-amber { color: var(--amber); background: var(--amber-soft); }
.d-slate { color: var(--slate); background: var(--slate-soft); }
.d-purple { color: #6a28e0; background: var(--purple-soft); }

/* ------------------------------------------------------------------- cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: -0.3px; margin: 0; }
.card-head a { font-size: 13px; font-weight: 600; color: var(--primary); display: inline-flex; align-items: center; gap: 4px; }
.card-head a i { width: 14px; height: 14px; }

.cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }

/* ------------------------------------------------------------------- table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--faint); padding: 12px 20px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.tbl tr:last-child td, .tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background 0.12s; }
.tbl tbody tr:hover { background: #fafafe; }
.tbl .name { font-weight: 700; color: var(--ink); }
.tbl .obj { font-size: 12px; color: var(--faint); margin-top: 2px; }
.cell-link { cursor: pointer; }

/* --------------------------------------------------------------- platforms */
.chips { display: flex; align-items: center; }
.chip {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; border: 2px solid #fff; flex-shrink: 0;
}
.chip + .chip { margin-left: -8px; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.badge .pulse { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.badge.live .pulse { animation: advPulse 1.6s ease-in-out infinite; }
.s-Running { background: var(--green-soft); color: var(--green); }
.s-Running .pulse { background: #15a05a; }
.s-Approved { background: var(--primary-soft); color: var(--primary); }
.s-Approved .pulse { background: #2d3bf0; }
.s-PendingReview { background: var(--amber-soft); color: var(--amber); }
.s-PendingReview .pulse { background: #e08a00; }
.s-Completed { background: var(--slate-soft); color: var(--slate); }
.s-Completed .pulse { background: #8b93a6; }
.s-Draft { background: #eef0f4; color: #6b7280; }
.s-Draft .pulse { background: #9aa0b0; }
.s-Paused { background: var(--amber-soft); color: var(--amber); }
.s-Paused .pulse { background: #e08a00; }
.s-Rejected { background: var(--red-soft); color: var(--red); }
.s-Rejected .pulse { background: #e0344a; }

/* ------------------------------------------------------------- breakdown */
.bd-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.bd-row + .bd-row { border-top: 1px solid var(--line); }
.bd-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.bd-row .lbl { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.bd-track { flex: 1; height: 7px; border-radius: 99px; background: #f0f1f6; overflow: hidden; }
.bd-fill { height: 100%; border-radius: 99px; }
.bd-row .cnt { font-size: 13px; font-weight: 700; color: var(--ink); min-width: 22px; text-align: right; }

/* ------------------------------------------------------------- filter tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 9px;
  font-size: 13px; font-weight: 700; color: var(--muted); transition: all 0.12s; white-space: nowrap;
}
.tab:hover { background: #f6f7fb; }
.tab.active { color: var(--primary); background: var(--primary-soft); }
.tab .n { font-size: 11px; font-weight: 700; color: var(--faint); background: #f0f1f6; border-radius: 99px; padding: 1px 7px; }
.tab.active .n { color: var(--primary); background: #fff; }

/* ----------------------------------------------------------------- toggles */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; }
.toggle-row + .toggle-row { border-top: 1px solid var(--line); }
.toggle-row .t-label { font-size: 14px; font-weight: 700; color: var(--ink); }
.toggle-row .t-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.switch { width: 42px; height: 24px; border-radius: 99px; padding: 2px; display: flex; flex-shrink: 0;
  background: #d5d8e4; transition: background 0.18s; cursor: pointer; }
.switch.on { background: var(--grad); justify-content: flex-end; }
.switch .knob { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20, 21, 42, 0.25); }

/* --------------------------------------------------------------- metric mini */
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.metric {
  border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; background: #fff;
}
.metric .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.metric .m-icon { width: 32px; height: 32px; border-radius: 9px; background: #f4f5fa; color: var(--slate); display: flex; align-items: center; justify-content: center; }
.metric .m-icon i { width: 16px; height: 16px; }
.metric .v { font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -0.5px; }
.metric .l { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ------------------------------------------------------------------ generic */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 13px; padding: 15px 20px; border-top: 1px solid var(--line); transition: background 0.12s; }
.list-row:first-child { border-top: none; }
.list-row:hover { background: #fafafe; }

.empty { text-align: center; padding: 60px 20px; color: var(--faint); }
.empty i { width: 34px; height: 34px; margin-bottom: 12px; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; height: 100vh;
    transform: translateX(-110%); transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 0 24px 60px rgba(20, 21, 42, 0.22); }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(20, 21, 42, 0.42); z-index: 40; backdrop-filter: blur(2px); }
  .burger { display: flex; }
  .topbar-search { display: none; }
  /* let the title flex/truncate so the wallet + bell + avatar always fit */
  .topbar { padding: 0 16px; }
  .topbar .grow { display: none; }
  .topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2, .metric-grid { grid-template-columns: 1fr; }
  .scroll { padding: 18px 16px 40px; }
  .greeting { flex-direction: column; align-items: flex-start; }
  .card-head { flex-wrap: wrap; }
  .page-head { gap: 12px; }
}
@media (max-width: 460px) {
  .stat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  /* campaign details header: stack title above the action buttons */
  .detail-head { flex-direction: column; align-items: stretch; }
  .detail-actions { width: 100%; }
  .detail-actions .btn { flex: 1; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar h1 { font-size: 16px; }
  .topbar-wallet { padding: 0 10px; gap: 5px; }
  .topbar-wallet span { font-size: 13px; }
  .bell-dd { width: 320px; }
}
@media (max-width: 380px) {
  /* on very narrow phones drop the wallet amount label, keep the icon */
  .topbar-wallet span { display: none; }
  .topbar-wallet { padding: 0; width: 40px; justify-content: center; }
}

/* ===========================================================================
   Lucide <svg> mirrors (see styles.css note).
   =========================================================================== */
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.tile svg { width: 19px; height: 19px; }
.tile.lg svg { width: 22px; height: 22px; }
.burger svg { width: 18px; height: 18px; }
.icon-btn svg { width: 18px; height: 18px; }
.topbar-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.delta svg { width: 12px; height: 12px; }
.card-head a svg { width: 14px; height: 14px; }
.metric .m-icon svg { width: 16px; height: 16px; }
.empty svg { width: 34px; height: 34px; margin-bottom: 12px; }
.side-user a svg { width: 17px; height: 17px; }
.btn svg { width: 17px; height: 17px; }
.btn-sm svg { width: 16px; height: 16px; }
.link svg { vertical-align: middle; }
.step .dot svg { width: 18px; height: 18px; }
