/* CedarPay – brand layer on top of Bootstrap 5.3 */
:root {
  --cp-forest: #0b3d2e;
  --cp-forest-2: #12503d;
  --cp-forest-3: #1c6b52;
  --cp-green: #1fb15a;
  --cp-green-soft: #e3f6ea;
  --cp-charcoal: #1d2521;
  --cp-muted: #5f6b66;
  --cp-line: #e3e8e5;
  --cp-bg: #f6f8f7;
  --cp-amber: #b7791f;
  --cp-red: #c0392b;
  --bs-primary: #0b3d2e;
  --bs-primary-rgb: 11, 61, 46;
  --bs-success: #1fb15a;
  --bs-success-rgb: 31, 177, 90;
  --bs-body-color: #1d2521;
  --bs-body-bg: #f6f8f7;
  --bs-border-color: #e3e8e5;
  --bs-link-color: #12503d;
  --bs-link-color-rgb: 18, 80, 61;
  --bs-link-hover-color: #0b3d2e;
  --bs-font-sans-serif: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-border-radius: .5rem;
}
body { font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
.font-mono, code, .kbd-key { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
code { color: var(--cp-forest-2); background: var(--cp-green-soft); padding: .1rem .35rem; border-radius: .25rem; font-size: .85em; }
.text-muted { color: var(--cp-muted) !important; }
.small-caps { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 600; color: var(--cp-muted); }

/* Buttons */
.btn-primary { --bs-btn-bg: var(--cp-forest); --bs-btn-border-color: var(--cp-forest); --bs-btn-hover-bg: var(--cp-forest-2); --bs-btn-hover-border-color: var(--cp-forest-2); --bs-btn-active-bg: var(--cp-forest-3); --bs-btn-disabled-bg: var(--cp-forest); --bs-btn-disabled-border-color: var(--cp-forest); }
.btn-accent { --bs-btn-color: #fff; --bs-btn-bg: var(--cp-green); --bs-btn-border-color: var(--cp-green); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #179a4c; --bs-btn-hover-border-color: #179a4c; --bs-btn-active-bg: #148342; --bs-btn-active-color: #fff; font-weight: 600; }
.btn-outline-primary { --bs-btn-color: var(--cp-forest); --bs-btn-border-color: var(--cp-forest); --bs-btn-hover-bg: var(--cp-forest); --bs-btn-hover-border-color: var(--cp-forest); --bs-btn-active-bg: var(--cp-forest); }
.btn { font-weight: 500; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--cp-forest-3); box-shadow: 0 0 0 .2rem rgba(31, 177, 90, .2); }
.form-check-input:checked { background-color: var(--cp-forest); border-color: var(--cp-forest); }
.form-label { font-weight: 500; font-size: .9rem; }

/* Brand mark */
.cp-mark { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; letter-spacing: -.01em; color: inherit; text-decoration: none; }
.cp-mark svg { flex: none; }
.cp-mark span b { color: var(--cp-green); font-weight: 700; }

/* ---------------- Public site ---------------- */
.site-nav { background: #fff; border-bottom: 1px solid var(--cp-line); }
.site-nav .nav-link { color: var(--cp-charcoal); font-weight: 500; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { color: var(--cp-forest-3); }
.hero { background: var(--cp-forest); color: #e9f3ee; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: auto -10% -60% 40%; height: 120%; background: radial-gradient(closest-side, rgba(31,177,90,.35), transparent); pointer-events: none; }
.hero h1 { color: #fff; font-weight: 750; letter-spacing: -.025em; line-height: 1.08; }
.hero .lead { color: #c7ddd3; }
.hero .eyebrow { color: var(--cp-green); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .8rem; }
.flow-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 1rem; padding: 1.25rem; backdrop-filter: blur(4px); }
.flow-step { display: flex; gap: .75rem; align-items: flex-start; padding: .65rem 0; border-bottom: 1px dashed rgba(255,255,255,.12); color: #d7e8df; font-size: .92rem; }
.flow-step:last-child { border-bottom: 0; }
.flow-dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; flex: none; background: rgba(31,177,90,.18); color: #7fe0a6; }
.flow-step.done .flow-dot { background: var(--cp-green); color: #fff; }
.section { padding: 4.5rem 0; }
.section-title { font-weight: 700; letter-spacing: -.02em; }
.feature { background: #fff; border: 1px solid var(--cp-line); border-radius: .9rem; padding: 1.5rem; height: 100%; }
.feature .bi { font-size: 1.4rem; color: var(--cp-forest-3); background: var(--cp-green-soft); width: 2.6rem; height: 2.6rem; border-radius: .6rem; display: grid; place-items: center; margin-bottom: .9rem; }
.feature h3 { font-size: 1.05rem; font-weight: 650; }
.provider-chip { display: inline-flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--cp-line); border-radius: 2rem; padding: .4rem .9rem; font-weight: 600; font-size: .9rem; }
.provider-chip i { width: .7rem; height: .7rem; border-radius: 50%; display: inline-block; }
.code-panel { background: #0a1f18; color: #cfe6da; border-radius: .9rem; padding: 1.25rem 1.4rem; font-size: .84rem; overflow-x: auto; border: 1px solid #143a2d; }
.code-panel .k { color: #7fe0a6; } .code-panel .s { color: #f3d58a; } .code-panel .c { color: #6f8f80; }
.site-footer { background: var(--cp-charcoal); color: #aab6b0; font-size: .9rem; }
.site-footer a { color: #d6e2dc; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.notice { border-left: 3px solid var(--cp-amber); background: #fff8eb; padding: .9rem 1.1rem; border-radius: .4rem; font-size: .92rem; }

/* ---------------- Auth ---------------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .auth-wrap { grid-template-columns: 5fr 7fr; } }
.auth-aside { background: var(--cp-forest); color: #cfe2d8; padding: 3rem; display: none; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::after { content: ""; position: absolute; width: 520px; height: 520px; right: -200px; bottom: -220px; background: radial-gradient(closest-side, rgba(31,177,90,.35), transparent); }
@media (min-width: 992px) { .auth-aside { display: flex; } }
.auth-aside h2 { color: #fff; font-weight: 700; letter-spacing: -.02em; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 620px; }

/* ---------------- Portal shell ---------------- */
.portal { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; background: var(--cp-forest); color: #b9d0c5; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 1.1rem 1.25rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .env-pill { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .15rem .45rem; border-radius: .3rem; background: rgba(255,255,255,.1); color: #cfe2d8; }
.sidebar .nav-section { padding: 1rem 1.25rem .35rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #7fa392; font-weight: 600; }
.sidebar .side-link { display: flex; align-items: center; gap: .7rem; padding: .5rem 1.25rem; color: #c7dbd1; text-decoration: none; font-size: .9rem; border-left: 3px solid transparent; }
.sidebar a.side-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar a.side-link.active { color: #fff; background: rgba(31,177,90,.14); border-left-color: var(--cp-green); }
.sidebar .side-link .bi { font-size: 1.05rem; opacity: .9; }
.sidebar .side-foot { margin-top: auto; padding: 1rem 1.25rem; font-size: .75rem; color: #7fa392; border-top: 1px solid rgba(255,255,255,.08); }
.portal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--cp-line); padding: .7rem 1.5rem; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 20; }
.topbar .page-title { font-size: 1.05rem; font-weight: 650; margin: 0; }
.content { padding: 1.5rem; max-width: 1360px; width: 100%; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; left: -260px; z-index: 1040; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .content { padding: 1rem; }
}
.admin-portal .sidebar { background: #10221b; }
.admin-portal .sidebar a.side-link.active { background: rgba(31,177,90,.12); }

/* Cards, stats, tables */
.card { border-color: var(--cp-line); border-radius: .75rem; }
.card-header { background: #fff; border-bottom-color: var(--cp-line); font-weight: 600; padding: .85rem 1.1rem; }
.stat { background: #fff; border: 1px solid var(--cp-line); border-radius: .75rem; padding: 1rem 1.15rem; height: 100%; }
.stat .label { font-size: .78rem; color: var(--cp-muted); font-weight: 500; }
.stat .value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: .2rem; }
.stat .hint { font-size: .78rem; color: var(--cp-muted); }
.table { --bs-table-bg: transparent; font-size: .9rem; }
.table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--cp-muted); font-weight: 600; border-bottom-width: 1px; white-space: nowrap; }
.table > :not(caption) > * > * { padding: .65rem .8rem; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #f2f7f4; }
.badge-status { font-weight: 600; font-size: .72rem; padding: .3em .6em; border-radius: .35rem; letter-spacing: .02em; }
.st-pending { background: #eef1f0; color: #4b5853; }
.st-under_review, .st-submitted, .st-open, .st-pending_cedarpay { background: #fff3d6; color: #8a5a00; }
.st-approved, .st-accepted, .st-active, .st-resolved { background: var(--cp-green-soft); color: #136b38; }
.st-rejected, .st-revoked, .st-disabled, .st-locked { background: #fde7e4; color: #9d2b1f; }
.st-suspended { background: #fde7e4; color: #9d2b1f; }
.st-restricted, .st-pending_merchant { background: #e8eefc; color: #2c4a9a; }
.st-closed, .st-expired { background: #eef1f0; color: #5f6b66; }
.env-badge { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .2em .5em; border-radius: .3rem; }
.env-sandbox { background: #fff3d6; color: #8a5a00; }
.env-live { background: var(--cp-green-soft); color: #136b38; }
.checklist li { display: flex; align-items: center; gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--cp-line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .tick { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; flex: none; border: 1.5px solid #c9d3ce; color: transparent; }
.checklist .done .tick { background: var(--cp-green); border-color: var(--cp-green); color: #fff; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.3rem; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: .4rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--cp-forest-3); }
.timeline li::after { content: ""; position: absolute; left: .24rem; top: 1rem; bottom: 0; width: 1px; background: var(--cp-line); }
.timeline li:last-child::after { display: none; }
.secret-box { background: #0a1f18; color: #d7f5e3; border-radius: .6rem; padding: .9rem 1rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; word-break: break-all; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--cp-muted); }
.empty .bi { font-size: 2rem; color: #b5c4bc; display: block; margin-bottom: .5rem; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.bar-chart .bar { flex: 1; background: var(--cp-forest-3); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bar-chart .bar:hover { opacity: 1; background: var(--cp-green); }
.qr-box svg { width: 200px; height: 200px; }
.hash { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .75rem; color: var(--cp-muted); }
pre.json { background: #f2f5f3; border: 1px solid var(--cp-line); border-radius: .5rem; padding: .75rem; font-size: .8rem; max-height: 360px; overflow: auto; margin: 0; }
.msg { border: 1px solid var(--cp-line); border-radius: .6rem; padding: .85rem 1rem; background: #fff; }
.msg.staff { background: #f2f8f5; border-color: #cfe5d9; }
.msg.internal { background: #fff8eb; border-color: #f0dcae; }

/* Payment statuses */
.st-successful { background: var(--cp-green-soft); color: #136b38; }
.st-created, .st-processing { background: #eef1f0; color: #4b5853; }
.st-unknown { background: #e8eefc; color: #2c4a9a; }
.st-failed, .st-cancelled { background: #fde7e4; color: #9d2b1f; }
.st-reversed { background: #f1e8fb; color: #5b2c91; }

/* Keep the brand <code> style out of the API reference */
.swagger-ui code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.swagger-ui .info .title { font-family: inherit; }

/* ---- Milestone 4: finance statuses & severities ---- */
.st-pending_approval, .st-investigating, .st-acknowledged { background: #fff3d6; color: #8a5a00; }
.st-queued, .st-auto_approved, .st-retired, .st-superseded, .st-info, .st-low { background: #eef1f0; color: #4b5853; }
.st-paid, .st-matched { background: var(--cp-green-soft); color: #136b38; }
.st-warning, .st-medium, .st-mismatch, .st-unmatched, .st-duplicate { background: #fff3d6; color: #8a5a00; }
.st-critical, .st-high { background: #fde7e4; color: #9d2b1f; }
.money-pos { color: #136b38; }
.money-neg { color: #9d2b1f; }
.balance-strip .stat .value { font-size: 1.35rem; }
