/* ─── RESET & TOKENS ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #111111;
  --ink-2: #444444;
  --ink-3: #888888;
  --ink-4: #bbbbbb;
  --line: #e8e8e8;
  --surface: #f8f8f8;
  --white: #ffffff;
  --green: #1a7a4a;
  --green-bg: #f0faf4;
  --green-border: #a8dfc0;
  --red: #c0392b;
  --red-bg: #fdf2f0;
  --amber: #92650a;
  --amber-bg: #fef9ed;
  --blue: #1a4fa0;
  --blue-bg: #eff4ff;
  --r: 10px;
  --r-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.04);
  --shadow-md: 0 4px 24px rgba(0,0,0,.08);
}
body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ─── VIEWS ──────────────────────────────────────────────── */
.view { display: none; min-height: 100vh; }
.view.active { display: block; }

/* ─── SHARED COMPONENTS ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 22px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; font-family: inherit;
  transition: all .15s; cursor: pointer; border: none; white-space: nowrap;
}
.btn-primary   { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #333; }
.btn-secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-secondary:hover { border-color: #bbb; background: var(--surface); }
.btn-green     { background: var(--green); color: #fff; width: 100%; padding: 15px; font-size: 15px; border-radius: var(--r); }
.btn-green:hover { background: #156038; }
.btn-outline   { background: transparent; color: var(--ink-2); border: 1.5px solid var(--line); width: 100%; padding: 13px; font-size: 14px; border-radius: var(--r); }
.btn-outline:hover { border-color: #bbb; }
.btn-danger    { background: var(--red-bg); color: var(--red); border: 1px solid #f0b8b0; }
.btn-danger:hover { background: #f8e0dd; }
.btn-sm        { padding: 7px 14px; font-size: 13px; }
.btn:disabled  { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-loading::after { content: ''; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; margin-left: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; box-shadow: var(--shadow); }
.card-sm { padding: 20px; }

.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.form-input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); font-size: 14px; font-family: inherit;
  color: var(--ink); outline: none; transition: border-color .15s; background: var(--white);
}
.form-input:focus { border-color: var(--ink); }
.form-input.error { border-color: var(--red); }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }
.form-hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

.payout-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.payout-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.payout-option:hover {
  border-color: #cfcfcf;
  background: var(--surface);
}

.payout-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.payout-option-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: border-color .15s, background .15s;
}

.payout-option-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  transition: background .15s;
}

.payout-option-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.payout-option-copy {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.payout-option:has(input:checked) {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
  background: #fbfcfb;
}

.payout-option:has(input:checked) .payout-option-radio {
  border-color: var(--ink);
  background: var(--ink);
}

.payout-option:has(input:checked) .payout-option-radio::after {
  background: var(--white);
}

.badge { display: inline-block; padding: 2px 9px; border-radius: 100px; font-size: 12px; font-weight: 500; }
.badge-green  { background: var(--green-bg); color: var(--green); }
.badge-red    { background: var(--red-bg); color: var(--red); }
.badge-amber  { background: var(--amber-bg); color: var(--amber); }
.badge-gray   { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.badge-blue   { background: var(--blue-bg); color: var(--blue); }

.partner-help-toggle {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}

.partner-help-toggle summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.partner-help-toggle summary::-webkit-details-marker {
  display: none;
}

.partner-help-toggle summary::after {
  content: '+';
  float: right;
  color: var(--ink-3);
  font-size: 16px;
  line-height: 1;
}

.partner-help-toggle[open] summary::after {
  content: '−';
}

.partner-help-body {
  border-top: 1px solid var(--line);
  background: var(--white);
  padding: 14px;
}

.partner-help-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.partner-help-body p {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 12px;
}

.toggle { width: 42px; height: 23px; background: var(--line); border-radius: 12px; cursor: pointer; position: relative; transition: background .2s; flex-shrink: 0; }
.toggle.on { background: var(--green); }
.toggle::after { content: ''; position: absolute; width: 17px; height: 17px; background: white; border-radius: 50%; top: 3px; left: 3px; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on::after { left: 22px; }

.divider { height: 1px; background: var(--line); margin: 20px 0; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 16px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.alert { padding: 12px 16px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 16px; }
.alert-error   { background: var(--red-bg); color: var(--red); border: 1px solid #f0b8b0; }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.alert-info    { background: var(--blue-bg); color: var(--blue); border: 1px solid #b8d0f8; }

table { width: 100%; border-collapse: collapse; }
th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); background: var(--surface); border-bottom: 1px solid var(--line); }
td { padding: 13px 16px; font-size: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface); }
.table-wrap { border: 1px solid var(--line); border-radius: var(--r); overflow: auto; }
.sessions-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.sessions-layout.has-review-open { grid-template-columns: minmax(0, 1fr) 360px; }
.session-row { cursor: pointer; transition: background .15s, box-shadow .15s; }
.session-row.is-selected td { background: #fbfcfb; }
.session-order-cell { font-weight: 500; }
.risk-badge { min-width: 58px; text-align: center; }
.risk-badge-high { background: var(--red-bg); color: var(--red); border: 1px solid #f0b8b0; }
.session-review-drawer {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 22px;
  position: sticky;
  top: 86px;
  min-height: 520px;
}
.session-review-drawer.hidden { display: none; }
.session-review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.session-review-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
  margin-bottom: 6px;
}
.session-review-title {
  font-family: 'DM Serif Display', serif;
  font-size: 24px;
  line-height: 1.05;
}
.session-review-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 22px;
  line-height: 1;
}
.session-review-close:hover { background: var(--surface); color: var(--ink); }
.session-review-empty {
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.6;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  padding: 18px;
}
.session-review-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.session-review-label {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.session-review-value { font-size: 14px; font-weight: 600; }
.session-review-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.session-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.session-review-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 12px;
}
.session-review-chip-value {
  font-family: 'DM Serif Display', serif;
  font-size: 23px;
  line-height: 1;
}
.session-review-chip-label {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 5px;
}
.session-review-section { margin-top: 18px; }
.session-review-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.session-review-note {
  background: var(--amber-bg);
  border: 1px solid #f2deb5;
  color: #6d5312;
  border-radius: var(--r-sm);
  padding: 12px 13px;
  font-size: 13px;
  line-height: 1.55;
}
.session-signal-list,
.session-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-signal-item,
.session-timeline-item {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 13px;
}
.session-signal-head,
.session-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.session-signal-title,
.session-timeline-title { font-size: 13px; font-weight: 600; }
.session-signal-detail,
.session-timeline-detail {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.55;
}
.signal-tone-good { color: var(--green); }
.signal-tone-warn { color: var(--amber); }
.signal-tone-info { color: var(--blue); }

.stat-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 24px; box-shadow: var(--shadow); }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 6px; }
.stat-value { font-family: 'DM Serif Display', serif; font-size: 30px; color: var(--ink); }
.stat-change { font-size: 12px; margin-top: 4px; color: var(--ink-3); }
.stat-up   { color: var(--green); }
.stat-down { color: var(--red); }

.section-title { font-family: 'DM Serif Display', serif; font-size: 26px; letter-spacing: -.01em; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-title { font-family: 'DM Serif Display', serif; font-size: 24px; letter-spacing: -.01em; }
.page-sub   { font-size: 13px; color: var(--ink-3); margin-top: 3px; }

.tabs { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; width: fit-content; }
.tab { padding: 7px 14px; border-radius: 5px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink-3); transition: all .15s; }
.tab.active { background: var(--white); color: var(--ink); box-shadow: var(--shadow); }

.empty-state { text-align: center; padding: 60px 24px; color: var(--ink-3); }
.empty-state h3 { font-size: 16px; color: var(--ink-2); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 320px; margin: 0 auto 20px; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .25s ease forwards; }

/* ─── NAV ────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: 58px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; z-index: 100;
}
.nav-logo { font-family: 'DM Serif Display', serif; font-size: 20px; cursor: pointer; }
.brand-tm { font-family: 'DM Sans', sans-serif; font-size: .45em; font-weight: 600; margin-left: 2px; vertical-align: super; letter-spacing: 0; }
.nav-links { display: flex; align-items: center; gap: 6px; }

#auth { padding-top: 58px; background: var(--surface); min-height: 100vh; flex-direction: column; }
#auth.active { display: flex; }
.auth-wrap { width: min(100%, 476px); margin: 48px auto; padding: 0 24px; flex: 1; }
.auth-logo  { font-family: 'DM Serif Display', serif; font-size: 22px; text-align: center; margin-bottom: 28px; }
.auth-card  { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 36px; box-shadow: var(--shadow-md); }
.auth-card h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.auth-card p.sub { font-size: 13px; color: var(--ink-3); margin-bottom: 24px; }
.auth-footer { display: flex; align-items: center; justify-content: center; gap: 5px; text-align: center; margin-top: 20px; font-size: 13px; color: var(--ink-3); }
.auth-link { color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; padding: 4px 2px; line-height: 1.2; }
.auth-link:hover { text-decoration: underline; }

/* ─── CUSTOMER RETURN FLOW ───────────────────────────────── */
#return-flow { background: var(--surface); min-height: 100vh; padding-bottom: 80px; }
.return-nav { height: 52px; background: rgba(255,255,255,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 20px; }
.return-logo { font-family: 'DM Serif Display', serif; font-size: 17px; color: var(--ink-2); }
.return-wrap { max-width: 420px; margin: 0 auto; padding: 24px 20px; }

.merchant-header { display: flex; align-items: center; gap: 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 20px; }
.merchant-logo { width: 38px; height: 38px; border-radius: 8px; background: var(--ink); display: flex; align-items: center; justify-content: center; color: white; font-family: 'DM Serif Display', serif; font-size: 17px; flex-shrink: 0; }
.merchant-name  { font-size: 14px; font-weight: 600; }
.merchant-sub   { font-size: 12px; color: var(--ink-3); }

.progress-bar { display: flex; gap: 3px; margin-bottom: 24px; }
.progress-step { height: 3px; flex: 1; border-radius: 2px; background: var(--line); transition: background .3s; }
.progress-step.done   { background: var(--ink); }
.progress-step.active { background: var(--ink-3); }

.flow-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-4); margin-bottom: 16px; }
.flow-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 28px; box-shadow: var(--shadow); }
.flow-card h2 { font-family: 'DM Serif Display', serif; font-size: 22px; margin-bottom: 6px; letter-spacing: -.01em; }
.flow-card .sub { font-size: 13px; color: var(--ink-2); margin-bottom: 24px; line-height: 1.6; }

.order-found { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; margin-bottom: 20px; }
.order-found-label { font-size: 11px; color: var(--ink-3); margin-bottom: 6px; }
.order-found-row { display: flex; align-items: center; justify-content: space-between; }
.order-found-name { font-size: 14px; font-weight: 500; }
.order-found-sub  { font-size: 12px; color: var(--ink-3); }

.reason-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; }
.reason-opt { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm); cursor: pointer; transition: all .15s; }
.reason-opt:hover { border-color: #bbb; background: var(--surface); }
.reason-opt.selected { border-color: var(--ink); background: var(--surface); }
.reason-radio { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .15s; }
.reason-opt.selected .reason-radio { border-color: var(--ink); background: var(--ink); }
.reason-opt.selected .reason-radio::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: white; }
.reason-text { font-size: 14px; }

.trust-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border-radius: var(--r-sm); margin-bottom: 20px; }
.trust-note span { font-size: 12px; color: var(--ink-3); }

.keep-banner { background: var(--green-bg); border: 1.5px solid var(--green-border); border-radius: var(--r); padding: 22px; margin-bottom: 20px; text-align: center; }
.keep-label  { font-size: 12px; font-weight: 500; color: var(--green); margin-bottom: 4px; }
.keep-amount { font-family: 'DM Serif Display', serif; font-size: 44px; color: var(--green); display: block; margin-bottom: 4px; }
.keep-sublabel { font-size: 12px; color: #5a9a6a; }
.keep-perks { display: flex; justify-content: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.keep-perk  { font-size: 12px; color: var(--green); }

.second-chance { background: var(--surface); border-radius: var(--r-sm); padding: 12px 14px; margin: 14px 0 12px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

.photo-zone { border: 2px dashed var(--line); border-radius: var(--r-sm); padding: 28px; text-align: center; cursor: pointer; transition: all .15s; margin-bottom: 10px; }
.photo-zone:hover { border-color: #bbb; background: var(--surface); }
.photo-zone-icon { margin-bottom: 7px; display: flex; justify-content: center; color: var(--ink-3); }
.photo-zone p    { font-size: 13px; color: var(--ink-2); }
.photo-zone small { font-size: 12px; color: var(--ink-3); }
.photo-zone.uploaded { border-style: solid; border-color: var(--green); background: var(--green-bg); }

.ineligible-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 32px 28px; text-align: center; box-shadow: var(--shadow); }
.ineligible-icon { margin-bottom: 16px; display: flex; justify-content: center; color: var(--ink-3); }
.ineligible-card h2 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.ineligible-card p  { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin-bottom: 20px; }

.success-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 32px 28px; text-align: center; box-shadow: var(--shadow); }
.success-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--green-bg); border: 2px solid var(--green-border); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; color: var(--green); }
.success-card h2 { font-family: 'DM Serif Display', serif; font-size: 22px; margin-bottom: 8px; }
.success-card p  { font-size: 14px; color: var(--ink-2); margin-bottom: 20px; }
.code-box { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; margin-bottom: 6px; transition: border-color .15s; }
.code-box:hover { border-color: #bbb; }
.code-val { font-family: monospace; font-size: 20px; font-weight: 700; letter-spacing: .12em; }
.code-copy { font-size: 12px; color: var(--ink-3); }
.doc-endpoint-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px; min-width: 0; }
.doc-endpoint-code { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.7; white-space: normal; overflow-wrap: anywhere; word-break: break-word; }

/* ─── DASHBOARD LAYOUT ───────────────────────────────────── */
#dashboard { padding-top: 58px; min-height: 100vh; background: var(--surface); }
#dashboard.active { display: flex; }
.sidebar { width: 230px; background: var(--white); border-right: 1px solid var(--line); padding: 20px 14px; flex-shrink: 0; position: fixed; top: 58px; left: 0; bottom: 0; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar-section { margin-bottom: 4px; }
.sidebar-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-4); padding: 6px 10px 3px; }
.sidebar-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink-2); cursor: pointer; transition: all .15s; }
.sidebar-item:hover { background: var(--surface); color: var(--ink); }
.sidebar-item.active { background: var(--surface); color: var(--ink); font-weight: 500; }
.sidebar-icon { width: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; opacity: .7; }
.sidebar-badge { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.sidebar-bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.plan-chip { background: var(--green-bg); border-radius: var(--r-sm); padding: 10px 12px; }
.plan-chip-name { font-size: 12px; font-weight: 600; color: var(--green); }
.plan-chip-sub  { font-size: 11px; color: #5a9a6a; margin-top: 1px; }
.plan-progress { height: 4px; background: #c8e8d4; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.plan-progress-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width .3s; }

.dash-content { margin-left: 230px; flex: 1; padding: 28px 28px 60px; min-width: 0; }
.dash-tab { display: none; }
.dash-tab.active { display: block; animation: fadeIn .2s ease; }

.metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); gap: 14px; margin-bottom: 24px; }

.chart-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); }
.chart-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.chart-sub   { font-size: 12px; color: var(--ink-3); margin-bottom: 20px; }

.bar-chart { display: flex; align-items: flex-end; gap: 5px; height: 100px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; }
.bar-inner { flex: 1; display: flex; align-items: flex-end; gap: 2px; width: 100%; }
.bar { flex: 1; border-radius: 2px 2px 0 0; min-height: 3px; transition: opacity .15s; }
.bar:hover { opacity: .75; }
.bar-ink  { background: var(--ink); }
.bar-line { background: #bdbdbd; }
.bar-lbl  { font-size: 9px; color: var(--ink-4); }
.chart-legend { display: flex; gap: 14px; margin-top: 14px; }
.legend-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); }

.outcome-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.outcome-stat { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface); }
.outcome-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 4px; }
.outcome-value { font-family: 'DM Serif Display', serif; font-size: 28px; line-height: 1; }
.outcome-bar-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.outcome-bar-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 12px; }
.outcome-bar-name { font-size: 12px; color: var(--ink-2); }
.outcome-track { height: 9px; border-radius: 99px; background: var(--line); overflow: hidden; }
.outcome-fill { height: 100%; border-radius: inherit; min-width: 4px; }
.outcome-fill.prevented { background: var(--ink); }
.outcome-fill.return-flow { background: #bdbdbd; }
.outcome-count { font-size: 12px; font-weight: 600; color: var(--ink); text-align: right; }
.chart-note { font-size: 12px; color: var(--ink-3); line-height: 1.55; margin-bottom: 14px; }

.donut-wrap   { position: relative; width: 110px; height: 110px; margin: 0 auto 14px; }
.donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; }
.donut-pct    { font-family: 'DM Serif Display', serif; font-size: 20px; }
.donut-sub    { font-size: 10px; color: var(--ink-3); }

.reason-rows { display: flex; flex-direction: column; gap: 7px; }
.reason-row  { display: flex; align-items: center; gap: 9px; }
.reason-name { font-size: 12px; color: var(--ink-2); width: 100px; flex-shrink: 0; }
.reason-track { flex: 1; height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.reason-fill  { height: 100%; background: var(--ink); border-radius: 3px; }
.reason-pct   { font-size: 12px; color: var(--ink-3); width: 30px; text-align: right; }

.roi-banner { background: var(--green-bg); border: 1.5px solid var(--green-border); border-radius: var(--r); padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.roi-left h3 { font-size: 12px; font-weight: 600; color: var(--green); margin-bottom: 3px; }
.roi-left .val { font-family: 'DM Serif Display', serif; font-size: 28px; color: var(--ink); }
.roi-left .sub { font-size: 12px; color: #5a9a6a; }
.roi-right { text-align: right; }
.roi-right .val  { font-family: 'DM Serif Display', serif; font-size: 28px; color: var(--green); }

/* Settings */
.settings-block { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.settings-block h3 { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.settings-block .desc { font-size: 12px; color: var(--ink-3); margin-bottom: 18px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--line); gap: 16px; }
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 14px; }
.setting-sub   { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.slider-row { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.slider { flex: 1; -webkit-appearance: none; height: 4px; border-radius: 2px; background: var(--line); cursor: pointer; outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.slider-val { font-size: 13px; font-weight: 600; min-width: 38px; text-align: right; }
.setting-input { padding: 8px 11px; border: 1.5px solid var(--line); border-radius: var(--r-sm); font-family: inherit; font-size: 13px; outline: none; min-width: 220px; }
.setting-input:focus { border-color: var(--ink); }
.reason-rules-lock { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface); font-size: 12px; color: var(--ink-2); margin-bottom: 14px; }
.reason-rule-card { border: 1px solid #ddd9cf; border-radius: 14px; padding: 18px; background: linear-gradient(180deg, #fffdfa 0%, #ffffff 100%); box-shadow: 0 8px 24px rgba(17,17,17,.04); margin-bottom: 16px; }
.reason-rule-card.is-inactive { opacity: .72; background: linear-gradient(180deg, #fbfbfb 0%, #f5f5f5 100%); }
.reason-rule-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap; }
.reason-rule-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.reason-rule-copy { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.reason-rule-actions { display: flex; gap: 8px; justify-content: flex-end; }
.reason-rule-section { border: 1px solid #ece7dd; border-radius: 12px; background: #fff; padding: 14px; margin-top: 14px; }
.reason-rule-section-offer { background: linear-gradient(180deg, #fcfbf7 0%, #ffffff 100%); }
.reason-rule-section-guardrails { background: linear-gradient(180deg, #f9fafc 0%, #ffffff 100%); }
.reason-rule-section-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.reason-rule-grid { display: grid; gap: 12px; align-items: end; }
.reason-rule-grid-basic { grid-template-columns: 1.4fr 1fr 1fr; }
.reason-rule-grid-offer { grid-template-columns: 1fr 1fr; }
.reason-rule-grid-values { grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); margin-top: 12px; }
.reason-rule-grid-guardrails { grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); }
.reason-rule-summary { min-height: 44px; border: 1px solid #e7dfcf; border-radius: 12px; padding: 12px; background: #fffaf0; font-size: 12px; color: var(--ink-2); display: flex; align-items: center; }
.reason-rule-hint { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.reason-rule-footer { font-size: 11px; color: var(--ink-3); margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e2dccf; }

/* QR card preview */
.card-preview { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; max-width: 330px; box-shadow: var(--shadow-md); }
.card-preview-inner { border: 1px solid var(--line); border-radius: 8px; padding: 18px; text-align: center; position: relative; overflow: hidden; }
.card-preview-inner:before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--ink); opacity: .9; }
.card-preview-brand { font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.card-preview-tag   { font-size: 10px; color: var(--ink-3); margin-bottom: 14px; }
.card-preview-hl    { font-family: 'DM Serif Display', serif; font-size: 18px; font-weight: 600; margin-bottom: 4px; line-height: 1.15; }
.card-preview-sub   { font-size: 11px; color: var(--ink-3); margin-bottom: 14px; }
.qr-mock { width: 96px; height: 96px; background: var(--white); border: 7px solid var(--white); border-radius: 8px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.qr-mock img { width: 100%; height: 100%; display: none; }
.qr-pattern { width: 66px; height: 66px; background-image: linear-gradient(45deg,white 25%,transparent 25%), linear-gradient(-45deg,white 25%,transparent 25%), linear-gradient(45deg,transparent 75%,white 75%), linear-gradient(-45deg,transparent 75%,white 75%); background-size: 7px 7px; background-position: 0 0,0 3.5px,3.5px -3.5px,-3.5px 0; opacity: .88; border-radius: 2px; }
.qr-cta { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--ink); color: white; padding: 6px 12px; border-radius: 5px; display: inline-block; margin-bottom: 10px; }
.qr-perks { display: flex; justify-content: center; gap: 10px; font-size: 9px; color: var(--ink-3); }
.qr-url-box { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 1.5px solid var(--ink); border-radius: var(--r-sm); background: var(--white); }
.qr-url-text { flex: 1; min-width: 0; font-family: monospace; font-size: 13px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; max-width: 330px; }
.copy-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.copy-preset { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 10px; font-size: 12px; cursor: pointer; transition: all .15s; }
.copy-preset:hover { border-color: var(--ink); background: var(--white); }

/* Onboarding */
.setup-step { display: flex; gap: 14px; padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 12px; }
.setup-num { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--ink-2); flex-shrink: 0; margin-top: 2px; }
.setup-step.done .setup-num { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.setup-step h4 { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.setup-step p  { font-size: 13px; color: var(--ink-2); }
.setup-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Store selector */
.store-selector { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--green-bg); border: 1px solid var(--green-border); border-radius: var(--r-sm); cursor: pointer; color: var(--green); transition: background .15s, border-color .15s, box-shadow .15s; }
.store-selector:hover { background: #e7f6ee; border-color: #7ec79d; box-shadow: 0 4px 10px rgba(26,122,74,.08); }
.store-selector-name { font-size: 13px; font-weight: 600; color: var(--green); }
.store-selector-arrow { font-size: 11px; color: var(--green); }
#store-dd { background: var(--white); border: 1px solid var(--green-border) !important; }
.store-dd-item { padding: 10px 14px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--line); transition: background .15s, color .15s; }
.store-dd-item:last-child { border-bottom: none; }
.store-dd-item:hover { background: var(--green-bg); color: var(--green); }
.store-dd-item:hover span { color: var(--green) !important; }
.store-dd-item-add { padding: 10px 14px; cursor: pointer; font-size: 13px; color: var(--green); font-weight: 500; transition: background .15s, color .15s; }
.store-dd-item-add:hover { background: var(--green-bg); }
.store-dd-item-disabled { opacity: .55; cursor: not-allowed; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* ─── ADMIN ───────────────────────────────────────────────── */
#admin { padding-top: 58px; }
.admin-nav { background: var(--ink); color: white; }
.admin-nav .nav-logo { color: white; }
.admin-content { max-width: 1440px; margin: 0 auto; padding: 32px 28px 80px; }
.admin-stat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 14px; margin-bottom: 28px; }
.admin-stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.admin-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 6px; }
.admin-stat-val   { font-family: 'DM Serif Display', serif; font-size: 28px; }
/* ─── MODAL ───────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--white);
  border-radius: var(--r);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-wide { max-width: 560px; }
.admin-modal-panel.hidden { display: none; }
.admin-modal-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}
.form-input[readonly] {
  background: var(--surface);
  color: var(--ink-3);
  cursor: not-allowed;
}
.modal h3 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.modal .sub { font-size: 13px; color: var(--ink-3); margin-bottom: 22px; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  position: sticky;
  bottom: -28px;
  background: linear-gradient(to top, var(--white) 78%, rgba(255,255,255,0));
  padding-top: 16px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Dashboard mobile */
  .sidebar { display: none; }
  .mobile-menu-btn { 
    display: block; 
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    width: 56px; 
    height: 56px; 
    border-radius: 50%; 
    background: var(--ink); 
    color: white; 
    border: none; 
    box-shadow: 0 4px 12px rgba(0,0,0,.3); 
    cursor: pointer;
    z-index: 100;
    font-size: 24px;
  }
  .sidebar.mobile-open { 
    display: block; 
    position: fixed; 
    top: 0; 
    left: 0; 
    height: 100vh; 
    z-index: 200; 
    box-shadow: 2px 0 8px rgba(0,0,0,.2);
  }
  .mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 150;
  }
  .mobile-overlay.active { display: block; }
  .dash-content { margin-left: 0; padding: 20px 16px 60px; }
  .chart-row { grid-template-columns: 1fr; }
  .sessions-layout.has-review-open { grid-template-columns: 1fr; }
  .session-review-drawer { position: static; min-height: 0; }
  .session-review-grid { grid-template-columns: 1fr 1fr; }
  
  /* Landing page mobile */
  .nav { padding: 16px 20px; }
  .nav-links { flex-direction: column; gap: 8px; align-items: stretch; }
  .nav-links .btn { width: 100%; justify-content: center; }
  
  .hero { padding: 48px 24px 32px; }
  .hero h1 { font-size: 36px; line-height: 1.15; }
  .hero-btns { flex-direction: column; gap: 12px; }
  .hero-btns .btn { width: 100%; justify-content: center; }
  
  .stats-bar { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px; 
    padding: 32px 20px;
  }
  .stat-num { font-size: 28px; }
  .stat-lab { font-size: 11px; }
  
  .features-grid { grid-template-columns: 1fr; }
  .feature-item { padding: 24px 20px; }
  
  .step { flex-direction: column; align-items: flex-start; gap: 16px; }
  .step-num { margin: 0; }
  
  .pricing-cards { flex-direction: column; align-items: center; }
  .pricing-card { max-width: 100%; width: 100%; }
  
  .email-row { flex-direction: column; }
  .email-row input { width: 100%; }
  .reason-rule-grid-basic,
  .reason-rule-grid-offer,
  .reason-rule-grid-values,
  .reason-rule-grid-guardrails { grid-template-columns: 1fr; }
}
