:root {
  --navy: #15253d;
  --navy-2: #0d1a2c;
  --coral: #d96c5d;
  --coral-dark: #bd574b;
  --ink: #162237;
  --muted: #6f7c8e;
  --line: #e5e9ef;
  --soft: #f6f8fb;
  --white: #fff;
  --green: #1ca677;
  --amber: #dc8e16;
  --red: #d94b58;
  --shadow: 0 24px 70px rgba(21, 37, 61, .14);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--soft); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--coral-dark); text-decoration: none; }
.hidden { display: none !important; }
.brand { display: inline-flex; gap: 11px; align-items: center; font-size: 21px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.brand-light { color: #fff; }
.brand-dark { color: var(--navy); }
.brand-mark { width: 40px; height: 40px; flex: 0 0 40px; display: block; object-fit: contain; }
.eyebrow { display: block; color: #94a3b8; font-size: 11px; line-height: 1; font-weight: 800; letter-spacing: 1.7px; }
.eyebrow.coral { color: var(--coral); }
.subtle { color: var(--muted); line-height: 1.65; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 44%) 1fr; background: white; }
.auth-brand { position: relative; overflow: hidden; padding: 48px clamp(40px, 6vw, 92px); display: flex; flex-direction: column; color: white; background: var(--navy); }
.auth-brand::after { content: ""; position: absolute; width: 440px; height: 440px; right: -220px; bottom: -180px; border: 80px solid rgba(217,108,93,.16); border-radius: 50%; }
.auth-brand::before { content: ""; position: absolute; width: 220px; height: 220px; left: -150px; top: 25%; border: 45px solid rgba(255,255,255,.05); transform: rotate(35deg); }
.auth-pitch { position: relative; z-index: 1; margin: auto 0; max-width: 530px; }
.auth-pitch h1 { margin: 20px 0; max-width: 500px; font-size: clamp(40px, 5vw, 66px); line-height: 1.02; letter-spacing: -2.6px; }
.auth-pitch p { max-width: 480px; color: #cbd5e1; font-size: 16px; line-height: 1.75; }
.trust-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.trust-list span { padding: 10px 13px; border: 1px solid rgba(255,255,255,.13); border-radius: 10px; color: #dbe5f0; font-size: 12px; }
.auth-foot { position: relative; z-index: 1; margin: 0; color: #8da0b9; font-size: 11px; }
.auth-panel { display: grid; place-items: center; padding: 50px 24px; }
.auth-box { width: min(100%, 430px); }
.auth-box h2 { margin: 15px 0 8px; font-size: 34px; letter-spacing: -1.1px; }
.mobile-brand { display: none; margin-bottom: 55px; }
.form-stack { display: grid; gap: 17px; margin-top: 30px; }
.form-stack label, .toolbar label { display: grid; gap: 8px; color: #344157; font-weight: 700; font-size: 12px; }
input, select, textarea { width: 100%; padding: 13px 14px; border: 1px solid #dce2ea; border-radius: 9px; outline: 0; color: var(--ink); background: white; transition: border-color .2s, box-shadow .2s; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(217,108,93,.1); }
.field-help { color: #8c98a8; font-size: 10px; font-weight: 500; line-height: 1.5; }
.optional { color: #9aa5b4; font-weight: 500; }
.button { border: 0; border-radius: 9px; padding: 12px 17px; cursor: pointer; font-weight: 800; transition: transform .15s, background .15s, opacity .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button-primary { color: white; background: var(--coral); box-shadow: 0 8px 20px rgba(217,108,93,.2); }
.button-primary:hover { background: var(--coral-dark); }
.button-secondary { color: var(--navy); background: #edf1f5; }
.button-danger { color: var(--red); background: #fff0f1; }
.button-wide { width: 100%; min-height: 47px; }
.auth-switch { margin-top: 26px; text-align: center; color: var(--muted); }
.auth-switch a { font-weight: 800; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 27px 17px 20px; display: flex; flex-direction: column; color: white; background: var(--navy-2); z-index: 20; }
.sidebar-brand { padding: 0 12px 25px; }
.main-nav { display: grid; gap: 4px; margin-top: 12px; }
.nav-item { width: 100%; border: 0; display: flex; gap: 12px; align-items: center; padding: 11px 13px; border-radius: 8px; color: #9dadc2; background: transparent; text-align: left; cursor: pointer; font-weight: 650; }
.nav-item span { width: 17px; text-align: center; font-size: 16px; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.08); }
.nav-item.active { box-shadow: inset 3px 0 var(--coral); }
.nav-link { text-decoration: none; }
.nav-divider { height: 1px; margin: 12px 10px; background: rgba(255,255,255,.08); }
.sidebar-bottom { margin-top: auto; }
.provider-notice { margin: 0 4px 14px; padding: 13px; display: grid; gap: 5px; border: 1px solid rgba(217,108,93,.25); background: rgba(217,108,93,.08); border-radius: 9px; }
.provider-notice strong { color: var(--coral); font-size: 11px; }
.provider-notice span { color: #8fa0b7; font-size: 10px; line-height: 1.5; }
.app-main { min-width: 0; }
.topbar { height: 74px; padding: 0 34px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 18px; justify-content: space-between; background: rgba(255,255,255,.93); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.topbar > div:first-of-type { display: grid; gap: 3px; }
.workspace-label { color: #95a0ae; font-size: 9px; font-weight: 900; letter-spacing: 1.5px; }
.top-actions { display: flex; gap: 18px; align-items: center; }
.environment-pill { display: inline-flex; gap: 7px; align-items: center; padding: 7px 10px; border-radius: 30px; background: #edf9f5; color: #278264; font-size: 11px; font-weight: 800; }
.environment-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(28,166,119,.13); }
.user-chip { display: flex; gap: 9px; align-items: center; }
.user-chip > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-weight: 900; }
.user-chip div { display: grid; max-width: 190px; }
.user-chip strong { overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.user-chip small { color: var(--muted); text-transform: capitalize; }
.menu-toggle { display: none; }
.content { max-width: 1500px; margin: 0 auto; padding: 38px 36px 65px; }
.view { display: none; }
.view.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: .3; transform: translateY(3px); } }
.page-heading { margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; }
.page-heading h1 { margin: 9px 0 7px; font-size: 31px; letter-spacing: -1px; }
.page-heading p { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.metric-card { min-height: 135px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 5px 20px rgba(28,44,70,.03); }
.metric-card .metric-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; }
.metric-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; color: var(--coral); background: #fff3f0; font-size: 16px; }
.metric-card strong { display: block; margin-top: 20px; font-size: 25px; letter-spacing: -.6px; }
.metric-card small { display: block; margin-top: 6px; color: #96a1af; }
.content-grid { margin-top: 17px; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, .7fr); gap: 17px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 5px 20px rgba(28,44,70,.03); }
.panel-head { margin-bottom: 19px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel h2, .panel-head h2 { margin: 0 0 5px; font-size: 16px; }
.panel-head p, .panel > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.text-button { border: 0; padding: 0; color: var(--coral-dark); background: none; cursor: pointer; font-size: 11px; font-weight: 800; white-space: nowrap; }
.system-list { display: grid; }
.system-list > div { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.system-list span { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.system-list strong { font-size: 11px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.dot.good { background: var(--green); }
.dot.bad { background: var(--red); }
.info-note { margin-top: 18px; padding: 13px; border-left: 3px solid var(--coral); background: #fff7f5; }
.info-note strong { font-size: 11px; }
.info-note p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 11px 10px; border-bottom: 1px solid var(--line); color: #909baa; text-align: left; text-transform: uppercase; font-size: 9px; letter-spacing: 1px; }
td { padding: 14px 10px; border-bottom: 1px solid #eef1f5; color: #4e5c70; font-size: 11px; }
td strong { color: var(--ink); }
tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 20px; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; }
.status-pending { color: #9c6b12; background: #fff7df; }
.status-completed, .status-delivered, .status-active { color: #16795a; background: #eaf8f3; }
.status-failed, .status-cancelled, .status-inactive { color: #b23f4a; background: #ffedef; }
.status-expired { color: #6f7887; background: #eff1f4; }
.status-manual_review, .status-partially_refunded { color: #7d57a2; background: #f5edfb; }
.status-refunded { color: #25738d; background: #e9f6fb; }
.empty { padding: 55px 20px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty strong { color: var(--ink); font-size: 15px; }
.empty p { max-width: 420px; line-height: 1.6; }
.card-list { display: grid; gap: 14px; }
.project-card { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.project-main { display: flex; justify-content: space-between; gap: 20px; }
.project-name { display: flex; gap: 13px; align-items: center; }
.project-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; color: white; background: var(--navy); font-weight: 900; }
.project-name h2 { margin: 0 0 4px; font-size: 15px; }
.project-name p { margin: 0; color: var(--muted); font-size: 11px; }
.project-meta { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); gap: 16px; }
.project-meta span { display: block; color: #95a0af; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; }
.project-meta strong { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.project-actions { display: flex; gap: 7px; align-items: stretch; }
.mode-switch { height: 34px; padding: 3px; display: inline-flex; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.mode-switch button { height: 26px; border: 0; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; color: #788496; background: transparent; cursor: pointer; font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; }
.mode-switch button.active { color: #74550d; background: #fff3cd; box-shadow: 0 1px 3px rgba(21,37,61,.1); }
.mode-switch button.active.live { color: #fff; background: var(--green); }
.mini-button { height: 34px; padding: 0 10px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; color: #4b5a70; background: white; cursor: pointer; font-size: 10px; font-weight: 800; }
.mini-button:hover { border-color: var(--coral); color: var(--coral-dark); }
.mini-select { width: auto; min-width: 92px; height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 7px; color: #4b5a70; background-color: white; cursor: pointer; font-size: 10px; font-weight: 800; }
.mini-select:hover, .mini-select:focus { border-color: var(--coral); color: var(--coral-dark); }
.key-panel { margin-top: 16px; padding: 16px; border-radius: 9px; background: var(--soft); }
.key-row { padding: 10px 0; border-bottom: 1px solid #e1e6ed; display: flex; justify-content: space-between; gap: 15px; align-items: center; }
.key-row:last-child { border-bottom: 0; }
.key-row code { color: var(--navy); font-size: 11px; }
.toolbar { margin-bottom: 17px; display: flex; gap: 10px; align-items: flex-end; justify-content: flex-end; }
.toolbar label { width: 190px; }
.toolbar select, .toolbar .button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #4b5a70;
  background: white;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.toolbar select { padding: 0 28px 0 10px; }
.toolbar .button { padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; }
.toolbar select:hover, .toolbar select:focus, .toolbar .button:hover {
  border-color: var(--coral);
  color: var(--coral-dark);
  background: white;
  box-shadow: none;
  transform: none;
}
#transaction-filter { width: 190px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.test-layout { display: grid; grid-template-columns: minmax(320px, .85fr) minmax(0, 1.15fr); gap: 17px; }
.test-config, .test-result-panel { min-height: 510px; }
.check-list { display: grid; gap: 8px; }
.check-placeholder { padding: 18px; border: 1px dashed #d8dfe8; border-radius: 9px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.6; }
.check-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: #fbfcfd; }
.check-item span { color: #59677b; font-size: 11px; }
.check-item strong { font-size: 10px; }
.check-pass strong { color: var(--green); }
.check-fail strong { color: var(--red); }
.check-neutral strong { color: var(--muted); }
.money-input { position: relative; }
.money-input span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 800; }
.money-input input { padding-left: 42px; }
.minute-input { position: relative; }
.minute-input span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; font-weight: 700; pointer-events: none; }
.minute-input input { padding-right: 62px; }
.test-empty-icon { width: 52px; height: 52px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 14px; color: var(--coral); background: #fff3f0; font-size: 24px; }
.test-transaction { display: grid; gap: 17px; }
.test-transaction-head { padding: 18px; border-radius: 10px; color: white; background: var(--navy); }
.test-transaction-head span { color: #9fb0c6; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.test-transaction-head h3 { margin: 7px 0 0; font-size: 20px; overflow-wrap: anywhere; }
.test-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.test-amounts div { padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.test-amounts span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; font-weight: 800; letter-spacing: .7px; }
.test-amounts strong { display: block; margin-top: 5px; font-size: 15px; }
.test-status-box { padding: 14px; border-radius: 9px; display: flex; justify-content: space-between; align-items: center; background: var(--soft); }
.test-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.test-actions .button { flex: 1; min-width: 145px; text-align: center; }
.button-link { display: inline-flex; align-items: center; justify-content: center; }
.test-help { margin: 0; padding: 11px; border-left: 3px solid var(--coral); color: var(--muted); background: #fff7f5; font-size: 10px; line-height: 1.6; }
.test-guidance { margin-top: 17px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.test-guidance article { padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.test-guidance strong { font-size: 11px; }
.test-guidance p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.settings-grid .panel { min-height: 260px; }
.setting-icon { width: 42px; height: 42px; margin-bottom: 19px; display: grid; place-items: center; border-radius: 10px; color: var(--coral); background: #fff3f0; font-size: 18px; }
.settings-grid p { margin: 10px 0 22px; max-width: 480px; line-height: 1.7; }
#provider-disconnect { margin-top: 14px; }
.security-badge { display: inline-block; margin: 8px 5px 0 0; padding: 7px 9px; border: 1px solid #dfe5ec; border-radius: 20px; color: #637085; font-size: 10px; font-weight: 800; }
.secret-box { margin-top: 20px; padding: 13px; border: 1px solid #efd3ce; border-radius: 9px; background: #fff7f5; overflow-wrap: anywhere; }
.secret-box code { font-size: 11px; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,22,38,.67); backdrop-filter: blur(4px); }
.modal-card { position: relative; width: min(100%, 570px); max-height: calc(100vh - 40px); overflow: auto; padding: 30px; border-radius: 14px; background: white; box-shadow: var(--shadow); }
.modal-card h2 { margin: 12px 0 6px; font-size: 24px; }
.modal-close { position: absolute; right: 17px; top: 15px; border: 0; background: transparent; color: #7c8796; cursor: pointer; font-size: 25px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.warning-copy { padding: 11px; border-left: 3px solid var(--amber); color: #766029; background: #fff9e9; font-size: 11px; line-height: 1.6; }
.credential { margin: 13px 0; }
.credential span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.credential code { display: block; padding: 12px; border-radius: 7px; overflow-wrap: anywhere; color: #d7e1ed; background: var(--navy-2); font-size: 11px; line-height: 1.6; }
.toast { position: fixed; right: 22px; top: 20px; z-index: 100; max-width: 390px; padding: 13px 16px; border-radius: 9px; color: white; background: var(--navy); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(-12px); transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--red); }
@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .project-meta { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .auth-layout { display: block; }
  .auth-brand { display: none; }
  .auth-panel { min-height: 100vh; padding: 32px 20px; }
  .mobile-brand { display: inline-flex; }
  .app-shell { display: block; }
  .sidebar { position: fixed; width: 245px; left: -260px; transition: left .2s; box-shadow: var(--shadow); }
  .sidebar.open { left: 0; }
  .menu-toggle { display: grid; }
  .icon-button { width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: white; }
  .topbar { height: 67px; padding: 0 17px; justify-content: flex-start; }
  .top-actions { margin-left: auto; }
  .environment-pill, .user-chip div { display: none; }
  .content { padding: 28px 16px 50px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid, .settings-grid, .test-layout, .test-guidance { grid-template-columns: 1fr; }
  .project-main { flex-direction: column; }
  .project-actions { flex-wrap: wrap; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar label { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .metric-grid, .project-meta { grid-template-columns: 1fr; }
  .auth-box h2 { font-size: 29px; }
  .modal-card { padding: 25px 19px; }
}
