/* Edwards & Co — Influencer Manager
   Shared with the CS Assistant: tokens taken from the edwardsandco.nz Shopify theme. Gotham is licensed, so
   Montserrat (headings) and Figtree (body) — the theme's own fallbacks — are used. */

:root {
  --accent: #f94e1a;
  --accent-hover: #c72e00;
  --accent-light: #ffc0ad;
  --accent-fade: rgba(249, 78, 26, 0.06);
  --ink: #413e3e;
  --text: #555959;
  --text-light: #888b8b;
  --bg: #ffffff;
  --bg-soft: #f4f4f3;
  --bg-softer: #fafaf9;
  --border: #e7e6e3;
  --success: #3f8f52;
  --success-bg: rgba(86, 173, 106, 0.14);
  --warn: #a35b00;
  --warn-bg: #fff1dc;
  --error: #721c24;
  --error-bg: #f8d7da;
  --neutral-bg: #eeeeec;
  --radius-pill: 300px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(65, 62, 62, 0.04), 0 4px 16px rgba(65, 62, 62, 0.05);
  --font-head: "Montserrat", "Gotham", sans-serif;
  --font-body: "Figtree", "Gotham", sans-serif;
  --font-serif: "Playfair Display", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-softer);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); margin: 0; }
h1 { font-weight: 900; font-size: 28px; letter-spacing: -0.01em; }
h2 { font-weight: 800; font-size: 17px; }
h3 { font-weight: 700; font-size: 14px; }
.serif { font-family: var(--font-serif); font-weight: 500; font-style: italic; }
.muted { color: var(--text-light); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  height: 68px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand .wordmark { font-family: var(--font-head); font-weight: 900; color: var(--ink); font-size: 18px; }
.brand .app {
  font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  padding-left: 12px; border-left: 1px solid var(--border);
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  text-decoration: none; color: var(--text); font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius-pill);
}
.nav a:hover { background: var(--bg-soft); color: var(--ink); }
.nav a.active { background: var(--ink); color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user { font-size: 13px; color: var(--text-light); }

.page { max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-head p { margin: 6px 0 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.grid-wide { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); align-items: start; }
.grid-run { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 960px) {
  .grid-2, .grid-run, .grid-wide { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 8px; gap: 10px 16px; }
  .brand { flex: 1; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .topbar-right .user, .topbar-right .badge { display: none; }
  .brand .wordmark { white-space: nowrap; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.card-body { padding: 20px 22px; }
.card-body.flush { padding: 0; }

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { padding: 18px 18px 16px; }
.kpi .label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-light); }
.kpi .value { font-family: var(--font-head); font-weight: 900; font-size: 30px; color: var(--ink); margin: 6px 0 2px; line-height: 1.1; }
.kpi .sub { font-size: 12.5px; color: var(--text-light); }
.kpi.accent { background: var(--ink); border-color: var(--ink); }
.kpi.accent .label, .kpi.accent .sub { color: rgba(255,255,255,0.65); }
.kpi.accent .value { color: #fff; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-head); font-weight: 700; font-size: 13px; letter-spacing: 0.02em;
  padding: 10px 20px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink); background: var(--bg); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--bg-soft); color: var(--ink); }
.btn-sm { padding: 6px 14px; font-size: 12px; }

input[type=text], input[type=email], input[type=search], input[type=password], input[type=number], input[type=url], select, textarea {
  font: inherit; color: var(--ink);
  border: 1px solid var(--border); background: var(--bg);
  padding: 9px 16px; border-radius: var(--radius-pill); outline: none; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-fade); }
select { padding-right: 34px; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.filters input[type=search] { flex: 1; min-width: 220px; }

.segmented { display: inline-flex; background: var(--bg-soft); border-radius: var(--radius-pill); padding: 4px; }
.segmented a, .segmented button { border: 0; background: none; font-family: inherit; cursor: pointer; text-decoration: none; padding: 6px 14px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 600; color: var(--text); }
.segmented button:disabled { cursor: default; }
.segmented a.on, .segmented button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--neutral-bg); color: var(--text); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
/* Status colours, shared by contacts, activations, orders and deliveries */
.badge-ok, .badge-creator, .badge-approved, .badge-completed, .badge-delivered, .badge-active, .badge-success { background: var(--success-bg); color: var(--success); }
.badge-warn, .badge-applicant, .badge-accepted, .badge-submitted, .badge-placed, .badge-draft { background: var(--warn-bg); color: var(--warn); }
.badge-err, .badge-declined, .badge-rejected, .badge-cancelled, .badge-failed { background: var(--error-bg); color: var(--error); }
.badge-info, .badge-prospect, .badge-invited, .badge-fulfilled, .badge-in_progress { background: var(--accent-fade); color: var(--accent-hover); }
.badge-muted, .badge-archived, .badge-n\/a { background: var(--neutral-bg); color: var(--text-light); }
.badge-dark { background: var(--ink); color: #fff; }
.badge-dark::before { display: none; }

/* ---------- Tables ---------- */
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-light); padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-softer);
}
.table td.when { white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.link-row { cursor: pointer; }
.table tr.link-row:hover td { background: var(--accent-fade); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .summary { color: var(--ink); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.bar-stack { flex: 1; width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 2px 2px; overflow: hidden; background: var(--bg-soft); }
.bar-stack span { display: block; width: 100%; }
.seg-drafted { background: var(--accent); }
.seg-human { background: var(--accent-light); }
.seg-other { background: #d9d8d4; }
.bar-label { font-size: 10.5px; color: var(--text-light); white-space: nowrap; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-light); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.hbar-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: 12px; align-items: center; padding: 9px 0; }
.hbar-row + .hbar-row { border-top: 1px dashed var(--border); }
.hbar-track { height: 10px; background: var(--bg-soft); border-radius: var(--radius-pill); overflow: hidden; }
.hbar-fill { height: 100%; background: var(--accent); border-radius: var(--radius-pill); }
.hbar-fill.noncs { background: #cfcdc8; }
.hbar-label { font-size: 13.5px; color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-meta { font-size: 12.5px; color: var(--text-light); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Run detail ---------- */
.meta-list { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; margin: 0; font-size: 14px; }
.meta-list dt { color: var(--text-light); }
.meta-list dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.message {
  white-space: pre-wrap; background: var(--bg-softer); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px; color: var(--ink); font-size: 14.5px; line-height: 1.6;
}
.draft {
  white-space: pre-wrap; background: #fff; border: 1.5px solid var(--accent-light);
  border-radius: 12px; padding: 18px 20px; color: var(--ink); font-size: 15px; line-height: 1.65;
}
.callout { border-radius: 12px; padding: 14px 16px; font-size: 14px; }
.callout-warn { background: var(--warn-bg); color: #6b3d00; }
.callout-error { background: var(--error-bg); color: var(--error); }
.callout-info { background: var(--bg-soft); color: var(--ink); }
.stack > * + * { margin-top: 20px; }
.section-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-light); margin: 0 0 8px; }
.sources { margin: 0; padding-left: 18px; }
.sources li { margin: 4px 0; color: var(--ink); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: -6px; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.timeline .dot.err { border-color: var(--error); }
.timeline .dot.model { border-color: var(--ink); }
.timeline .t-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.timeline details { margin-top: 6px; }
.timeline summary { cursor: pointer; font-size: 12.5px; color: var(--text-light); }
.timeline pre { white-space: pre-wrap; word-break: break-word; background: var(--bg-softer); border: 1px solid var(--border); border-radius: 8px; padding: 10px; max-height: 260px; overflow: auto; margin: 6px 0 0; }

.rating-group { display: flex; flex-wrap: wrap; gap: 8px; }
.rating-group button.on { background: var(--ink); color: #fff; }
.meter { height: 8px; border-radius: var(--radius-pill); background: var(--bg-soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }

/* ---------- Integrations ---------- */
.int-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 800px) { .int-grid { grid-template-columns: 1fr; } }
.int-card .card-body { display: flex; flex-direction: column; gap: 14px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.ok { background: var(--success); }
.status-dot.no { background: #c9c7c2; }
.setup-form { display: flex; flex-direction: column; gap: 18px; }
.setup-form .field { display: flex; flex-direction: column; gap: 6px; }
.setup-form label { font-size: 13px; font-weight: 600; color: var(--ink); }
.setup-form .field-check label { display: flex; align-items: center; gap: 8px; }
.setup-form textarea { border-radius: 14px; resize: vertical; }
.setup-form .has-error input, .setup-form .has-error select, .setup-form .has-error textarea { border-color: var(--error); }
.field-error { color: var(--error); }
code.inline { background: var(--bg-soft); padding: 2px 8px; border-radius: 6px; font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }

/* ---------- Messages & empty ---------- */
.flash { max-width: 1240px; margin: 16px auto 0; padding: 0 24px; }
.flash div { padding: 12px 18px; border-radius: 12px; font-size: 14px; margin-bottom: 8px; }
.flash .success { background: var(--success-bg); color: #24572f; }
.flash .error { background: var(--error-bg); color: var(--error); }
.flash .info { background: var(--bg-soft); color: var(--ink); }
.empty { text-align: center; padding: 48px 20px; color: var(--text-light); }
.empty h3 { margin-bottom: 6px; }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; border-top: 1px solid var(--border); font-size: 13px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-form { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px; }
.login-form label { font-size: 13px; font-weight: 600; color: var(--ink); }
.login-form input { width: 100%; }

.attn { display: block; text-decoration: none; padding: 12px 0; }
.attn + .attn { border-top: 1px dashed var(--border); }
.attn-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.attn-title { color: var(--ink); font-weight: 600; font-size: 14px; }
.attn-ticket { font-size: 12px; color: var(--text-light); white-space: nowrap; }
.attn .badge { margin-top: 6px; }

/* Knowledge page editor (Toast UI) */
.setup-form .toastui-editor-defaultUI { border-color: var(--border); border-radius: 14px; overflow: hidden; }
.setup-form .toastui-editor-contents { font-family: inherit; font-size: 14px; }

/* =====================================================================
   Influencer Manager additions
   ===================================================================== */
input[type=date], input[type=tel], input[type=datetime-local] {
  font: inherit; color: var(--ink); border: 1px solid var(--border); background: var(--bg);
  padding: 9px 16px; border-radius: var(--radius-pill); outline: none; min-width: 0;
}
input[type=file] { font: inherit; font-size: 13px; color: var(--text); max-width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
textarea { border-radius: 14px !important; resize: vertical; width: 100%; }
.w-full { width: 100%; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.spacer { flex: 1; }
.link { color: var(--accent-hover); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.btn-danger { border-color: var(--error); color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-xs { padding: 3px 10px; font-size: 11.5px; }
button.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-hover); cursor: pointer; font-weight: 600; }
button.linkish:hover { text-decoration: underline; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); align-items: start; }
@media (max-width: 960px) { .grid-3, .grid-side { grid-template-columns: 1fr; } }
.nav a .count { font-size: 11px; background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 7px; margin-left: 4px; }

/* ---------- Avatars & chips ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-fade); color: var(--accent-hover);
  font-family: var(--font-head); font-weight: 800; font-size: 13px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.who .who-name { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .who-sub { font-size: 12.5px; color: var(--text-light); }
.chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: var(--radius-pill); background: var(--bg-soft); color: var(--ink); margin: 1px 2px 1px 0; white-space: nowrap; }
.chip.accent { background: var(--accent-fade); color: var(--accent-hover); font-weight: 600; }
.net { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); text-decoration: none; }
.net-icon { width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 800; font-family: var(--font-head); }
.net-instagram { background: linear-gradient(45deg, #f9a03f, #e1306c 55%, #833ab4); }
.net-tiktok { background: #111; }
.net-facebook { background: #1877f2; }
.net-youtube { background: #ff0000; }
.net-website, .net-file { background: var(--ink); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button {
  text-decoration: none; padding: 10px 16px; color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap;
  border: 0; background: none; font-family: inherit; cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs a.on, .tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.card .tabs { padding: 0 14px; margin-bottom: 0; }
.tab-panel[hidden] { display: none; }

/* ---------- Workflow steps ---------- */
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.step {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); position: relative;
}
.step .n { font-family: var(--font-head); font-weight: 900; font-size: 24px; color: var(--ink); line-height: 1; }
.step .l { font-size: 12.5px; font-weight: 600; color: var(--text-light); }
.step .i { position: absolute; top: 12px; right: 14px; font-size: 11px; font-weight: 800; color: var(--text-light); font-family: var(--font-head); }
.step:hover { border-color: var(--accent-light); }
.step.on { background: var(--ink); border-color: var(--ink); }
.step.on .n { color: #fff; } .step.on .l, .step.on .i { color: rgba(255,255,255,.7); }

/* ---------- Progress ---------- */
.pbars { display: grid; gap: 6px; min-width: 200px; }
.pbar { display: grid; grid-template-columns: 112px 1fr 44px; gap: 8px; align-items: center; font-size: 12.5px; }
.pbar .pl { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar .pt { height: 7px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.pbar .pt span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.pbar.done .pt span { background: var(--success); }
.pbar .pn { text-align: right; color: var(--text-light); font-variant-numeric: tabular-nums; }

/* ---------- Bulk actions ---------- */
.bulkbar {
  display: none; position: sticky; bottom: 16px; z-index: 5; margin: 16px auto 0; max-width: 980px;
  background: var(--ink); color: #fff; border-radius: 18px; padding: 10px 14px; gap: 10px; align-items: center; flex-wrap: wrap;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.bulkbar.show { display: flex; }
.bulkbar select, .bulkbar input { padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.bulkbar .btn { border-color: #fff; color: #fff; background: transparent; }
.bulkbar .btn:hover { background: #fff; color: var(--ink); }
.bulkbar .btn-primary { background: var(--accent); border-color: var(--accent); }
.table td.check, .table th.check { width: 36px; padding-right: 0; }
.table th a { color: inherit; text-decoration: none; }
.table th a:hover { color: var(--ink); }
.table th .sorted { color: var(--accent-hover); }
.table td .sub { font-size: 12.5px; color: var(--text-light); }

/* ---------- Dropdown (details) ---------- */
details.dropdown { position: relative; }
details.dropdown > summary { list-style: none; }
details.dropdown > summary::-webkit-details-marker { display: none; }
details.dropdown .menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px; max-height: 420px; overflow: auto;
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 10px;
}
details.dropdown .menu.left { left: 0; right: auto; }
.menu label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; font-size: 13.5px; color: var(--ink); border-radius: 8px; cursor: pointer; }
.menu label:hover { background: var(--bg-soft); }
.menu a.item { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 8px; text-decoration: none; font-size: 13.5px; }
.menu a.item:hover { background: var(--bg-soft); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }

/* ---------- Modal ---------- */
dialog.modal {
  border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--text);
}
dialog.modal.wide { width: min(820px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(40, 38, 38, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg-softer); }
.pick-list { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.pick-list label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.pick-list label:last-child { border-bottom: 0; }
.pick-list label:hover { background: var(--accent-fade); }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form label, .field > label { font-size: 13px; font-weight: 600; color: var(--ink); }
.form .help { font-size: 12.5px; color: var(--text-light); }
.form .has-error input, .form .has-error select, .form .has-error textarea { border-color: var(--error); }
.form .check { flex-direction: row; align-items: center; gap: 8px; }
.form .check label { font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.fieldset-title { font-family: var(--font-head); font-weight: 800; color: var(--ink); font-size: 15px; margin: 8px 0 -4px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; max-height: 280px; overflow: auto; padding: 4px; }
.checks label, .checks > div > label { font-weight: 500; display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.checks ul { list-style: none; padding: 0; margin: 0; display: contents; }
.formset-row { display: grid; grid-template-columns: 160px 80px 1fr 1.4fr 70px; gap: 8px; align-items: center; }
@media (max-width: 800px) { .formset-row { grid-template-columns: 1fr 1fr; } }
.formset-row.head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-light); }
.formset-row input, .formset-row select { width: 100%; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--error); font-size: 12.5px; }

/* ---------- Profile ---------- */
.profile-head { display: flex; gap: 18px; align-items: center; }
.profile-head h1 { font-size: 26px; }
.meta-list.tight { grid-template-columns: 120px 1fr; font-size: 13.5px; gap: 8px 12px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.inline-add { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.inline-add input, .inline-add select { padding: 6px 12px; font-size: 13px; flex: 1; min-width: 90px; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.list-plain li:last-child { border-bottom: 0; }
.x { border: 0; background: none; color: var(--text-light); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 4px; }
.x:hover { color: var(--error); }
.activity-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-item .ico { width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: var(--bg-soft); }
.activity-item .ico.email { background: #ecebff; } .activity-item .ico.content { background: var(--accent-fade); }
.activity-item .ico.action { background: var(--success-bg); } .activity-item .ico.note { background: var(--warn-bg); }
.activity-item .txt { flex: 1; min-width: 0; font-size: 14px; color: var(--ink); }
.activity-item .meta { font-size: 12px; color: var(--text-light); }
.activity-item .detail { margin-top: 6px; font-size: 13.5px; color: var(--text); background: var(--bg-softer); border-radius: 10px; padding: 8px 12px; }
.activity-item .detail p { margin: 0 0 6px; } .activity-item .detail p:last-child { margin: 0; }
.task-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.task-row:last-child { border-bottom: 0; }
.task-row.done .t-title { text-decoration: line-through; color: var(--text-light); }
.task-row .t-title { color: var(--ink); font-weight: 600; font-size: 14px; }
.tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); background: var(--bg); cursor: pointer; padding: 0; flex: 0 0 auto; margin-top: 1px; }
.tick:hover { border-color: var(--success); }
.tick.on { background: var(--success); border-color: var(--success); }
.overdue { color: var(--error); font-weight: 600; }

/* ---------- Content grid ---------- */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.content-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.content-card .thumb { aspect-ratio: 4 / 5; background: var(--bg-soft) center / cover no-repeat; position: relative; display: block; }
.content-card .thumb .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-light); font-size: 13px; padding: 16px; text-align: center; }
.content-card .thumb .tl { position: absolute; top: 10px; left: 10px; display: flex; gap: 4px; }
.content-card .thumb .tr { position: absolute; top: 10px; right: 10px; }
.content-card .thumb .badge { background: rgba(255,255,255,.92); }
.content-card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.content-card .stats { display: flex; gap: 10px; font-size: 12px; color: var(--text-light); flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.content-card .stats b { color: var(--ink); font-weight: 700; }
.content-card .cap { font-size: 12.5px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.content-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; }

/* ---------- Campaign cards ---------- */
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.camp-card { text-decoration: none; display: flex; flex-direction: column; overflow: hidden; }
.camp-card .cover { height: 130px; background: linear-gradient(135deg, var(--accent-light), var(--accent)) center / cover no-repeat; position: relative; }
.camp-card .cover .badge { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.94); }
.camp-card .cover .mk { position: absolute; top: 12px; right: 12px; font-family: var(--font-head); font-weight: 900; color: #fff; font-size: 13px; background: rgba(0,0,0,.35); border-radius: 8px; padding: 2px 8px; }
.camp-card .card-body { display: flex; flex-direction: column; gap: 8px; }
.camp-card h3 { font-size: 16px; font-weight: 800; }
.camp-stats { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-light); }
.camp-stats b { color: var(--ink); font-family: var(--font-head); font-size: 16px; display: block; }
.camp-hero { height: 180px; border-radius: var(--radius); background: linear-gradient(135deg, var(--accent-light), var(--accent)) center / cover no-repeat; margin-bottom: 20px; }

/* ---------- Funnel ---------- */
.funnel .hbar-row { grid-template-columns: 120px 1fr 90px; }

/* ---------- Product picker ---------- */
.product-row { display: grid; grid-template-columns: 48px 1fr 70px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.product-row:last-child { border-bottom: 0; }
.product-row img, .product-row .noimg { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--bg-soft); }
.product-row input { width: 70px; padding: 6px 10px; }

/* =====================================================================
   Creator portal
   ===================================================================== */
.portal .page { max-width: 1040px; }
.portal-hero {
  border-radius: 22px; padding: 34px 32px; color: #fff; margin-bottom: 26px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--ink) 0%, #5a5555 100%);
}
.portal-hero h1 { color: #fff; font-size: 30px; }
.portal-hero p { margin: 8px 0 0; color: rgba(255,255,255,.8); max-width: 560px; }
.portal-hero .serif { color: var(--accent-light); }
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.p-card { text-decoration: none; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.p-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(65,62,62,.12); }
.p-card .cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--accent-light), var(--accent)) center / cover no-repeat; position: relative; }
.p-card .cover .badge { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.95); }
.p-card .card-body { display: flex; flex-direction: column; gap: 6px; }
.p-card h3 { font-size: 17px; font-weight: 800; }
.brief-hero { aspect-ratio: 21 / 8; border-radius: 22px; margin-bottom: 22px; background: linear-gradient(135deg, var(--accent-light), var(--accent)) center / cover no-repeat; }
.rules { display: flex; flex-wrap: wrap; gap: 8px; }
.rules .chip { font-size: 14px; padding: 6px 14px; font-weight: 700; background: var(--accent-fade); color: var(--accent-hover); }
.task { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--bg); }
.task + .task { margin-top: 12px; }
.task-top { display: flex; align-items: center; gap: 14px; }
.task-top .tick { cursor: default; }
.task-top .t-name { font-family: var(--font-head); font-weight: 800; color: var(--ink); font-size: 15px; }
.task-top .t-count { font-size: 13px; color: var(--text-light); }
.task .deliveries { margin: 12px 0 0 34px; display: grid; gap: 8px; }
.delivery-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.feedback { background: var(--warn-bg); color: #6b3d00; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; width: 100%; }
.agreement { max-height: 360px; overflow: auto; background: var(--bg-softer); border: 1px solid var(--border); border-radius: 14px; padding: 4px 20px; font-size: 14px; }
.prose { color: var(--ink); line-height: 1.65; }
.prose h1, .prose h2, .prose h3 { margin: 18px 0 8px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 12px; }
.dropzone { border: 2px dashed var(--border); border-radius: 14px; padding: 18px; text-align: center; background: var(--bg-softer); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-fade); }
.file-list { font-size: 13px; text-align: left; margin-top: 8px; }

/* ---------- Auth (allauth) ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side { background: var(--ink) center / cover; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.auth-side::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(65,62,62,.25), rgba(65,62,62,.85)); }
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { color: #fff; font-size: 34px; font-weight: 900; line-height: 1.15; max-width: 420px; }
.auth-side .serif { color: var(--accent-light); }
.auth-side p { color: rgba(255,255,255,.8); max-width: 420px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card .brand { margin-bottom: 28px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.auth-card form p { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.auth-card form label { font-size: 13px; font-weight: 600; color: var(--ink); }
.auth-card form input:not([type=checkbox]):not([type=radio]) { width: 100%; }
.auth-card form .check { flex-direction: row; align-items: center; gap: 8px; }
.auth-card form .check label { font-weight: 500; }
.auth-card .help { font-size: 12.5px; color: var(--text-light); }
.auth-card .btn { width: 100%; }
.auth-card .alt { margin-top: 18px; font-size: 14px; text-align: center; color: var(--text-light); }
.providers { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.providers .btn { justify-content: center; gap: 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-light); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin: 20px 0 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
@media (max-width: 860px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* Embedded application form (iframe on the website) */
body.embed { background: transparent; }
body.embed .page { padding: 8px 4px; max-width: 760px; }

/* ---------- Print (Save proposal as PDF) ---------- */
@media print {
  .topbar, .no-print, .flash, .bulkbar, dialog { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .agreement { max-height: none; overflow: visible; }
  .brief-hero { aspect-ratio: auto; height: 160px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { text-decoration: none; color: inherit; }
}
.form .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .form .field select { width: 100%; }
.menu button.item { display: flex; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--ink); padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.menu button.item:hover { background: var(--bg-soft); }
.menu .item.danger { color: var(--error); }
.manage-card { max-width: 680px; padding: 24px 26px; }
.manage-card h1 { font-size: 24px; margin-bottom: 8px; }
.manage-card h2 { margin: 18px 0 8px; }
.manage-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.manage-card .btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.auth-card .btn-group { display: flex; flex-direction: column; gap: 10px; }
.auth-card hr, .manage-card hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0 0; }
.auth-card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-light); font-weight: 700; margin: 20px 0 0; text-align: center; }
.auth-card p, .manage-card p { margin: 8px 0; }
.field-radio { display: flex; align-items: center; gap: 8px; }
.auth-side { background-color: var(--ink); background-image: radial-gradient(circle at 20% 110%, rgba(249,78,26,.55), transparent 55%), radial-gradient(circle at 100% 0%, rgba(255,192,173,.25), transparent 45%); }
.auth-side .brand img { filter: brightness(0) invert(1); }
.auth-side .brand .app { border-left-color: rgba(255,255,255,.3); }
.nav { align-items: center; }
.nav a, .nav summary { white-space: nowrap; }
.nav details.dropdown > summary { display: inline-block; color: var(--text); font-weight: 500; }
.brand .app { white-space: nowrap; }
.nav-more { cursor: pointer; padding: 8px 14px; border-radius: var(--radius-pill); }
.nav-more:hover { background: var(--bg-soft); color: var(--ink); }
.nav-more.active { background: var(--ink); color: #fff !important; }
.brief-hero.plain { aspect-ratio: auto; height: 90px; }
