/* ==========================================================================
   Sahyog app design system — shared by dashboard, campaigns, profile, settings,
   admin and all signed-in pages. Warm ink neutrals, one marigold accent, editorial serif headings.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #11100e;
  --bg-elev: #171513;
  --surface: #181614;
  --surface-2: #1f1c19;
  --surface-3: #27231f;
  --border: #2a2622;
  --border-strong: #3a342e;
  --text: #f4f0ea;
  --text-2: #d6cfc5;
  --muted: #a69d91;
  --subtle: #80786e;
  --accent: #f4b23c;
  --accent-ink: #231603;
  --accent-2: #48b5a6;
  --accent-3: #48b5a6;
  --accent-soft: rgba(244, 178, 60, 0.12);
  --ring: rgba(244, 178, 60, 0.6);
  --success: #7fcf9f;
  --warning: #f4b23c;
  --danger: #ef8a78;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset;
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  --grad: #f4b23c;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sidebar-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { width: 100%; overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  width: 100%;
  min-width: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .88 0 0 0 .04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img, svg { max-width: 100%; height: auto; }
::selection { background: rgba(244, 178, 60, 0.35); color: #fff; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
input, select, textarea { color-scheme: dark; font-size: 16px; font-family: inherit; }
.num { font-variant-numeric: tabular-nums; }
.break-anywhere { overflow-wrap: anywhere; word-break: break-word; }
.tap-target { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.text-gradient { color: var(--accent); }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Legacy helpers kept for older markup */
.glass { background: var(--surface); border: 1px solid var(--border); }
.orb, .orb-layer { display: none; }

/* ------------------------------------------------------------------ shell */
.app-shell { min-height: 100vh; position: relative; z-index: 1; display: flex; }
.app-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  display: none;
  flex-direction: column;
  padding: 1.1rem 0.85rem 1rem;
  border-right: 1px solid var(--border);
  background: #141210;
  z-index: 30;
  overflow-y: auto;
}
.brand-link { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0.55rem; text-decoration: none; color: var(--text); }
.brand-link img { width: 32px; height: 32px; object-fit: contain; }
.brand-name { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.beta-pill {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.12em; color: var(--accent-ink);
  padding: 0.16rem 0.42rem; border-radius: 5px; background: var(--accent); border: 0;
}
.nav-section-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--subtle); padding: 1.1rem 0.8rem 0.4rem;
}
.app-sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 0.4rem; }
.app-nav-link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.8rem; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease; min-height: 40px; position: relative;
  border: 1px solid transparent;
}
.app-nav-link i { width: 18px; text-align: center; font-size: 0.92rem; opacity: 0.9; }
.app-nav-link:hover { color: var(--text); background: var(--surface-2); }
.app-nav-link.active {
  color: #fff;
  background: var(--surface-3);
  border-color: var(--border-strong);
  box-shadow: inset 3px 0 0 var(--accent);
}
.app-nav-link.active i { color: var(--accent); }
.nav-count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--accent-ink); background: var(--accent);
}
.sidebar-card {
  margin: 1rem 0.35rem 0; padding: 0.9rem; border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}
.sidebar-foot { margin-top: auto; padding: 0.9rem 0.5rem 0; border-top: 1px solid var(--border); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.7rem 1rem; min-height: 64px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 16, 14, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.app-content { position: relative; padding: 1.25rem 1rem 3rem; width: 100%; max-width: 1180px; margin: 0 auto; }
.app-footer {
  max-width: 1180px; width: 100%; margin: 0 auto; padding: 1.25rem 1rem 2rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; justify-content: space-between;
  font-size: 12px; color: var(--subtle); border-top: 1px solid var(--border);
}
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--text); }

.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s ease;
}
.icon-btn:hover { background: var(--surface-2); color: #fff; }
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
  color: var(--accent-ink); background: var(--accent); border: 2px solid var(--bg);
}
.account-btn {
  display: flex; align-items: center; gap: 0.55rem; min-height: 42px;
  padding: 0.2rem 0.65rem 0.2rem 0.2rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; color: var(--text);
  transition: background 0.15s ease;
}
.account-btn:hover { background: var(--surface-2); }

/* ------------------------------------------------------------------ surfaces */
.app-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.app-card.tight { padding: 0.9rem; }
.app-card.hover { transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease; }
.app-card.hover:hover { border-color: var(--border-strong); background: var(--surface-2); }
.card-title { font-weight: 750; color: #fff; font-size: 1rem; letter-spacing: -0.01em; }
.card-sub { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.divider { height: 1px; background: var(--border); margin: 1rem 0; border: 0; }
.hero-card {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 3px 0 var(--accent);
}

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.page-title { font-family: var(--serif); font-optical-sizing: auto; font-size: clamp(1.65rem, 3.4vw, 2.15rem); font-weight: 600; letter-spacing: -0.02em; color: #fff; line-height: 1.12; }
.page-sub { color: var(--muted); margin-top: 0.35rem; font-size: 0.95rem; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.crumbs { display: flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; color: var(--subtle); margin-bottom: 0.6rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: #fff; }

/* stats */
.stat-grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card {
  border-radius: var(--radius); padding: 1rem; background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.35rem; min-width: 0;
}
.stat-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 0.45rem; }
.stat-label i { font-size: 0.75rem; }
.stat-value { font-family: var(--serif); font-size: 1.75rem; font-weight: 600; color: #fff; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-hint { font-size: 0.75rem; color: var(--subtle); }
.stat-icon {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 42px; padding: 0.6rem 1.05rem; border-radius: 11px;
  font-weight: 700; font-size: 0.9rem; line-height: 1.1; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease, filter 0.15s ease;
  white-space: nowrap; user-select: none;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-sm { min-height: 34px; padding: 0.4rem 0.75rem; font-size: 0.8rem; border-radius: 9px; }
.btn-lg { min-height: 50px; padding: 0.8rem 1.4rem; font-size: 1rem; border-radius: 13px; }
.btn-block { width: 100%; }
.btn-primary, .btn.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 42px; padding: 0.6rem 1.05rem; border-radius: 11px; font-weight: 700; font-size: 0.9rem;
  color: var(--accent-ink); background: var(--accent);
  border: 1px solid #f8c661; text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  transition: filter 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }
.btn-secondary, .btn.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 42px; padding: 0.6rem 1.05rem; border-radius: 11px; font-weight: 650; font-size: 0.9rem;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong);
  text-decoration: none; cursor: pointer; transition: background 0.15s ease;
}
.btn-secondary:hover { background: var(--surface-3); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 38px; padding: 0.5rem 0.8rem; border-radius: 10px; font-weight: 650; font-size: 0.875rem;
  color: var(--muted); background: transparent; border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn-ghost:hover { color: #fff; background: var(--surface-2); }
.btn-white {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 42px; padding: 0.6rem 1.1rem; border-radius: 11px; font-weight: 750; font-size: 0.9rem;
  color: #1a1714; background: #f4f0ea; border: 1px solid #f4f0ea; cursor: pointer; text-decoration: none;
}
.btn-white:hover { background: #e2e8f0; }
.btn-danger, .btn.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 42px; padding: 0.6rem 1.05rem; border-radius: 11px; font-weight: 650; font-size: 0.9rem;
  color: #fecaca; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3);
  text-decoration: none; cursor: pointer;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.18); }
.btn-success {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 42px; padding: 0.6rem 1.05rem; border-radius: 11px; font-weight: 700; font-size: 0.9rem;
  color: #0d2417; background: #7fcf9f; border: 1px solid #7fcf9f; cursor: pointer;
}
.btn-success:hover { filter: brightness(1.06); }
.btn-primary.btn-sm, .btn-secondary.btn-sm, .btn-danger.btn-sm, .btn-success.btn-sm, .btn-white.btn-sm {
  min-height: 34px; padding: 0.4rem 0.75rem; font-size: 0.8rem; border-radius: 9px;
}
.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: #fff;
  animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap;
  padding: 0.22rem 0.6rem; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.3;
  border: 1px solid transparent;
}
.badge i { font-size: 10px; }
.badge-slate { color: #cbd5e1; background: rgba(148, 163, 184, 0.1); border-color: rgba(148, 163, 184, 0.18); }
.badge-blue { color: #8fdccf; background: rgba(72, 181, 166, 0.1); border-color: rgba(72, 181, 166, 0.28); }
.badge-violet { color: #f8c661; background: rgba(244, 178, 60, 0.1); border-color: rgba(244, 178, 60, 0.3); }
.badge-green { color: #6ee7b7; background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.25); }
.badge-emerald { color: #a7f3d0; background: rgba(16, 185, 129, 0.18); border-color: rgba(52, 211, 153, 0.35); }
.badge-amber { color: #fcd34d; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.25); }
.badge-red { color: #fca5a5; background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.25); }
.badge-pink { color: #f9a8d4; background: rgba(236, 72, 153, 0.12); border-color: rgba(236, 72, 153, 0.25); }
.badge-early { /* legacy */
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.22rem 0.6rem; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; color: #f8c661; background: rgba(244, 178, 60, 0.1); border: 1px solid rgba(244, 178, 60, 0.3);
}
.tag {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.55rem; border-radius: 7px;
  font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ avatar */
.avatar-wrap { display: inline-flex; flex-shrink: 0; border-radius: 999px; overflow: hidden; }
.avatar {
  border-radius: 999px; object-fit: cover; background: var(--surface-2);
  border: 1.5px solid rgba(255, 255, 255, 0.14); width: 100%; height: 100%;
}
.avatar-fallback {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 999px; font-weight: 800; color: #fff; letter-spacing: 0.02em;
  background: #46413b;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
}
.avatar-ring { padding: 2px; border-radius: 999px; background: var(--accent); display: inline-flex; }
.avatar-ring > * { border: 3px solid var(--bg) !important; }

/* ------------------------------------------------------------------ progress */
.progress-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--grad); transition: width 0.5s ease; }
.ring-progress { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.ring-progress svg { transform: rotate(-90deg); }
.ring-progress span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; min-width: 0; }
.field-label { display: block; font-size: 0.84rem; font-weight: 650; color: var(--text-2); margin-bottom: 0.4rem; }
.field-label .opt { color: var(--subtle); font-weight: 500; }
.field-hint { font-size: 0.76rem; color: var(--subtle); margin-top: 0.35rem; line-height: 1.45; }
.field-error { font-size: 0.78rem; color: #fca5a5; margin-top: 0.35rem; }
.field-input, .field-select, .field-textarea {
  width: 100%; border-radius: 11px; background: #0f0e0c; border: 1px solid #36312b;
  color: var(--text); padding: 0.7rem 0.85rem; outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-size: 16px; line-height: 1.4;
}
.field-input::placeholder, .field-textarea::placeholder { color: #625b53; }
.field-input:hover, .field-select:hover, .field-textarea:hover { border-color: #4a433c; }
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: rgba(244, 178, 60, 0.75); box-shadow: 0 0 0 3px rgba(244, 178, 60, 0.14); background: #0d0c0b;
}
.field-input:disabled, .field-select:disabled, .field-textarea:disabled {
  opacity: 1; color: var(--text-2); background: rgba(255, 255, 255, 0.02); border-color: var(--border); cursor: default;
}
.field-select {
  appearance: none; padding-right: 2.3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a69d91' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.85rem center;
}
.field-textarea { resize: vertical; min-height: 96px; }
.input-group { position: relative; }
.input-group > .prefix {
  position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; font-weight: 600;
}
.input-group > .field-input { padding-left: 2rem; }
.search-input { position: relative; }
.search-input i { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--subtle); font-size: 0.85rem; pointer-events: none; }
.search-input .field-input { padding-left: 2.3rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.form-section-title { font-weight: 750; color: #fff; font-size: 0.98rem; margin-bottom: 0.2rem; }
.form-section-sub { color: var(--muted); font-size: 0.84rem; margin-bottom: 1rem; }
.check-row { display: flex; gap: 0.7rem; align-items: flex-start; cursor: pointer; }
.check-row input[type="checkbox"], .check-row input[type="radio"] { margin-top: 0.2rem; width: 17px; height: 17px; accent-color: var(--accent); flex-shrink: 0; }

/* toggle switch */
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: rgba(148, 163, 184, 0.25); transition: background 0.2s ease; cursor: pointer;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: #fff;
  transition: transform 0.2s ease; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { background: var(--accent-ink); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }

/* chips */
.chip-grid { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 36px;
  padding: 0.4rem 0.8rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 0.82rem; font-weight: 600; user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { background: var(--surface-2); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked), .chip.selected {
  border-color: rgba(244, 178, 60, 0.65); background: rgba(244, 178, 60, 0.1); color: #fff;
}
.chip:has(input:checked)::before { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 10px; color: var(--accent); }
.chip:has(input:disabled) { cursor: default; }
.chip:has(input:focus-visible) { outline: 2px solid var(--ring); outline-offset: 2px; }

/* segmented / tabs */
.tabs { display: flex; gap: 0.3rem; overflow-x: auto; padding: 0.25rem; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); scrollbar-width: none; width: max-content; max-width: 100%; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0; min-height: 36px; padding: 0.45rem 0.85rem; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  font-weight: 650; font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; gap: 0.45rem;
  transition: background 0.15s ease, color 0.15s ease; font-family: inherit;
}
.tab-btn:hover { color: #fff; }
.tab-btn.active { color: #fff; background: var(--surface-3); border-color: var(--border-strong); }
.tab-btn .count { font-size: 11px; font-weight: 800; padding: 0.05rem 0.4rem; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--text-2); }
.tab-btn.active .count { background: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------------ lists / tables */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 0.85rem; padding: 0.85rem 0.25rem; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit; min-width: 0;
}
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: rgba(255, 255, 255, 0.02); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.875rem; }
.data-table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--subtle); font-weight: 700;
  padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.015); white-space: nowrap;
}
.data-table td { padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.data-table tbody tr { transition: background 0.12s ease; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.data-table tbody tr.clickable { cursor: pointer; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }

/* ------------------------------------------------------------------ campaign cards */
.campaign-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.campaign-card {
  position: relative; display: flex; flex-direction: column; gap: 0.85rem; min-width: 0;
  padding: 1.1rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
  text-decoration: none; color: inherit; transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.campaign-card:hover { border-color: #4a433c; background: var(--surface-2); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.campaign-card .payout { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: #f4f0ea; font-variant-numeric: tabular-nums; }
.campaign-card .meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.campaign-card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding-top: 0.85rem; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--muted); }
.save-btn {
  width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; flex-shrink: 0; position: relative; z-index: 2;
}
.save-btn:hover { color: #fff; }
.save-btn.saved { color: #f9a8d4; border-color: rgba(236, 72, 153, 0.35); background: rgba(236, 72, 153, 0.1); }
.fit-pill {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 11px; font-weight: 800; padding: 0.2rem 0.5rem; border-radius: 999px;
  color: #8fdccf; background: rgba(72, 181, 166, 0.1); border: 1px solid rgba(72, 181, 166, 0.28);
}
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 0.9rem; border: 1px solid rgba(255, 255, 255, 0.12);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }

/* key/value */
.kv-grid { display: grid; gap: 0.9rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kv-label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--subtle); margin-bottom: 0.25rem; }
.kv-value { font-size: 0.9rem; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ states */
.empty-state {
  text-align: center; padding: 2rem 1.25rem; border-radius: var(--radius); border: 1px dashed var(--border-strong); background: rgba(255, 255, 255, 0.015);
}
.empty-state .empty-icon {
  width: 48px; height: 48px; margin: 0 auto 0.85rem; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(244, 178, 60, 0.25); font-size: 1.1rem;
}
.empty-state h3 { font-family: var(--serif); font-weight: 600; color: #fff; font-size: 1.15rem; }
.empty-state p { color: var(--muted); font-size: 0.86rem; margin-top: 0.35rem; max-width: 26rem; margin-left: auto; margin-right: auto; line-height: 1.5; }
.skeleton {
  border-radius: 10px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  background-size: 400px 100%; animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
.notice {
  display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.85rem 1rem; border-radius: var(--radius);
  font-size: 0.86rem; line-height: 1.5; border: 1px solid;
}
.notice i { margin-top: 0.15rem; }
.notice-info { color: #bfdbfe; background: rgba(59, 130, 246, 0.08); border-color: rgba(59, 130, 246, 0.22); }
.notice-warn { color: #fde68a; background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.24); }
.notice-success { color: #a7f3d0; background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.24); }
.notice-danger { color: #fecaca; background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.24); }

.loading-screen {
  min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; color: var(--muted);
  position: relative; z-index: 1;
}
.loading-logo { width: 44px; height: 44px; animation: pulse-logo 1.4s ease-in-out infinite; }
@keyframes pulse-logo { 0%, 100% { opacity: 0.55; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1); } }

/* ------------------------------------------------------------------ overlays */
.dropdown {
  position: absolute; right: 0; top: calc(100% + 0.5rem); min-width: 220px; border-radius: 14px; padding: 0.4rem;
  background: #1b1916; border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  display: none; z-index: 60;
}
.dropdown.open { display: block; animation: pop 0.14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.dropdown a, .dropdown button.menu-item {
  display: flex; width: 100%; align-items: center; gap: 0.65rem; padding: 0.6rem 0.7rem; border-radius: 9px;
  color: var(--text-2); text-decoration: none; background: transparent; border: none; cursor: pointer;
  font-size: 0.875rem; font-weight: 600; text-align: left; font-family: inherit;
}
.dropdown a:hover, .dropdown button.menu-item:hover { background: var(--surface-2); color: #fff; }
.dropdown a i, .dropdown button.menu-item i { width: 16px; text-align: center; color: var(--muted); }
.dropdown-head { padding: 0.6rem 0.7rem 0.7rem; border-bottom: 1px solid var(--border); margin-bottom: 0.3rem; }

.notif-panel { width: min(380px, calc(100vw - 1.5rem)); padding: 0; right: -0.5rem; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: 0.75rem; padding: 0.75rem 0.9rem; text-decoration: none; border-bottom: 1px solid var(--border); }
.notif-item:hover { background: var(--surface); }
.notif-item.unread { background: rgba(244, 178, 60, 0.05); box-shadow: inset 3px 0 0 var(--accent); }
.notif-icon { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.8rem; }

.app-drawer-backdrop { position: fixed; inset: 0; background: rgba(8, 7, 6, 0.7); z-index: 55; display: none; backdrop-filter: blur(2px); }
.app-drawer-backdrop.open { display: block; }
.app-drawer {
  position: fixed; top: 0; left: 0; height: 100%; width: min(86vw, 300px); z-index: 60;
  transform: translateX(-100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  background: #141210; border-right: 1px solid var(--border); padding: 1rem 0.85rem; overflow-y: auto;
  display: flex; flex-direction: column;
}
.app-drawer.open { transform: translateX(0); }

.modal {
  position: fixed; inset: 0; z-index: 90; display: none; align-items: flex-end; justify-content: center; padding: 0;
  background: rgba(8, 7, 6, 0.72); backdrop-filter: blur(4px);
}
.modal.open { display: flex; }
.modal-panel {
  width: 100%; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 1.25rem;
  background: #1b1916; border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: slide-up 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-panel.wide { max-width: 720px; }
@keyframes slide-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.modal-title { font-weight: 800; font-size: 1.15rem; color: #fff; letter-spacing: -0.01em; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }

.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%) translateY(12px); z-index: 100;
  opacity: 0; visibility: hidden; pointer-events: none;
  display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 1.1rem; border-radius: 14px;
  background: #f4f0ea; border: 1px solid #f4f0ea; color: #1a1714;
  font-size: 0.875rem; font-weight: 600; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease, visibility 0.2s;
  max-width: calc(100% - 2rem); box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; pointer-events: auto; }
.toast .t-icon { color: #2f7d55; }
.toast.error .t-icon { color: #b8412e; }

/* legacy photo modal */
.photo-modal { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 1rem; background: rgba(2, 6, 23, 0.72); }
.photo-modal.open { display: flex; }
.photo-progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.photo-progress > span { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.2s ease; }

/* ------------------------------------------------------------------ chat */
.chat { display: flex; flex-direction: column; height: min(62vh, 560px); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 0.5rem 0.25rem; display: flex; flex-direction: column; gap: 0.5rem; }
.bubble { max-width: 82%; padding: 0.6rem 0.85rem; border-radius: 16px; font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; color: var(--accent-ink); background: var(--accent); border-bottom-right-radius: 5px; }
.bubble.them { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 5px; }
.bubble-meta { font-size: 10.5px; color: var(--subtle); margin-top: 0.15rem; }
.bubble-meta.me { align-self: flex-end; }
.chat-compose { display: flex; gap: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.chat-compose textarea { min-height: 44px; max-height: 140px; resize: none; }

/* ------------------------------------------------------------------ timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 0.8rem; position: relative; padding-bottom: 1rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 28px; height: 28px; border-radius: 999px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--muted); }
.tl-item.done .tl-dot { background: rgba(127, 207, 159, 0.14); border-color: rgba(127, 207, 159, 0.4); color: #a8e2bf; }
.tl-item.current .tl-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px rgba(244, 178, 60, 0.12); }

/* steps checklist */
.check-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.check-item:last-child { border-bottom: 0; }
.check-circle { width: 22px; height: 22px; border-radius: 999px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--border-strong); font-size: 10px; color: transparent; }
.check-item.done .check-circle { background: #7fcf9f; border-color: #7fcf9f; color: #0d2417; }
.check-item.done .check-text { color: var(--subtle); text-decoration: line-through; }

/* creator cards */
.creator-tile { display: flex; flex-direction: column; gap: 0.85rem; padding: 1.1rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); min-width: 0; transition: border-color 0.18s ease; }
.creator-tile:hover { border-color: var(--border-strong); }

.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bar-chart .bar { flex: none; width: 100%; max-width: 48px; border-radius: 6px 6px 2px 2px; background: var(--accent); min-height: 3px; position: relative; }
.bar-chart .bar:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 700; padding: 0.2rem 0.45rem; border-radius: 6px; background: #1e293b; color: #fff; }

/* ------------------------------------------------------------------ responsive */
@media (min-width: 640px) {
  .form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: span 2 / span 2; }
  .campaign-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { align-items: center; padding: 1rem; }
  .modal-panel { max-width: 520px; border-radius: 20px; padding: 1.5rem; }
  .modal-panel.wide { max-width: 720px; }
}
@media (min-width: 900px) {
  .stat-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .app-sidebar { display: flex; }
  .app-topbar-mobile-only { display: none !important; }
  .app-topbar { padding: 0.7rem 1.75rem; }
  .app-content { padding: 1.75rem 1.75rem 3.5rem; }
  .app-footer { padding-left: 1.75rem; padding-right: 1.75rem; }
  .app-card { padding: 1.4rem; }
  .hero-card { padding: 1.75rem; }
}
@media (min-width: 1200px) {
  .campaign-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------ cascade guard
   Tailwind's CDN injects preflight *after* this file, and its
   [type=button] { background: transparent } would otherwise wipe button fills. */
button.btn-primary, button.btn.btn-primary { background: var(--accent); }
button.btn-secondary { background: var(--surface-2); }
button.btn-secondary:hover { background: var(--surface-3); }
button.btn-white { background: #f4f0ea; }
button.btn-white:hover { background: #e2e8f0; }
button.btn-danger { background: rgba(239, 68, 68, 0.1); }
button.btn-danger:hover { background: rgba(239, 68, 68, 0.18); }
button.btn-success { background: #7fcf9f; }
button.btn-ghost:hover { background: var(--surface-2); }
button.icon-btn { background: var(--surface); }
button.icon-btn:hover { background: var(--surface-2); }
button.account-btn { background: var(--surface); }
button.account-btn:hover { background: var(--surface-2); }
button.save-btn { background: var(--surface-2); }
button.save-btn.saved { background: rgba(236, 72, 153, 0.1); }
button.tab-btn.active { background: var(--surface-3); }
.dropdown button.menu-item:hover { background: var(--surface-2); }
.dropdown a.notif-item { padding: 0.75rem 0.9rem; border-radius: 0; align-items: flex-start; }
img.avatar { display: block; }
