:root {
  --bg: #050d1a;
  --surface: #091426;
  --surface-2: #0d1b30;
  --surface-3: #132640;
  --line: #1b304c;
  --line-strong: #2b496b;
  --text: #edf4fc;
  --muted: #8da0b8;
  --muted-2: #61758f;
  --green: #39d98a;
  --green-soft: rgba(57, 217, 138, .11);
  --orange: #f5a524;
  --orange-soft: rgba(245, 165, 36, .12);
  --red: #ff5d68;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 13px/1.5 var(--font); }
button, input { color: inherit; font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.kicker { margin: 0 0 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: radial-gradient(circle at 15% 20%, rgba(57,217,138,.09), transparent 28rem), linear-gradient(rgba(57,217,138,.018) 1px, transparent 1px), linear-gradient(90deg,rgba(57,217,138,.018) 1px, transparent 1px), var(--bg); background-size: auto, 32px 32px, 32px 32px; }
.login-shell { width: min(1040px,100%); min-height: min(680px,calc(100vh - 64px)); display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: 0 32px 100px rgba(0,0,0,.46); }
.login-context { display: flex; flex-direction: column; padding: 34px 38px 28px; border-right: 1px solid var(--line); background: linear-gradient(145deg,rgba(57,217,138,.055),transparent 42%),#071121; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 5px; color: #06120c; background: var(--green); font-size: 18px; }
.brand > span:last-child { display: grid; line-height: 1.15; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: .15em; text-transform: uppercase; }
.login-story { max-width: 500px; margin: auto 0; }
.login-story h1 { margin: 8px 0 16px; font-size: clamp(30px,3.3vw,45px); letter-spacing: -.035em; }
.login-story h1 span { color: var(--green); }
.login-story > p:not(.kicker) { max-width: 450px; margin-bottom: 28px; color: #9cafc6; line-height: 1.65; }
.route { display: grid; grid-template-columns: 1fr 28px 1fr 28px 1fr; align-items: center; margin-bottom: 28px; }
.route-node { min-height: 64px; display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: rgba(9,20,38,.78); }
.route-node > i { color: #9eb3ce; font-size: 18px; }
.route-node span { display: grid; min-width: 0; }
.route-node small { color: var(--muted-2); font-size: 8px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.route-node strong { font-size: 11px; }
.route-node.middleware { border-color: rgba(57,217,138,.35); background: var(--green-soft); }
.route-node.middleware i, .route-node.middleware strong { color: var(--green); }
.route-arrow { color: var(--muted-2); justify-self: center; }
.benefits { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.benefits li { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 9px; }
.benefits li > i { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; color: var(--green); background: var(--green-soft); }
.benefits li span { display: grid; }
.benefits small { color: var(--muted); font-size: 10px; }
.privacy { display: flex; gap: 7px; align-items: center; margin: 24px 0 0; color: var(--muted-2); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.privacy i { color: var(--green); font-size: 14px; }
.login-main { display: grid; place-items: center; padding: 46px; }
.login-panel { width: min(350px,100%); display: grid; gap: 20px; }
.login-panel h2 { margin: 7px 0 9px; font-size: 26px; }
.login-panel div > p:last-child { color: var(--muted); }
.login-panel label { display: grid; gap: 7px; color: #b8c7da; font-size: 10px; font-weight: 700; }
.input-wrap { height: 46px; display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface-2); }
.input-wrap.password-wrap { grid-template-columns: 18px minmax(0,1fr) 32px; }
.input-wrap:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(57,217,138,.08); }
.input-wrap i { color: var(--muted-2); }
.input-wrap input { height: 100%; min-width: 0; border: 0; outline: 0; background: transparent; }
.password-wrap button { width: 32px; height: 32px; display: grid; place-items: center; margin-right: -7px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; }
.password-wrap button:hover { color: var(--text); background: var(--surface-3); }
.form-message { min-height: 18px; margin: -6px 0; color: var(--red); font-size: 11px; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface-2); font-weight: 750; }
.button.primary { border-color: var(--green); color: #06120c; background: var(--green); }
.help { display: flex; gap: 6px; color: var(--muted-2); font-size: 10px; }

.console { min-height: 100vh; display: grid; grid-template-columns: 58px minmax(0,1fr); }
.rail { height: 100vh; display: flex; flex-direction: column; align-items: center; position: sticky; top: 0; border-right: 1px solid var(--line); background: #071121; }
.rail-logo, .rail-button { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 4px; color: var(--muted); background: transparent; text-decoration: none; font-size: 18px; }
.rail-logo { width: 58px; height: 58px; color: var(--green); border-bottom: 1px solid var(--line); border-radius: 0; font-size: 21px; }
.rail nav { display: grid; gap: 8px; margin-top: 18px; }
.rail-button:hover, .rail-button.active { color: var(--green); background: var(--green-soft); }
.rail-button.active::before { width: 2px; height: 20px; content: ""; position: absolute; left: 0; background: var(--green); }
.rail-button { position: relative; }
.rail .logout { margin-top: auto; margin-bottom: 12px; }
.workspace { min-width: 0; }
.topbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(5,13,26,.9); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(12px); }
.title-group, .topbar-actions { display: flex; align-items: center; gap: 10px; }
.title-group h1 { margin: 0; font-size: 17px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.view { padding: 24px; }
.summary-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 16px; }
.summary-grid article { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.summary-grid span, .summary-grid small { display: block; color: var(--muted); }
.summary-grid strong { display: block; margin: 6px 0 2px; font-size: 24px; }
.summary-grid .status-card strong { color: var(--green); font-size: 15px; }
.panel { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.panel-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 14px; }
.auto-refresh { color: var(--muted); font-size: 10px; }
.auto-refresh span { width: 6px; height: 6px; display: inline-block; margin-right: 6px; border-radius: 50%; background: var(--green); }
.event-columns, .event-row { display: grid; grid-template-columns: 190px minmax(180px,1.3fr) minmax(160px,1fr) 110px; gap: 16px; align-items: center; }
.event-columns { padding: 9px 16px; border-bottom: 1px solid var(--line); color: var(--muted-2); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.event-row { width: 100%; min-height: 62px; padding: 10px 16px; position: relative; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; }
.event-row:hover { background: var(--surface-2); }
.event-row > span:nth-child(2) { min-width: 0; display: grid; }
.event-row small { color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-date, .event-source { color: var(--muted); }
.signature { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; }
.signature.valid, .success { color: var(--green); }
.signature.invalid, .warning { color: var(--orange); }
.empty-state { display: grid; place-items: center; padding: 70px 20px; color: var(--muted); text-align: center; }
.empty-state > i { color: var(--green); font-size: 28px; }
.empty-state h3 { margin: 12px 0 4px; color: var(--text); }
.view-intro { max-width: 720px; margin: 10px 0 24px; }
.view-intro h2 { margin: 5px 0 9px; font-size: 26px; }
.view-intro > p:last-child { color: var(--muted); }
.management-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.merchant-layout { display: grid; grid-template-columns: minmax(250px,320px) minmax(0,1fr); gap: 16px; align-items: start; }
.merchant-list-panel { overflow: hidden; }
.merchant-list-panel > header, .merchant-editor > header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.merchant-list-panel h3, .merchant-editor h3 { margin: 0; }
.count-badge { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 800; }
.merchant-list { display: grid; }
.merchant-list-item { width: 100%; min-height: 64px; display: grid; grid-template-columns: 36px minmax(0,1fr) 8px; align-items: center; gap: 10px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; }
.merchant-list-item:hover, .merchant-list-item.active { background: var(--surface-2); }
.merchant-list-item.active { box-shadow: 2px 0 0 var(--green) inset; }
.merchant-list-item > span:nth-child(2) { min-width: 0; display: grid; }
.merchant-list-item strong, .merchant-list-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merchant-list-item small { color: var(--muted); font-size: 9px; }
.merchant-avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--green); background: var(--green-soft); }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.connection-dot.active { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.merchant-empty { display: grid; place-items: center; padding: 42px 16px; color: var(--muted); text-align: center; }
.merchant-empty > i { font-size: 24px; }
.merchant-empty p { margin: 8px 0 0; }
.merchant-editor form { display: grid; }
.merchant-editor fieldset { margin: 0; padding: 20px; border: 0; border-bottom: 1px solid var(--line); }
.merchant-editor legend { display: flex; align-items: center; gap: 8px; padding: 0; color: #c8d5e5; font-size: 11px; font-weight: 800; }
.merchant-editor legend span { min-width: 30px; color: var(--green); font-family: var(--mono); font-size: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 14px; margin-top: 16px; }
.form-grid label { display: grid; align-self: start; align-content: start; gap: 6px; color: #b8c7da; font-size: 10px; font-weight: 700; }
.form-grid label.wide, .form-grid > .wide { grid-column: 1 / -1; }
.paymode-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.form-grid input, .form-grid select { width: 100%; min-width: 0; height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--text); background: var(--surface-2); }
.form-grid input:focus, .form-grid select:focus { border-color: var(--green); outline: 0; box-shadow: 0 0 0 3px rgba(57,217,138,.08); }
.form-grid small { color: var(--muted-2); font-weight: 400; }
.form-grid em { color: var(--muted-2); font-size: 9px; font-style: normal; font-weight: 500; }
.field-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: var(--surface-2); font-size: 10px; line-height: 1.5; }
.field-note i { flex: 0 0 auto; margin-top: 2px; color: var(--green); }
.toggle-field { min-height: 52px; grid-template-columns: 1fr auto !important; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; }
.toggle-field > span { display: grid; }
.switch { width: 42px; height: 24px; display: inline-block; position: relative; }
.switch input { width: 1px; height: 1px; position: absolute; opacity: 0; }
.switch > span { position: absolute; inset: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-3); transition: .18s ease; }
.switch > span::after { width: 16px; height: 16px; content: ""; position: absolute; left: 3px; top: 3px; border-radius: 50%; background: var(--muted); box-shadow: 0 1px 3px rgba(0,0,0,.45); transition: .18s ease; }
.switch input:checked + span { border-color: var(--green); background: var(--green-soft); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--green); }
.switch input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 3px; }
.copy-field { display: grid; grid-template-columns: 1fr 42px; }
.copy-field input { border-radius: 4px 0 0 4px; font-family: var(--mono); font-size: 10px; }
.copy-field button { border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 4px 4px 0; color: var(--green); background: var(--surface-3); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; }
.button.danger { margin-right: auto; border-color: rgba(255,93,104,.45); color: var(--red); background: rgba(255,93,104,.08); }
.account-card { display: grid; grid-template-columns: minmax(230px,.65fr) minmax(0,1.35fr); gap: 24px; margin-bottom: 16px; padding: 20px; }
.account-identity { display: flex; align-items: center; gap: 14px; padding: 12px; border-right: 1px solid var(--line); }
.account-identity > span { width: 48px; height: 48px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 25px; }
.account-identity h3, .account-identity p { margin-bottom: 2px; }
.password-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; align-items: start; }
.password-form label { display: grid; gap: 6px; color: #b8c7da; font-size: 10px; font-weight: 700; }
.password-form input { width: 100%; min-width: 0; height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--text); background: var(--surface-2); }
.password-form small { color: var(--muted-2); font-weight: 400; }
.password-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.password-actions .form-message { margin-right: auto; }
.user-layout { display: grid; grid-template-columns: minmax(270px,340px) minmax(0,1fr); gap: 16px; align-items: start; }
.user-list-panel, .user-editor { overflow: hidden; }
.user-list-panel > header, .user-editor > header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.user-list-panel h3, .user-editor h3 { margin: 0; }
.user-list { display: grid; }
.user-list-item { width: 100%; min-height: 64px; display: grid; grid-template-columns: 36px minmax(0,1fr) 8px; align-items: center; gap: 10px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; }
.user-list-item:hover, .user-list-item.active { background: var(--surface-2); }
.user-list-item.active { box-shadow: 2px 0 0 var(--green) inset; }
.user-list-item > span:nth-child(2) { min-width: 0; display: grid; }
.user-list-item strong, .user-list-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-list-item small { color: var(--muted); font-size: 9px; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #06120c; background: var(--green); font-weight: 850; }
.user-editor form { display: grid; }
.user-editor .form-grid { padding: 20px; }
.integration-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.integration-card { padding: 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.integration-card.active-integration { border-color: rgba(57,217,138,.35); }
.integration-card header { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 12px; }
.integration-card header small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.integration-card h3 { margin: 3px 0 0; font-size: 17px; }
.integration-card > p { min-height: 62px; margin: 20px 0; color: var(--muted); }
.integration-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 6px; font-size: 22px; }
.integration-icon.woo { color: #c4a7e7; background: rgba(150,88,190,.18); }
.integration-icon.domino { color: var(--green); background: var(--green-soft); }
.badge { padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.badge.active { color: var(--green); background: var(--green-soft); }
.badge.planned { color: var(--orange); background: var(--orange-soft); }
.flow { display: flex; align-items: center; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); color: #b8c7da; font-size: 11px; }
.flow i { color: var(--green); }
dl { margin: 16px 0 0; }
dl div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
dt { color: var(--muted); }
dd { margin: 0; }
code { color: #a9f2cd; font-family: var(--mono); font-size: 11px; }
.roadmap { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 18px; }
.roadmap-icon { width: 40px; height: 40px; display: grid; flex: 0 0 auto; place-items: center; border: 1px dashed var(--line-strong); border-radius: 50%; color: var(--muted); }
.roadmap h3, .roadmap p { margin-bottom: 2px; }
.roadmap > div > p:last-child { color: var(--muted); }
.architecture { display: grid; grid-template-columns: 1fr 30px 1fr 30px 1fr; align-items: center; padding: 26px; }
.architecture > div { min-height: 180px; position: relative; padding: 22px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.architecture > div > i { margin-bottom: 28px; color: var(--green); font-size: 25px; }
.architecture > i { justify-self: center; color: var(--muted-2); }
.architecture .number { position: absolute; right: 14px; top: 11px; color: var(--muted-2); font-family: var(--mono); font-size: 10px; }
.architecture h3 { margin-bottom: 8px; }
.architecture p { margin: 0; color: var(--muted); }
.release { margin-top: 16px; padding: 20px; border-left: 3px solid var(--green); }
.release h3 { margin: 5px 0 8px; }
.release p:last-child { margin-bottom: 0; color: var(--muted); }
dialog { width: min(820px,calc(100% - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); background: var(--surface); box-shadow: 0 32px 100px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(2,7,14,.76); backdrop-filter: blur(4px); }
dialog header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
dialog h2 { margin: 0; }
.dialog-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; padding: 16px 18px; }
.dialog-meta span { display: grid; gap: 3px; }
.dialog-meta small { color: var(--muted); }
dialog pre { max-height: 55vh; margin: 0 18px 18px; padding: 16px; overflow: auto; border-radius: 5px; color: #cbd9eb; background: #040a13; font: 11px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; }
.spin { animation: spin .65s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-context { min-height: 480px; border-right: 0; border-bottom: 1px solid var(--line); }
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .integration-grid { grid-template-columns: 1fr; }
  .merchant-layout { grid-template-columns: 1fr; }
  .user-layout, .account-card { grid-template-columns: 1fr; }
  .account-identity { border-right: 0; border-bottom: 1px solid var(--line); }
  .password-form { grid-template-columns: 1fr; }
  .event-columns { display: none; }
  .event-row { grid-template-columns: 1fr auto; }
  .event-source { display: none; }
  .architecture { grid-template-columns: 1fr; gap: 10px; }
  .architecture > i { transform: rotate(90deg); }
}

@media (max-width: 560px) {
  .login-view { padding: 0; }
  .login-shell { min-height: 100vh; border: 0; border-radius: 0; }
  .login-context { padding: 26px 22px; }
  .login-main { padding: 36px 22px; }
  .route { grid-template-columns: 1fr; gap: 7px; }
  .route-arrow { transform: rotate(90deg); }
  .console { grid-template-columns: 1fr; padding-bottom: 58px; }
  .rail { width: 100%; height: 58px; flex-direction: row; justify-content: space-around; position: fixed; inset: auto 0 0; z-index: 10; border-top: 1px solid var(--line); border-right: 0; }
  .rail-logo { display: none; }
  .rail nav { display: flex; margin: 0; }
  .rail .logout { margin: 0; }
  .topbar { padding: 0 14px; }
  .view { padding: 14px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .management-head { display: block; }
  .management-head .button { margin-bottom: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.wide { grid-column: auto; }
  .paymode-grid { grid-template-columns: 1fr; }
  .event-row { grid-template-columns: 1fr; gap: 5px; }
  .signature { position: absolute; right: 28px; }
  .dialog-meta { grid-template-columns: 1fr; }
}
