:root {
    --ink: #17221d;
    --muted: #6f7e76;
    --paper: #f3f5ef;
    --surface: #ffffff;
    --line: #dfe5dc;
    --green: #176b4a;
    --green-dark: #0e4c34;
    --lime: #d9f25f;
    --orange: #ed8b43;
    font-family: Tahoma, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
select { font: inherit; }
a { color: inherit; text-decoration: none; }

.login-body {
    min-height: 100vh;
    background: var(--green-dark);
    background-image: radial-gradient(circle at 18% 18%, rgba(217, 242, 95, .16), transparent 30%), linear-gradient(135deg, #0d3d2d, #176b4a 56%, #0e4c34);
}
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 8vw; max-width: 1280px; margin: auto; padding: 7vw; }
.login-intro { color: white; max-width: 620px; }
.brand-mark { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: var(--lime); color: var(--green-dark); font-size: 30px; font-weight: 900; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 22px; box-shadow: none; flex: 0 0 auto; }
.eyebrow { margin: 26px 0 8px; color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.login-intro h1 { margin: 0; font-size: clamp(40px, 5vw, 72px); line-height: 1.18; letter-spacing: -.04em; }
.login-intro h1 span { color: var(--lime); }
.intro-copy { max-width: 560px; margin: 28px 0; color: #d6e4dc; font-size: 17px; line-height: 2; }
.signal-row { display: flex; flex-wrap: wrap; gap: 10px; }
.signal-row span { padding: 8px 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #e7f0eb; font-size: 12px; }
.login-card { width: min(100%, 450px); justify-self: end; padding: 42px; border-radius: 28px; background: var(--surface); box-shadow: 0 28px 90px rgba(3, 25, 17, .28); }
.login-card-header .eyebrow { margin-top: 0; }
.login-card h2 { margin: 0 0 8px; font-size: 32px; }
.login-card-header > p:last-child { margin: 0; color: var(--muted); }
.login-form { display: grid; margin-top: 32px; }
.login-form label { margin: 14px 0 8px; font-size: 13px; font-weight: 700; }
.login-form input { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; outline: none; direction: ltr; text-align: left; background: #fafbf8; transition: .2s; }
.login-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,74,.12); background: white; }
.login-form button { display: flex; justify-content: space-between; margin-top: 24px; padding: 15px 18px; border: 0; border-radius: 12px; background: var(--green); color: white; cursor: pointer; font-weight: 800; }
.login-form button:hover { background: var(--green-dark); }
.form-error, .field-error { color: #ae322d; font-size: 12px; line-height: 1.8; }
.form-error ul { margin: 0; padding-right: 18px; }
.field-error:empty, .form-error:empty { display: none; }
.security-note { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.security-note span { color: var(--green); }
.login-docs-link { display: block; margin-top: 18px; color: var(--green); text-align: center; font-size: 11px; font-weight: 800; }
.login-docs-link:hover { color: var(--green-dark); text-decoration: underline; }

.docs-body { background: #f3f5ef; }
.docs-shell { min-height: 100vh; }
.docs-hero { padding: 30px max(24px, calc((100% - 1140px) / 2)); color: white; background: radial-gradient(circle at 85% 0, rgba(217,242,95,.17), transparent 30%), linear-gradient(135deg, #0d3d2d, #176b4a 58%, #0e4c34); }
.docs-brand { display: flex; align-items: center; gap: 10px; color: white; }
.docs-brand strong, .docs-brand small { display: block; }
.docs-brand strong { font-size: 15px; }
.docs-brand small { margin-top: 3px; color: #b8cdc2; font-size: 9px; }
.docs-login-link { position: absolute; top: 32px; left: max(24px, calc((100% - 1140px) / 2)); padding: 10px 13px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; color: #eff7f2; font-size: 11px; font-weight: 800; }
.docs-login-link:hover { background: rgba(255,255,255,.1); }
.docs-hero-copy { max-width: 730px; margin: 82px 0 42px; }
.docs-hero .eyebrow { margin: 0 0 10px; }
.docs-hero h1 { margin: 0; font-size: clamp(36px, 5vw, 64px); line-height: 1.2; letter-spacing: -.04em; }
.docs-hero h1 span { color: var(--lime); }
.docs-hero-copy > p:last-child { max-width: 650px; margin: 22px 0 0; color: #d7e7df; line-height: 2; font-size: 15px; }
.docs-jump-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.docs-jump-nav a { padding: 8px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; color: #dfece5; font-size: 10px; }
.docs-jump-nav a:hover { border-color: var(--lime); color: var(--lime); }
.docs-content { display: grid; grid-template-columns: 190px minmax(0, 760px); gap: 58px; max-width: 1060px; margin: 0 auto; padding: 54px 24px 80px; }
.docs-toc { position: sticky; top: 24px; align-self: start; display: grid; gap: 9px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.docs-toc strong { margin-bottom: 5px; color: var(--green-dark); font-size: 11px; }
.docs-toc a { color: var(--muted); font-size: 10px; line-height: 1.8; }
.docs-toc a:hover { color: var(--green); }
.docs-article { min-width: 0; }
.docs-section { padding-bottom: 48px; margin-bottom: 45px; border-bottom: 1px solid var(--line); scroll-margin-top: 20px; }
.docs-section:last-of-type { margin-bottom: 0; }
.docs-section .eyebrow { margin: 0 0 8px; }
.docs-section h2 { margin: 0 0 18px; color: var(--green-dark); font-size: clamp(23px, 3vw, 32px); letter-spacing: -.03em; }
.docs-section h3 { margin: 0 0 10px; color: var(--green-dark); font-size: 14px; }
.docs-section p, .docs-section li { color: #52625a; font-size: 12px; line-height: 2; }
.docs-section > p { margin: 0 0 17px; }
.docs-section code { direction: ltr; unicode-bidi: embed; color: #176b4a; font-family: Consolas, monospace; font-size: .92em; }
.docs-section pre { overflow-x: auto; margin: 14px 0; padding: 17px; border-radius: 13px; background: #17221d; direction: ltr; text-align: left; }
.docs-section pre code { color: #d9f25f; font-size: 11px; line-height: 1.75; white-space: pre; }
.docs-grid { display: grid; gap: 14px; }
.docs-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.docs-grid article { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.docs-grid article p { margin: 0; }
.docs-grid article ul { margin: 0; padding-right: 17px; }
.docs-steps { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.docs-steps li { display: flex; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.docs-steps li > span { display: grid; place-items: center; flex: 0 0 auto; width: 29px; height: 29px; border-radius: 9px; background: var(--lime); color: var(--green-dark); font-size: 11px; font-weight: 900; }
.docs-steps strong { display: block; color: var(--green-dark); font-size: 12px; }
.docs-steps p { margin: 3px 0 0; }
.docs-callout { margin-top: 18px; padding: 15px 17px; border-right: 4px solid var(--green); border-radius: 11px; background: #e7f3eb; color: #286346; font-size: 11px; line-height: 2; }
.docs-callout.warning { border-color: var(--orange); background: #fff2df; color: #80551d; }
.docs-callout.danger { border-color: #b64b44; background: #f9e9e7; color: #873d37; }
.docs-number-list, .docs-checklist { padding-right: 21px; }
.docs-number-list li, .docs-checklist li { margin-bottom: 7px; }
.docs-footer { padding: 28px; border-radius: 15px; background: var(--green-dark); color: #d6e5dc; text-align: center; font-size: 12px; }
.docs-footer a { color: var(--lime); font-weight: 800; }

.dashboard-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 20px; background: var(--green-dark); color: white; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand small { margin-top: 4px; color: #a9c2b6; font-size: 10px; }
.sidebar nav { display: grid; gap: 6px; margin-top: 26px; }
.nav-caption { margin: 20px 12px 5px; color: #87a397; font-size: 10px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; font-size: 13px; }
.nav-item.active { background: rgba(217,242,95,.14); color: var(--lime); }
.nav-item.muted { color: #b2c5bc; }
.nav-item small { margin-right: auto; color: #789487; font-size: 9px; }
.logout-form { margin-top: auto; }
.logout-form button { width: 100%; padding: 11px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; background: transparent; color: #dce8e2; cursor: pointer; }
.sidebar-user { display: flex; align-items: center; gap: 10px; min-width: 0; margin-top: auto; padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user + .logout-form { margin-top: 8px; }
.sidebar-user-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; background: rgba(217,242,95,.15); color: var(--lime); font-weight: 900; }
.sidebar-user > span:last-child { min-width: 0; }
.sidebar-user small, .sidebar-user strong { display: block; }
.sidebar-user small { color: #87a397; font-size: 9px; }
.sidebar-user strong { overflow: hidden; margin-top: 4px; color: #edf4f0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-main { min-width: 0; padding: 42px clamp(24px, 5vw, 72px); }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.dashboard-header .eyebrow { margin: 0 0 8px; }
.dashboard-header h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.03em; }
.dashboard-header p:last-child { margin: 10px 0 0; color: var(--muted); }
.system-status { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--green); font-size: 12px; font-weight: 700; }
.system-status span { width: 8px; height: 8px; border-radius: 50%; background: #35b36f; box-shadow: 0 0 0 5px rgba(53,179,111,.12); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 34px 0; }
.metric-card { min-height: 150px; padding: 23px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.metric-card:first-child { background: var(--lime); border-color: var(--lime); }
.metric-card p { margin: 0 0 24px; color: var(--muted); font-size: 12px; }
.metric-card strong { display: inline-block; font-size: 36px; letter-spacing: -.04em; }
.metric-card span { margin-right: 7px; color: var(--muted); font-size: 11px; }
.data-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.section-heading { display: flex; align-items: end; justify-content: space-between; padding: 25px 28px; border-bottom: 1px solid var(--line); }
.section-heading .eyebrow { margin: 0 0 6px; }
.section-heading h2 { margin: 0; font-size: 20px; }
.section-heading > span { color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 17px 28px; border-bottom: 1px solid #edf0eb; text-align: right; font-size: 12px; }
th { color: var(--muted); background: #fafbf8; font-size: 10px; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.status { display: inline-block; padding: 6px 9px; border-radius: 999px; background: #eef1ed; color: var(--muted); font-size: 10px; }
.status-confirmed { background: #e0f4e8; color: #147243; }
.status-pending { background: #fff1d8; color: #986414; }
.status-expired, .status-cancelled { background: #f6e5e3; color: #9e3d36; }
.empty-state { display: grid; place-items: center; min-height: 240px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); }

.cards-header { position: relative; align-items: flex-start; }
.add-card-panel { position: relative; z-index: 3; }
.add-card-panel > summary { display: flex; align-items: center; gap: 16px; padding: 13px 17px; border-radius: 12px; background: var(--green); color: white; cursor: pointer; list-style: none; font-size: 12px; font-weight: 800; }
.add-card-panel > summary::-webkit-details-marker { display: none; }
.add-card-popover { position: absolute; top: calc(100% + 10px); left: 0; width: min(480px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 24px 70px rgba(20,46,34,.18); }
.empty-collection-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 580px); align-items: start; }
.empty-collection-form { width: 100%; z-index: 1; }
.empty-collection-form > summary { justify-content: space-between; }
.empty-collection-form .add-card-popover { position: static; width: 100%; margin-top: 10px; box-shadow: 0 14px 42px rgba(20,46,34,.1); }
.card-form { display: grid; }
.card-form label, .card-settings label { margin: 10px 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.card-form input, .card-form select, .card-form textarea, .card-settings input, .card-settings select, .card-settings textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #fafbf8; }
.card-form input:focus, .card-form select:focus, .card-form textarea:focus, .card-settings input:focus, .card-settings select:focus, .card-settings textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,74,.1); }
.card-form button, .card-settings button { margin-top: 16px; padding: 12px; border: 0; border-radius: 9px; background: var(--green); color: white; cursor: pointer; font-weight: 800; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.invoice-range-help { display: grid; gap: 4px; grid-column: 1 / -1; margin-top: 14px; padding: 12px 14px; border: 1px solid #d8e6dc; border-radius: 10px; background: #f1f7f2; }
.invoice-range-help strong { color: var(--green-dark); font-size: 11px; }
.invoice-range-help span { color: var(--muted); font-size: 9px; line-height: 1.9; }
.notice { margin-top: 20px; padding: 13px 16px; border-radius: 11px; font-size: 12px; }
.notice.success { background: #def2e5; color: #11643b; }
.notice.error { background: #f7e3e1; color: #963b35; }
.notice.warning { background: #fff0d2; color: #85560d; }
.cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 34px; }
.cards-empty { grid-column: 1 / -1; }
.bank-card-item { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: white; }
.bank-card-item.disabled { opacity: .7; }
.bank-card-visual { min-height: 210px; display: flex; flex-direction: column; justify-content: space-between; padding: 25px; color: white; background: radial-gradient(circle at 90% 10%, rgba(217,242,95,.28), transparent 35%), linear-gradient(145deg, #0d4933, #177351); }
.bank-card-item:nth-child(3n+2) .bank-card-visual { background: radial-gradient(circle at 15% 15%, rgba(237,139,67,.25), transparent 35%), linear-gradient(145deg, #263c35, #47665b); }
.bank-card-top, .bank-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12px; }
.card-state { padding: 5px 9px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; font-size: 9px; }
.card-number { direction: ltr; text-align: center; font-family: Consolas, monospace; font-size: clamp(18px, 2.2vw, 25px); letter-spacing: .08em; }
.bank-card-bottom { color: #dbe9e2; font-size: 10px; }
.card-stats { display: grid; grid-template-columns: 1fr 1.4fr; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-stats > span + span { padding-right: 18px; border-right: 1px solid var(--line); }
.card-stats small, .card-stats strong { display: block; }
.card-stats small { margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.card-stats strong { font-size: 15px; }
.card-stats i { color: var(--muted); font-size: 9px; font-style: normal; }
.card-settings > summary { padding: 14px 22px; color: var(--green); cursor: pointer; font-size: 11px; font-weight: 800; }
.card-settings form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 0 22px 22px; }
.card-settings button, .card-settings .toggle-row { grid-column: 1 / -1; }
.toggle-row { display: flex !important; align-items: center; gap: 9px; margin-top: 15px !important; }
.toggle-row input { width: 17px; height: 17px; accent-color: var(--green); }
.status-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 30px 0 16px; padding-bottom: 4px; }
.status-tabs a { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--muted); font-size: 10px; }
.status-tabs a span { display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px; background: #edf1ec; color: var(--ink); font-size: 9px; }
.status-tabs a.active { border-color: var(--green); background: var(--green); color: white; }
.status-tabs a.active span { background: rgba(255,255,255,.16); color: white; }
.filter-heading { align-items: center; }
.search-form { display: flex; align-items: center; gap: 7px; }
.search-form input { width: 230px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; }
.search-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,74,.1); }
.search-form button, .search-form a { padding: 10px 12px; border: 0; border-radius: 9px; cursor: pointer; font-size: 10px; }
.search-form button { background: var(--green); color: white; }
.search-form a { color: var(--muted); background: #edf1ec; }
.invoice-list td { vertical-align: middle; }
.inline-action button { padding: 7px 9px; border: 1px solid #e5b5af; border-radius: 8px; background: #fff7f6; color: #9e3d36; cursor: pointer; font-size: 9px; }
.confirmed-time { color: var(--green); font-size: 10px; }
.muted-dash { color: #aeb8b2; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.pagination a { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--green); }
.merchant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 32px; }
.merchant-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: white; }
.merchant-card.disabled, .rule-card.disabled { opacity: .68; }
.merchant-summary { display: flex; align-items: center; gap: 12px; padding: 20px; }
.merchant-summary > .status { margin-right: auto; }
.merchant-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--lime); color: var(--green-dark); font-size: 20px; font-weight: 900; }
.merchant-summary h2 { margin: 0; font-size: 16px; }
.merchant-summary p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.merchant-metrics { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 20px; border-block: 1px solid var(--line); background: #fafbf8; }
.merchant-metrics span { text-align: center; }
.merchant-metrics span + span { border-right: 1px solid var(--line); }
.merchant-metrics strong, .merchant-metrics small { display: block; }
.merchant-metrics strong { font-size: 18px; }
.merchant-metrics small { color: var(--muted); font-size: 9px; }
.merchant-settings form { grid-template-columns: 1fr 1fr; }
.password-reset { border-top: 1px solid var(--line); }
.password-reset summary { padding: 13px 22px; color: #9e3d36; cursor: pointer; font-size: 10px; }
.password-reset form { display: flex; gap: 8px; padding: 0 22px 20px; }
.password-reset input { flex: 1; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.password-reset button { padding: 10px; border: 0; border-radius: 8px; background: #963b35; color: white; cursor: pointer; font-size: 9px; }
.rule-popover { width: min(580px, calc(100vw - 32px)); }
.pattern-tester { margin-top: 30px; }
.tester-form { display: grid; grid-template-columns: 1fr 1fr 100px auto; align-items: end; gap: 12px; padding: 20px 24px; }
.tester-form label { color: var(--muted); font-size: 10px; }
.tester-form textarea, .tester-form select { width: 100%; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.tester-form button { padding: 11px 14px; border: 0; border-radius: 8px; background: var(--green); color: white; cursor: pointer; }
.test-result { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 24px 20px; padding: 12px 14px; border-radius: 9px; font-size: 10px; }
.test-result.matched { background: #def2e5; color: #11643b; }
.test-result.unmatched { background: #f7e3e1; color: #963b35; }
.rules-list { display: grid; gap: 14px; margin-top: 22px; }
.rule-card { border: 1px solid var(--line); border-radius: 16px; background: white; }
.rule-heading { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.rule-heading strong, .rule-heading div > span { display: block; }
.rule-heading div > span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.package-name { margin: 5px 20px; color: var(--green); font-size: 10px; }
.rule-card > code { display: block; overflow-x: auto; margin: 12px 20px 18px; padding: 12px; border-radius: 8px; background: #f2f5f0; color: #374a40; font-size: 10px; white-space: pre-wrap; }
.rule-settings { border-top: 1px solid var(--line); }
.rule-settings form { grid-template-columns: 1fr 1fr; }
.rule-settings .full-row { grid-column: 1 / -1; }
.one-time-secret { display: grid; gap: 8px; margin-top: 24px; padding: 18px; border: 1px solid #e0b245; border-radius: 13px; background: #fff5d9; color: #65460e; }
.one-time-secret.api-secret { border-color: #78ae93; background: #e5f4eb; color: #145d39; }
.one-time-secret code { overflow-x: auto; padding: 10px; border-radius: 8px; background: rgba(255,255,255,.72); color: var(--ink); font-size: 12px; white-space: nowrap; }
.one-time-secret p { margin: 0; font-size: 10px; }
.integration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 32px; }
.integration-card { overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: white; }
.device-integration, .webhook-integration { grid-column: 1 / -1; }
.integration-heading { display: flex; align-items: center; gap: 14px; padding: 22px; }
.integration-index { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--lime); color: var(--green-dark); font-size: 11px; font-weight: 900; }
.integration-heading h2 { margin: 0; font-size: 17px; }
.integration-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.endpoint-box { display: grid; gap: 6px; margin: 0 22px 18px; padding: 12px; border-radius: 9px; background: #f1f4ef; }
.endpoint-box small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.endpoint-box code { overflow-x: auto; color: var(--green-dark); font-size: 10px; white-space: nowrap; }
.integration-form { border-block: 1px solid var(--line); }
.integration-form summary, .setup-guide summary { padding: 13px 22px; color: var(--green); cursor: pointer; font-size: 10px; font-weight: 800; }
.integration-form form { display: flex; gap: 8px; padding: 0 22px 18px; }
.integration-form input, .integration-form select { min-width: 0; flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.integration-form button, .webhook-form button { padding: 10px 13px; border: 0; border-radius: 8px; background: var(--green); color: white; cursor: pointer; font-size: 10px; font-weight: 800; }
.credential-list { display: grid; }
.credential-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 15px 22px; border-bottom: 1px solid #edf0eb; }
.credential-row strong, .credential-row code, .credential-row small { display: block; }
.credential-row strong { font-size: 12px; }
.credential-row code { margin-top: 3px; color: var(--green); font-size: 9px; }
.credential-row small { margin-top: 5px; color: var(--muted); font-size: 8px; }
.row-actions { display: flex; gap: 5px; }
.row-actions button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--green); cursor: pointer; font-size: 8px; }
.row-actions button.danger { color: #9e3d36; }
.setup-guide { border-top: 1px solid var(--line); }
.setup-guide ol { margin: 0 22px 14px; padding-right: 20px; color: var(--muted); font-size: 10px; line-height: 2; }
.setup-guide pre { overflow-x: auto; margin: 0 22px 22px; padding: 14px; border-radius: 9px; background: #17221d; color: #d9f25f; font-size: 10px; direction: ltr; text-align: left; }
.configured-webhook { display: flex; align-items: center; gap: 10px; margin: 0 22px 18px; padding: 11px; border-radius: 9px; background: #e5f4eb; color: #145d39; }
.configured-webhook span { font-size: 9px; font-weight: 800; }
.configured-webhook code { overflow-x: auto; font-size: 9px; }
.webhook-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; padding: 0 22px 18px; }
.webhook-form label { color: var(--muted); font-size: 9px; }
.webhook-form input { width: 100%; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.disable-webhook { padding: 0 22px 14px; }
.disable-webhook button { padding: 8px 10px; border: 1px solid #e5b5af; border-radius: 8px; background: #fff7f6; color: #9e3d36; cursor: pointer; font-size: 9px; }
.integration-note { margin: 0; padding: 16px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.9; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.settings-card { align-self: start; }
.settings-heading { display: flex; align-items: center; gap: 14px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.settings-heading h2 { margin: 0; font-size: 17px; }
.settings-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; direction: ltr; text-align: right; }
.settings-icon { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; background: var(--lime); color: var(--green-dark); font-weight: 900; }
.security-settings-card .settings-icon { background: #e5f4eb; color: var(--green); }
.settings-form { display: grid; padding: 22px 24px 24px; }
.settings-form label { margin: 10px 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.settings-form input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #fafbf8; }
.settings-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,74,.1); background: white; }
.settings-form small { margin-top: 10px; color: var(--muted); font-size: 9px; line-height: 1.8; }
.settings-form button { margin-top: 18px; padding: 12px; border: 0; border-radius: 9px; background: var(--green); color: white; cursor: pointer; font-weight: 800; }
.review-layout { display: grid; grid-template-columns: minmax(380px, .9fr) minmax(420px, 1.1fr); gap: 18px; margin-top: 30px; }
.event-list-card, .event-inspector { min-width: 0; }
.compact-filter { display: flex; gap: 6px; }
.compact-filter select { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 9px; }
.compact-filter button { padding: 8px 10px; border: 0; border-radius: 8px; background: var(--green); color: white; cursor: pointer; font-size: 9px; }
.event-list { max-height: 620px; overflow-y: auto; }
.event-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid #edf0eb; }
.event-row:hover, .event-row.selected { background: #f4f7f2; }
.event-row.selected { box-shadow: inset -3px 0 var(--green); }
.event-signal { width: 7px; height: 7px; border-radius: 50%; background: #aeb8b2; }
.event-signal.status-received, .event-signal.status-ambiguous { background: var(--orange); }
.event-signal.status-matched { background: #35b36f; }
.event-signal.status-rejected { background: #b64b44; }
.event-row strong, .event-row small { display: block; }
.event-row strong { font-size: 12px; }
.event-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.event-row > span:last-child { text-align: left; }
.small-empty { min-height: 150px; }
.parsed-fields { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.parsed-fields div + div { padding-right: 16px; border-right: 1px solid var(--line); }
.parsed-fields dt { color: var(--muted); font-size: 8px; }
.parsed-fields dd { margin: 6px 0 0; font-size: 12px; font-weight: 800; }
.raw-message { margin: 18px 22px; padding: 16px; border-radius: 10px; background: #f2f5f0; line-height: 1.9; }
.raw-message strong { font-size: 11px; }
.raw-message p { margin: 7px 0 0; white-space: pre-wrap; font-size: 11px; }
.review-reason { margin: 12px 22px; padding: 10px; border-radius: 8px; background: #fff0d2; color: #85560d; font-size: 9px; }
.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 22px 22px; }
.review-actions form { display: grid; }
.review-actions label { color: var(--muted); font-size: 9px; }
.review-actions input { width: 100%; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.review-actions button { margin-top: 8px; padding: 10px; border: 0; border-radius: 8px; background: var(--green); color: white; cursor: pointer; font-size: 9px; }
.review-actions .reject-form button { background: #963b35; }
.delivery-card { margin-top: 20px; }
.delivery-card code { font-size: 9px; }
.audit-card { margin-top: 30px; }
.audit-filter select { padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 10px; }
.audit-list { display: grid; }
.audit-row { display: grid; grid-template-columns: 8px minmax(180px, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 15px 22px; border-bottom: 1px solid #edf0eb; font-size: 10px; }
.audit-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(23,107,74,.08); }
.audit-main strong, .audit-main small { display: block; }
.audit-main strong { font-size: 11px; }
.audit-main small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.audit-merchant { padding: 5px 8px; border-radius: 999px; background: #eef1ed; color: var(--muted); font-size: 8px; }
.audit-actor, .audit-row time { color: var(--muted); font-size: 8px; }
.audit-row details { grid-column: 2 / -1; }
.audit-row summary { color: var(--green); cursor: pointer; font-size: 8px; }
.audit-row details code { display: block; overflow-x: auto; margin-top: 7px; padding: 9px; border-radius: 7px; background: #f2f5f0; font-size: 8px; }

@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; gap: 46px; padding: 50px 24px; }
    .login-intro { text-align: center; margin: auto; }
    .brand-mark { margin: auto; }
    .signal-row { justify-content: center; }
    .login-card { justify-self: center; }
    .dashboard-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; padding: 18px; }
    .sidebar nav { grid-template-columns: repeat(4, 1fr); margin-top: 14px; }
    .nav-caption, .nav-item small { display: none; }
    .nav-item { justify-content: center; padding: 9px; font-size: 11px; }
    .logout-form { margin-top: 12px; }
    .sidebar-user { margin-top: 14px; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .cards-grid { grid-template-columns: 1fr; }
    .merchant-grid { grid-template-columns: 1fr; }
    .tester-form { grid-template-columns: 1fr 1fr; }
    .integration-grid { grid-template-columns: 1fr; }
    .device-integration, .webhook-integration { grid-column: auto; }
    .webhook-form { grid-template-columns: 1fr; }
    .review-layout { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .docs-content { grid-template-columns: 1fr; gap: 24px; }
    .docs-toc { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .docs-toc strong { grid-column: 1 / -1; }
}

@media (max-width: 1180px) {
    .empty-collection-header { grid-template-columns: minmax(0, 1fr); }
    .empty-collection-form { max-width: 580px; margin-top: 20px; }
}

@media (max-width: 560px) {
    .login-intro h1 { font-size: 38px; }
    .login-card { padding: 28px 22px; border-radius: 20px; }
    .dashboard-main { padding: 28px 16px; }
    .dashboard-header { align-items: flex-start; }
    .system-status { padding: 8px; font-size: 0; }
    .metrics-grid { gap: 10px; }
    .metric-card { min-height: 130px; padding: 17px; }
    .metric-card strong { font-size: 29px; }
    .sidebar nav { grid-template-columns: repeat(3, 1fr); }
    .section-heading { padding: 20px; }
    th, td { padding: 14px 20px; }
    .cards-header { display: block; }
    .add-card-panel { margin-top: 20px; }
    .add-card-popover { position: static; margin-top: 10px; width: 100%; }
    .form-grid, .card-settings form { grid-template-columns: 1fr; }
    .card-settings button, .card-settings .toggle-row { grid-column: auto; }
    .filter-heading { display: block; }
    .search-form { margin-top: 16px; }
    .search-form input { min-width: 0; width: 100%; }
    .tester-form, .rule-settings form, .merchant-settings form { grid-template-columns: 1fr; }
    .rule-settings .full-row { grid-column: auto; }
    .password-reset form { display: grid; }
    .integration-form form { display: grid; }
    .credential-row { grid-template-columns: minmax(0, 1fr) auto; }
    .credential-row .row-actions { grid-column: 1 / -1; }
    .review-actions, .parsed-fields { grid-template-columns: 1fr; }
    .parsed-fields div + div { margin-top: 10px; padding: 10px 0 0; border-top: 1px solid var(--line); border-right: 0; }
    .compact-filter { margin-top: 12px; }
    .audit-filter { display: grid; width: 100%; }
    .audit-row { grid-template-columns: 8px 1fr auto; }
    .audit-actor { display: none; }
    .audit-row time { grid-column: 2 / -1; }
    .audit-row details { grid-column: 2 / -1; }
    .docs-hero { padding-top: 24px; }
    .docs-login-link { position: static; float: left; margin-top: -42px; }
    .docs-hero-copy { clear: both; margin-top: 70px; }
    .docs-grid.two { grid-template-columns: 1fr; }
    .docs-toc { grid-template-columns: 1fr 1fr; }
}
