/* =============================================================================
   Agapaya design system — shared across public site, parent workspace, admin.
   Tokens measured from ui/*.png (admin_template.png's own tokens panel is the
   source of truth: Inter 32/40, 24/32, 18/28, 16/24, 14/20, 12/16; spacing
   4/8/12/16/24/32/48; radius 4/8/12). Fonts self-hosted in /assets/fonts.
   Shared file — page-specific rules live in public.css / app.css / admin.css.
   ========================================================================== */

:root {
  --bg: #FBF7F1;
  --surface: #FFFFFF;
  --surface-2: #FFFDFA;
  --ink: #1F2A44;
  --ink-2: #3B4661;
  --muted: #6B7280;
  --border: #E7E1D6;
  --border-2: #EFE9DF;
  --teal: #2F7D62;
  --teal-hover: #27664F;
  --teal-tint: #E6F0EB;
  --sage: #DCEBE3;
  --sky: #DCEEF8;
  --sky-ink: #2B6CB0;
  --peach: #FBE9DF;
  --peach-2: #F9DCCB;
  --coral: #F08A5D;
  --coral-ink: #C8653C;
  --sun: #F5B94E;
  --sun-tint: #FFF3D6;
  --lavender: #EAE4FB;
  --lavender-ink: #5B3EC4;
  --success: #2F7D62; --success-bg: #E6F0EB;
  --info: #2B6CB0;    --info-bg: #DCEEF8;
  --warning: #B7791F; --warning-bg: #FFF3D6;
  --danger: #B42318;  --danger-bg: #FDE8E6;
  --radius-sm: 4px; --radius: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --shadow: 0 1px 2px rgba(31,42,68,.05), 0 4px 16px rgba(31,42,68,.06);
  --shadow-lg: 0 8px 30px rgba(31,42,68,.10);
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --hand: 'Caveat', 'Segoe Script', cursive;
  --sidebar-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* overflow-wrap is inherited, so this one declaration is the app-wide safety net
   that stops a long unbroken token (Paddle txn id, sha256, IBAN, referral URL,
   long email) from forcing its container wider than the viewport. */
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 24px; color: var(--ink); background: var(--bg); overflow-wrap: break-word; }
img, svg { max-width: 100%; }
a { color: var(--teal); }
a:hover { color: var(--teal-hover); }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
code { background: var(--border-2); padding: 1px 5px; border-radius: var(--radius-sm); font-size: .9em; overflow-wrap: break-word; }
:focus-visible { outline: 3px solid var(--sky-ink); outline-offset: 2px; }
/* Deliberately NOT position:absolute. An absolutely-positioned .sr-only has no
   positioned ancestor inside .table-wrap, so its containing block is the initial
   containing block — which means overflow-x:auto does NOT clip it and it still
   contributes to document width. That silently widened /app/purchases,
   /app/affiliate, /masuk/affiliate-payouts and /masuk/affiliates/{id} (an
   invisible 1px span was setting the page width). Staying in flow at 1x1 with
   clip-path keeps it hidden from sight, readable by screen readers, and unable
   to escape any scroll container. */
.sr-only { position: static; display: inline-block; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* --- type ----------------------------------------------------------------- */
h1, .h1 { font-size: 32px; line-height: 40px; font-weight: 700; margin: 0 0 12px; letter-spacing: -.01em; }
h2, .h2 { font-size: 24px; line-height: 32px; font-weight: 600; margin: 0 0 12px; }
h3, .h3 { font-size: 18px; line-height: 28px; font-weight: 600; margin: 0 0 8px; }
h4 { font-size: 16px; line-height: 24px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.small, .field-hint { font-size: 14px; line-height: 20px; }
.muted { color: var(--muted); }
.kicker { display: inline-block; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--coral-ink); margin-bottom: 8px; }
.kicker-teal { color: var(--teal); }
.handwritten { font-family: var(--hand); color: var(--coral); font-size: 26px; line-height: 1.1; font-weight: 500; }
.display { font-size: 44px; line-height: 50px; font-weight: 700; letter-spacing: -.02em; }
.lede { font-size: 18px; line-height: 28px; color: var(--ink-2); }
.subtitle { color: var(--muted); margin-top: -4px; }
.empty-state { color: var(--muted); font-style: italic; }

/* --- layout utils --------------------------------------------------------- */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* --- icons ---------------------------------------------------------------- */
.icon { width: 1em; height: 1em; vertical-align: -0.15em; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
.icon-circle { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--teal-tint); color: var(--teal); flex-shrink: 0; }
.icon-circle .icon { width: 22px; height: 22px; }
.icon-circle-lg { width: 64px; height: 64px; } .icon-circle-lg .icon { width: 28px; height: 28px; }
.icon-circle-sm { width: 36px; height: 36px; } .icon-circle-sm .icon { width: 18px; height: 18px; }
.tint-teal { background: var(--teal-tint); color: var(--teal); }
.tint-sage { background: var(--sage); color: var(--teal); }
.tint-sky { background: var(--sky); color: var(--sky-ink); }
.tint-peach { background: var(--peach); color: var(--coral-ink); }
.tint-sun { background: var(--sun-tint); color: #9A6A05; }
.tint-lavender { background: var(--lavender); color: var(--lavender-ink); }
.tint-danger { background: var(--danger-bg); color: var(--danger); }

/* --- buttons -------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 15px; line-height: 20px; font-weight: 600; padding: 10px 18px; border-radius: 10px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s, border-color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--ink-2); }
.btn-secondary:hover { background: var(--teal-tint); color: var(--ink); }
.btn-outline { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn-outline:hover { background: var(--teal-tint); }
.btn-tertiary, .btn-cancel { background: transparent; color: var(--teal); border-color: transparent; padding-left: 8px; padding-right: 8px; }
.btn-tertiary:hover, .btn-cancel:hover { text-decoration: underline; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #E3A6A1; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-coral { background: var(--coral); color: #fff; } .btn-coral:hover { background: var(--coral-ink); color: #fff; }
.btn-small { font-size: 13px; line-height: 18px; padding: 6px 12px; border-radius: 8px; }
.btn-large { font-size: 17px; line-height: 24px; padding: 14px 26px; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 8px; border-radius: 50%; width: 36px; height: 36px; background: var(--surface); border-color: var(--border); color: var(--ink-2); }
.btn-icon:hover { background: var(--teal-tint); color: var(--teal); }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--teal); cursor: pointer; text-decoration: underline; }
.inline-form { display: inline; margin: 0; }

/* --- forms ---------------------------------------------------------------- */
.form-row { margin-bottom: 16px; }
.form-row:last-of-type { margin-bottom: 0; }
.form-row label, .label { display: block; font-weight: 600; font-size: 14px; line-height: 20px; margin-bottom: 6px; color: var(--ink); }
.form-row input[type=text], .form-row input[type=email], .form-row input[type=password], .form-row input[type=number], .form-row input[type=url], .form-row input[type=date], .form-row input[type=time], .form-row input[type=search], .form-row select, .form-row textarea, .input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px; font: inherit; font-size: 15px; line-height: 22px; background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus, .input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); }
.form-row textarea { resize: vertical; min-height: 96px; }
.form-row select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.form-row .input-icon > input, .input-icon > input { padding-left: 44px; }
.form-row .input-icon > input.has-action, .input-icon > input.has-action { padding-right: 44px; }
.input-icon > .input-action { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 6px; color: var(--muted); cursor: pointer; border-radius: 6px; display: inline-flex; }
.input-icon > .input-action:hover { color: var(--teal); background: var(--teal-tint); }
.input-icon > .input-action .icon { width: 20px; height: 20px; }
.checkbox-option, .form-row-checkbox label { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 15px; cursor: pointer; }
.checkbox-option input, .form-row-checkbox input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--teal); flex-shrink: 0; }
.radio-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.radio-card { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 500; }
.radio-card input { accent-color: var(--teal); }
.radio-card:has(input:checked) { border-color: var(--teal); background: var(--teal-tint); }
.field-hint { color: var(--muted); margin: 6px 0 0; }
.field-optional { font-weight: 400; color: var(--muted); }
.field-error { font-size: 13px; line-height: 18px; color: var(--danger); margin: 6px 0 0; font-weight: 600; }
.field-static { margin: 0; padding: 8px 0; }
.form-actions { margin-top: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stacked-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px; max-width: 680px; box-shadow: var(--shadow); }
.char-count { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search-box input { width: 100%; padding: 10px 14px 10px 42px; border: 1.5px solid var(--border); border-radius: 10px; font: inherit; font-size: 14px; background: var(--surface); }
.search-box input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); }
.switch { position: relative; width: 44px; height: 24px; appearance: none; background: #CBD5E1; border-radius: 999px; cursor: pointer; transition: background .15s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: left .15s; }
.switch:checked { background: var(--teal); } .switch:checked::after { left: 23px; }

/* --- cards ---------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.card-pad { padding: 20px 24px; }
.card-sm { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-link { font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.card-link .icon { width: 16px; height: 16px; }
.card-sage { background: var(--sage); border-color: transparent; }
.card-peach { background: var(--peach); border-color: transparent; }
.card-cream { background: var(--surface-2); }
.card-teal-tint { background: var(--teal-tint); border-color: transparent; }
.stat-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; }
.stat-value { font-size: 28px; line-height: 32px; font-weight: 700; color: var(--ink); }
.stat-value small { font-size: 16px; font-weight: 500; color: var(--muted); }
.stat-label { font-size: 14px; color: var(--muted); }
.stat-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; text-decoration: none; margin-top: 6px; }
.stat-delta { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.stat-delta.up { color: var(--success); } .stat-delta.down { color: var(--danger); }
.feature-card { text-align: center; padding: 20px 12px; }
.feature-card .icon-circle { margin: 0 auto 12px; }
.feature-card h3 { margin-bottom: 4px; }
.feature-card p { color: var(--muted); font-size: 15px; margin: 0; }
.tile { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; text-decoration: none; color: inherit; }
.tile:hover { border-color: var(--teal); }
.tile h3, .tile h4 { margin: 0 0 4px; font-size: 16px; }
.tile p { margin: 0; font-size: 14px; color: var(--muted); }
.tile .tile-arrow { margin-left: auto; align-self: center; color: var(--muted); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--teal-tint); color: var(--teal); }
.pill-sky { background: var(--sky); color: var(--sky-ink); } .pill-peach { background: var(--peach); color: var(--coral-ink); } .pill-sun { background: var(--sun-tint); color: #9A6A05; } .pill-grey { background: var(--border-2); color: var(--ink-2); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--peach); color: var(--coral-ink); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.progress { height: 10px; background: var(--border-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin: 20px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.banner { position: relative; overflow: hidden; border-radius: var(--radius-xl); background: linear-gradient(90deg, #FDF4EC 0%, #FBEFE4 100%); display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; min-height: 240px; }
.banner-copy { padding: 32px 36px; }
.banner-copy h1 { margin-bottom: 8px; }
.banner-copy p { color: var(--ink-2); max-width: 46ch; }
.banner-media { height: 100%; min-height: 240px; }
.banner-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cta-banner { display: flex; align-items: center; gap: 20px; background: var(--peach); border-radius: var(--radius-xl); padding: 24px 28px; flex-wrap: wrap; }
.cta-banner > .cta-text { flex: 1; min-width: 240px; }
.cta-banner h3 { margin: 0 0 4px; }
.cta-banner p { margin: 0; color: var(--ink-2); }

/* --- badges (status-{value} convention is used by every admin template) --- */
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; line-height: 16px; font-weight: 600; background: var(--border-2); color: var(--ink-2); white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.status-draft, .status-pending, .status-input_validated, .status-unknown, .status-expired, .status-scheduled, .status-requested { background: var(--border-2); color: var(--ink-2); }
.status-research_checked, .status-generated, .status-in_review, .status-info { background: var(--sky); color: var(--sky-ink); }
.status-expert_reviewed, .status-policy_checked, .status-escalated { background: var(--lavender); color: var(--lavender-ink); }
.status-print_qa, .status-renderable, .status-qa, .status-warning, .status-passed_with_warnings, .status-disputed { background: var(--sun-tint); color: #9A6A05; }
.status-released, .status-published, .status-active, .status-approved, .status-exported, .status-pass, .status-passed, .status-success, .status-connected, .status-completed, .status-confirmed, .status-paid { background: var(--success-bg); color: var(--success); }
.status-retired, .status-revoked, .status-rejected, .status-flagged_for_review, .status-fail, .status-blocked, .status-danger, .status-refunded, .status-reversed { background: var(--danger-bg); color: var(--danger); }
.severity-high { background: var(--danger-bg); color: var(--danger); } .severity-medium { background: var(--sun-tint); color: #9A6A05; } .severity-low { background: var(--teal-tint); color: var(--teal); }

/* --- tables --------------------------------------------------------------- */
/* position:relative so any absolutely-positioned descendant is contained by the
   scroller instead of by the initial containing block (see .sr-only above);
   max-width:100% so the wrapper itself can never be stretched by its content. */
.table-wrap { overflow-x: auto; position: relative; max-width: 100%; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; font-size: 14px; }
/* NO `overflow-wrap: anywhere` here — cells inherit break-word from body, which
   is what you want. `anywhere` collapses min-content width to one character, so
   table-layout:auto squeezes every column to ~1ch and stacks header text
   vertically instead of letting the table stay wide and scroll inside
   .table-wrap. Measured: it made /masuk/affiliate-payouts unreadable. */
.data-table th, .data-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
/* Bare in-cell textareas (admin review/KYC/payout/reversal notes) otherwise fall
   back to the browser default `cols` width (~181px) and force their column wide. */
.data-table textarea { width: 100%; min-width: 0; }
/* Caps the referral-URL column on /app/affiliate — the input is long-valued and
   would otherwise set the column's width from its content. */
.affiliate-link-input { max-width: 260px; }
.data-table th { background: var(--surface-2); font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #FDFBF7; }
.data-table .cell-title { font-weight: 600; color: var(--ink); }
.data-table .cell-sub { font-size: 13px; color: var(--muted); }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--sage); display: inline-flex; align-items: center; justify-content: center; color: var(--teal); flex-shrink: 0; }
.thumb-lg { width: 72px; height: 72px; }
.row-thumb { display: flex; align-items: center; gap: 12px; }

/* --- callouts / flash ------------------------------------------------------- */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--teal-tint); color: var(--ink-2); font-size: 14px; line-height: 20px; }
.callout .icon { width: 22px; height: 22px; color: var(--teal); flex-shrink: 0; margin-top: -1px; }
.callout-info { background: var(--sky); } .callout-info .icon { color: var(--sky-ink); }
.callout-success { background: var(--success-bg); } .callout-success .icon { color: var(--success); }
.callout-warning { background: var(--warning-bg); } .callout-warning .icon { color: var(--warning); }
.callout-danger { background: var(--danger-bg); } .callout-danger .icon { color: var(--danger); }
.callout-peach { background: var(--peach); } .callout-peach .icon { color: var(--coral-ink); }
.flash-success { background: var(--success-bg); border: 1px solid #A9DFBD; color: #16643A; padding: 12px 16px; border-radius: var(--radius-lg); margin-bottom: 16px; font-size: 14px; }
.flash-error { background: var(--danger-bg); border: 1px solid #E3A6A1; color: var(--danger); padding: 12px 16px; border-radius: var(--radius-lg); margin-bottom: 16px; font-size: 14px; }
.notice { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 20px 24px; margin-bottom: 20px; }
.notice-warning { background: var(--warning-bg); border-color: #F0D999; }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #FFF8F7; border: 1px solid #F0C9C5; border-radius: var(--radius-lg); padding: 16px 20px; margin-top: 20px; max-width: 680px; }
.danger-zone p { margin: 4px 0 0; }

/* --- page structure ------------------------------------------------------- */
.breadcrumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--teal); text-decoration: underline; }
.breadcrumbs span:last-child { color: var(--ink); font-weight: 600; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header h1, .page-header h2 { margin: 0; }
.page-header .subtitle { margin: 4px 0 0; }
.page-hero { position: relative; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 24px 28px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-hero p { color: var(--ink-2); max-width: 60ch; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a.active, .tabs a:hover { color: var(--teal); border-bottom-color: var(--teal); }
.filter-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .form-row { margin: 0; min-width: 160px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.split-3 { display: grid; grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.rail > * + * { margin-top: 16px; }
.stepper { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.stepper li { flex: 1; min-width: 120px; display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.stepper li .icon { width: 18px; height: 18px; color: var(--muted); }
.stepper li.done { background: var(--success-bg); border-color: transparent; } .stepper li.done .icon { color: var(--success); }
.stepper li.current { border-color: var(--teal); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-2); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }

/* --- app shell (workspace + admin) ---------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface-2); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 14px; }
.sidebar-brand { display: block; padding: 4px 8px 18px; text-decoration: none; }
.sidebar-nav { list-style: none; margin: 0; padding: 0; }
.sidebar-nav li + li { margin-top: 2px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 15px; }
.sidebar-nav a .icon { width: 20px; height: 20px; color: var(--muted); }
.sidebar-nav a:hover { background: var(--border-2); color: var(--ink); }
.sidebar-nav a.active { background: var(--teal-tint); color: var(--teal); font-weight: 600; }
.sidebar-nav a.active .icon { color: var(--teal); }
.sidebar-nav .nav-group { margin: 14px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sidebar-nav hr { margin: 12px 8px; }
.sidebar-nav .nav-badge { margin-left: auto; background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.sidebar-decor { margin-top: auto; padding-top: 24px; position: relative; min-height: 190px; }
.sidebar-decor .handwritten { position: absolute; left: 10px; bottom: 10px; width: 140px; font-size: 21px; line-height: 1.05; transform: rotate(-7deg); }
.sidebar-decor svg { position: absolute; left: 36px; bottom: 44px; width: 170px; height: auto; opacity: .95; }
.shell-main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 12px 28px; min-height: 68px; position: sticky; top: 0; z-index: 20; }
.topbar-title { font-size: 20px; font-weight: 700; margin: 0; white-space: nowrap; }
.topbar .search-box { flex: 1; max-width: 420px; margin-left: auto; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.topbar-user small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.nav-toggle { display: none; }
.nav-toggle-btn { display: none; }
.shell-content { padding: 24px 28px 56px; flex: 1; }
.shell-content > * + * { margin-top: 20px; }

/* --- auth split ----------------------------------------------------------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-visual { position: relative; overflow: hidden; background: #F6EEE4; display: flex; flex-direction: column; padding: 40px 44px; }
.auth-visual .auth-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 58% 30%; z-index: 0; }
.auth-visual::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(90deg, rgba(251,247,241,1) 0%, rgba(251,247,241,1) 28%, rgba(251,247,241,.9) 40%, rgba(251,247,241,.45) 56%, rgba(251,247,241,.08) 72%, rgba(251,247,241,0) 100%); }
.auth-visual .auth-headline { font-size: 40px; line-height: 46px; max-width: 9ch; }
.auth-visual > *:not(.auth-photo) { position: relative; z-index: 1; }
.auth-visual .auth-headline { font-size: 44px; line-height: 50px; font-weight: 700; letter-spacing: -.02em; max-width: 10ch; margin: 56px 0 18px; }
.auth-visual .lede { max-width: 30ch; }
.auth-badges { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-top: auto; padding-top: 40px; max-width: 560px; }
.auth-badges .feature-card { padding: 0; text-align: center; }
.auth-badges .feature-card p { font-size: 13px; }
.auth-panel { background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 32px; }
.auth-panel .kicker { align-self: flex-end; margin-bottom: 20px; color: var(--muted); letter-spacing: .28em; font-size: 11px; }
.auth-card { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 36px 36px 28px; }
.auth-card h1 { font-size: 34px; line-height: 40px; margin-bottom: 4px; }
.auth-card .lede { font-size: 17px; margin-bottom: 24px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 15px; }
.auth-foot a { font-weight: 600; }

/* --- public site chrome --------------------------------------------------- */
.site-header { background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.site-header-inner { max-width: 1120px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; }
.main-nav { display: flex; gap: 6px; margin-left: 12px; }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 10px; border-radius: 8px; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--teal); background: var(--teal-tint); }
.main-nav a.active { color: var(--ink); border-bottom-color: var(--teal); border-radius: 0; }
.site-header .header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cart-badge { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.cart-badge:hover { background: var(--teal-tint); color: var(--teal); }
.cart-badge .icon { width: 22px; height: 22px; }
.cart-badge-count { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.site-main { min-height: 60vh; }
.site-content { padding: 32px 24px 48px; }
.full-bleed { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.site-footer { background: var(--ink); color: #E9E2D4; margin-top: 64px; }
.site-footer-inner { max-width: 1120px; margin: 0 auto; padding: 40px 24px 28px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li + li { margin-top: 6px; }
.site-footer a { color: #E9E2D4; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .disclaimer { font-size: 13px; line-height: 19px; color: #C9C0AE; max-width: 68ch; }
.site-footer .footer-meta { font-size: 13px; color: #C9C0AE; grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; margin: 8px 0 0; display: flex; gap: 16px; flex-wrap: wrap; }
.back-link { margin-top: 32px; }
.back-link a { font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }

/* --- decor ---------------------------------------------------------------- */
.decor { position: absolute; pointer-events: none; }
.decor-bl { left: -20px; bottom: -20px; width: 220px; }
.decor-tr { right: -10px; top: -10px; width: 200px; }
.blob { position: absolute; border-radius: 50%; background: var(--peach); opacity: .6; pointer-events: none; }

/* --- utilities ------------------------------------------------------------ */
.hide { display: none !important; }
.list-reset { list-style: none; padding: 0; margin: 0; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.check-list li .icon { width: 20px; height: 20px; color: var(--teal); flex-shrink: 0; margin-top: 2px; }

/* --- responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .split-3 { grid-template-columns: 240px minmax(0,1fr); }
  .split-3 > :nth-child(3) { grid-column: 1 / -1; }
  .grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .2s; z-index: 40; box-shadow: var(--shadow-lg); }
  .nav-toggle:checked ~ .sidebar { transform: none; }
  .nav-toggle:checked ~ .shell-main::before { content: ""; position: fixed; inset: 0; background: rgba(31,42,68,.35); z-index: 35; }
  .nav-toggle-btn { display: inline-flex; }
  /* The topbar's children (title + search + actions) are all nowrap, so at
     ~390px they summed past the viewport and pushed the whole page into a
     horizontal scroll — on every admin and workspace screen, not just one.
     Let the row wrap and let each flexible part actually shrink. */
  .topbar { padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .topbar-title { font-size: 18px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar .search-box { flex: 1 1 100%; max-width: none; margin-left: 0; order: 3; }
  .topbar-actions { margin-left: auto; min-width: 0; }
  .topbar-user small { display: none; }
  .shell-content { padding: 16px 16px 48px; }
  .split, .split-3 { grid-template-columns: 1fr; }
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { min-height: 320px; padding: 28px 24px; }
  .auth-visual .auth-headline { font-size: 34px; line-height: 40px; margin-top: 24px; }
  .auth-badges { display: none; }
  .banner { grid-template-columns: 1fr; }
  .banner-media { min-height: 180px; order: -1; }
  .site-footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1, .h1 { font-size: 28px; line-height: 34px; }
  .display { font-size: 32px; line-height: 38px; }
  .container, .container-narrow { padding: 0 16px; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .site-header-inner { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; gap: 2px; }
  .main-nav a { font-size: 14px; padding: 8px 8px; white-space: nowrap; }
  .site-footer-inner { grid-template-columns: 1fr; }
  .stacked-form, .card-pad { padding: 16px; }
  .auth-card { padding: 24px 20px; }
  .auth-card h1 { font-size: 28px; line-height: 34px; }
  .page-header { align-items: flex-start; }
  .cta-banner { padding: 20px; }
}
@media print {
  .sidebar, .topbar, .site-header, .site-footer, .cookie-banner, .sticky-cta, .no-print { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}

/* --- auth forms (P14) ------------------------------------------------------
   The card itself is .auth-card, so the form inside it must NOT also be a
   .stacked-form — that nests two bordered surfaces. These rules cover only
   what the login/register/reset cards add on top of the shared form styles. */
.auth-form { margin: 24px 0 0; }
.auth-form .btn-block { margin-top: 20px; }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.checkbox-option.compact { font-size: 14px; }
.checkbox-option.compact input { width: 18px; height: 18px; }
.link-muted { color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.link-muted:hover { color: var(--teal); text-decoration: underline; }
.auth-alt { text-align: center; margin: 20px 0 0; font-size: 15px; color: var(--muted); }
.auth-alt a { font-weight: 600; }
.auth-card > .icon-circle { margin-bottom: 16px; }
.form-row.has-error input { border-color: #E3A6A1; }
.form-row.has-error input:focus { box-shadow: 0 0 0 3px var(--danger-bg); }

@media (max-width: 520px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .form-inline { align-items: flex-start; }
}

/* The right-hand badge sits where the photo is still opaque, so the cards
   carry their own translucent ground rather than relying on the gradient
   (which must stay soft — it is what makes the photo feel like a photo). */
.auth-badges .feature-card { background: rgba(251, 247, 241, .86); border-radius: var(--radius-lg); padding: 14px 10px; }
