/* ============================================================
   COMPONENTS — reusable UI elements used across all app views
   ============================================================ */

/* ===== Brand mark (leaf logo container) ===== */
.mark {
  display: grid;
  place-items: center;
  flex: none;
  position: relative;
}
.mark svg { width: 62%; height: 62%; }

/* ===== Platform background colors ===== */
.bg-telegram { background: var(--telegram); }
.bg-tiktok   { background: var(--tiktok);   }
.bg-facebook { background: var(--facebook); }
.bg-youtube  { background: var(--youtube);  }
.bg-snapchat { background: var(--snapchat); color: var(--snapchat-text); }
.bg-live     { background: linear-gradient(135deg, var(--tiktok), var(--gold-2)); }

/* ===== Platform icon spots ===== */
.pIco {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
}
.pIco svg { width: 19px; height: 19px; }
.pIco.sm  { width: 42px; height: 42px; border-radius: 12px; }

/* Mini icon (table cells, offer cards) */
.pmini {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
}
.pmini svg { width: 15px; height: 15px; }

/* Publisher table cell layout */
.pubcell {
  display: flex;
  align-items: center;
  gap: 11px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 13px;
  font-weight: 700;
  font-size: 14.5px;
  transition: 0.18s cubic-bezier(.2,.7,.3,1);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }

.btn-green {
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 22px rgba(14,159,110,.32);
}
.btn-green:hover {
  background: var(--green-d);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(14,159,110,.4);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: #2a1c00;
  box-shadow: 0 8px 22px rgba(201,138,27,.3);
}
.btn-gold:hover { transform: translateY(-2px); }

.btn-dark {
  background: var(--ink-green);
  color: #fff;
}
.btn-dark:hover { transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--line-2);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--green);
  color: var(--green-d);
}

/* Ghost variant for dark backgrounds */
.btn-ghost--dark {
  color: #fff;
  border-color: rgba(255,255,255,.2);
}
.btn-ghost--dark:hover {
  border-color: var(--green);
  color: var(--green);
}

/* Size modifier */
.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 10px;
}

/* Full-width stretch */
.btn-full     { width: 100%; justify-content: center; }
/* Flex-fill within a flex row */
.btn-flex-full { flex: 1; justify-content: center; }

/* ===== Chips / status badges ===== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 30px;
}
.chip svg { width: 12px; height: 12px; }

/* Light-theme color variants */
.c-green { background: var(--green-soft); color: var(--green-d); }
.c-gold  { background: var(--gold-soft);  color: var(--gold);    }
.c-rose  { background: var(--rose-soft);  color: var(--rose);    }
.c-sky   { background: var(--sky-soft);   color: var(--sky);     }
.c-faint { background: #EFEDE3;           color: var(--muted);   }

/* Dark-theme chip variants (landing page) */
.chip--dark-green { background: rgba(14,159,110,.16);  color: #7FE6BC;  padding: 10px 18px; }
.chip--dark-muted { background: rgba(255,255,255,.06); color: #A9BBB0;  padding: 10px 18px; }
.chip--dark-note  { background: rgba(255,255,255,.06); color: #A9BBB0;  padding: 9px 16px;  }
.chip--dark-live  { background: rgba(229,168,46,.2);   color: #FBEFD6;  font-size: 10px;    }
.chip--glass-live { background: rgba(14,159,110,.18);  color: #7FE6BC;  }

/* ===== Card ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.pad             { padding: 24px; }
.pad--no-bottom  { padding-bottom: 0; }

/* ===== Stat cards grid ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat .ic {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 15px;
}
.stat .ic svg { width: 20px; height: 20px; }
.stat .sl     { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .sv     { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 600; margin-top: 3px; }
.stat .sd     { font-size: 12px; font-weight: 700; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; }

/* ===== Section title row (with optional "View all" link) ===== */
.section-title {
  font-size: 19px;
  font-weight: 600;
  font-family: 'Fraunces', serif;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title a {
  font-size: 13px;
  color: var(--green-d);
  font-weight: 700;
  font-family: 'Hanken Grotesk', sans-serif;
}

/* ===== Two-column content + sidebar split ===== */
.split2 {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 22px;
  align-items: start;
}

/* ===== Inline note / alert ===== */
.note {
  display: flex;
  gap: 12px;
  background: var(--gold-soft);
  border: 1px solid #F0DCAE;
  border-radius: 14px;
  padding: 15px 17px;
  font-size: 13px;
  color: #7C5908;
  align-items: flex-start;
}
.note svg { width: 18px; height: 18px; flex: none; color: var(--gold); margin-top: 1px; }
.note.green { background: var(--green-soft); border-color: #BBE6D2; color: var(--green-d); }
.note.green svg { color: var(--green); }

/* ===== Wallet card (dark gradient) ===== */
.wcard {
  background: linear-gradient(150deg, var(--forest), #143b2b);
  color: #fff;
  border-radius: 20px;
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.wcard::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -50px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229,168,46,.32), transparent 70%);
}
.wcard .wl  { font-size: 12.5px; color: #A9C2B5; font-weight: 600; }
.wcard .wv  { font-family: 'Fraunces', serif; font-size: 36px; font-weight: 600; margin: 6px 0 18px; }
.wcard .wsub { display: flex; gap: 26px; }
.wcard .wsl { font-size: 11.5px; color: #A9C2B5; }
.wcard .wsv { font-weight: 700; font-size: 15px; margin-top: 2px; }
.wcard--mb  { margin-bottom: 16px; }

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 5px;
  border-radius: 13px;
  border: 1px solid var(--line);
  width: max-content;
  margin-bottom: 22px;
}
.tab { padding: 9px 17px; border-radius: 9px; font-size: 13.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--ink-green); color: #fff; }

/* ===== Verified badge ===== */
.verified { display: inline-flex; align-items: center; gap: 3px; color: var(--green-d); font-weight: 700; font-size: 12px; }
.verified svg { width: 13px; height: 13px; }

/* ===== Publisher / discovery cards ===== */
.dgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.dcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: 0.2s;
}
.dcard:hover          { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.dcard--pending       { border-style: dashed; }
.dcard--live          { border-color: #F0DCAE; }
.dcard .dh            { padding: 18px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.dcard .dn            { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.dcard .dm            { font-size: 12px; color: var(--muted); }
.dcard .db            { padding: 18px; }
.dstat                { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.dstat .k             { color: var(--muted); }
.dstat .v             { font-weight: 700; }
.payout               { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600; color: var(--green-d); }

/* ===== Offer cards (publisher dashboard new offers) ===== */
.offer-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.offer-card:last-child { margin-bottom: 0; }
.offer-card .offer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.offer-card .offer-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* ===== Campaign builder layout ===== */
.builder {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Platform selector tiles */
.platsel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-bottom: 8px;
}
.plat {
  padding: 15px 13px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: 0.16s;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--surface);
}
.plat:hover   { border-color: var(--line-2); transform: translateY(-2px); }
.plat.sel     { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 4px rgba(14,159,110,.1); }
.plat .pIco.sm { width: 36px; height: 36px; border-radius: 10px; }
.plat .pn     { font-weight: 700; font-size: 14px; }
.plat .pm     { font-size: 11px; color: var(--muted); }

/* Form fields */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 9px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface-2);
  outline: none;
  transition: 0.15s;
}
.field input:focus,
.field textarea:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(14,159,110,.1);
}
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* Live view count display */
.viewval { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 600; }

/* ===== Cost summary sidebar ===== */
.summary {
  position: sticky;
  top: 90px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.summary .sumh {
  background: var(--ink-green);
  color: #fff;
  padding: 22px 24px;
}
.summary .sumh .lbl { color: #7E9388; }
.summary .sumtot {
  font-family: 'Fraunces', serif;
  font-size: 40px;
  font-weight: 600;
  margin-top: 6px;
  color: #fff;
}
.summary .sumtot small {
  font-size: 16px;
  color: var(--gold-2);
  font-weight: 600;
  font-family: 'Hanken Grotesk', sans-serif;
  vertical-align: middle;
}
.summary .sumcpm   { font-size: 13px; color: #A9C2B5; margin-top: 4px; }
.summary .sumbody  { background: var(--surface); padding: 22px 24px; }

/* Rows inside summary */
.srow        { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-size: 13.5px; }
.srow .k     { color: var(--muted); }
.srow .v     { font-weight: 700; }
.srow.div    { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 14px; }

/* Publisher share colored text */
#sumPub { color: var(--green-d); }

/* Summary action area */
.summary .sumbody .btn  { width: 100%; justify-content: center; margin-top: 16px; }
.summary .sumbody .note { margin-top: 14px; font-size: 12px; }

/* ===== Proof upload drop zone ===== */
.proofbox {
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
}
.proofbox svg            { width: 32px; height: 32px; color: var(--green); margin-bottom: 10px; }
.proofbox .proofbox-title { font-weight: 700; color: var(--ink); }
.proofbox .proofbox-sub   { font-size: 12px; margin-top: 4px; }

/* CPM price per-unit label */
.per { font-size: 14px; color: #9DB0A5; font-family: 'Hanken Grotesk', sans-serif; font-weight: 400; }

/* ===== Toast notifications ===== */
#toast-root {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(0,0,0,.3);
  transform: translateY(10px);
  opacity: 0;
  transition: opacity .22s, transform .22s;
  pointer-events: auto;
  max-width: 340px;
  border-left: 4px solid var(--green);
}
.toast--in  { opacity: 1; transform: none; }
.toast--err { border-left-color: var(--rose); }
.toast--warn { border-left-color: var(--gold-2); }

/* ===== Generic modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: var(--r);
  padding: 32px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.modal-box h3 {
  margin: 0 0 22px;
  font-family: 'Fraunces', serif;
  font-size: 22px;
  color: var(--ink);
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* ===== Sidebar mobile overlay ===== */
#sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}
#sb-overlay.sb-overlay--on { display: block; }

/* ===== Hamburger button (hidden on desktop) ===== */
.ham-btn { display: none; }

/* ===== Logout button in sidebar footer ===== */
.logout-btn {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: none;
  background: rgba(255,255,255,.08);
  color: #8FA398;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  transition: background .15s, color .15s;
}
.logout-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.logout-btn svg { width: 16px; height: 16px; }

/* ===== Admin avatar ===== */
.avi--admin { background: linear-gradient(135deg, #C9490A, #7B1C03); }

/* ===== Rose / danger button ===== */
.btn-rose {
  background: rgba(192,73,107,.12);
  color: var(--rose);
  border: 1px solid rgba(192,73,107,.25);
}
.btn-rose:hover { background: rgba(192,73,107,.2); }

/* ===== Admin action cell ===== */
.action-cell { display: flex; gap: 6px; flex-wrap: wrap; }
.role-select { font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }

/* ===== Theme picker ===== */
.theme-btn { position: relative; }
.theme-pop {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  z-index: 300;
  min-width: 200px;
}
.theme-pop.open { display: block; }
.theme-pop-title { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.theme-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: var(--green); }
.swatch--cream  { background: #F6F4EC; outline: 1.5px solid #d4d0c2; }
.swatch--white  { background: #FFFFFF; outline: 1.5px solid #e0e0e0; }
.swatch--ocean  { background: #EBF3F9; outline: 1.5px solid #b0cedc; }
.swatch--sage   { background: #EBF2ED; outline: 1.5px solid #b0ceb5; }
.swatch--dark   { background: #151a17; }
