:root{
  --bg:#f4f6f9;
  --surface:#ffffff;
  --surface-soft:#fafbfc;
  --text:#151922;
  --text-strong:#0f172a;
  --muted:#667085;
  --muted-2:#98a2b3;
  --border:#e4e7ec;
  --border-strong:#d0d5dd;
  --gold:#b8860b;
  --gold-dark:#8b6508;
  --gold-soft:#fff8e7;
  --green:#157347;
  --green-bg:#eaf7ef;
  --red:#b42318;
  --red-bg:#fff3f2;
  --amber:#8a6400;
  --amber-bg:#fff7df;
  --shadow-sm:0 1px 2px rgba(16,24,40,.04);
  --shadow-md:0 10px 30px rgba(15,23,42,.06);
  --radius-sm:10px;
  --radius-md:14px;
  --radius-lg:18px;
}

*{box-sizing:border-box}

html{background:var(--bg)}

body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(circle at top left,rgba(184,134,11,.055),transparent 34rem),
    var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

button,input{font:inherit}

button,a,input{
  -webkit-tap-highlight-color:transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible{
  outline:3px solid rgba(184,134,11,.22);
  outline-offset:2px;
}

.shell{
  max-width:1160px;
  margin:0 auto;
  padding:34px 22px 72px;
}

.hidden{display:none!important}

.brand{
  display:inline-flex;
  align-items:center;
  font-size:31px;
  font-weight:850;
  line-height:1;
  letter-spacing:-1.15px;
  color:var(--text-strong);
}

.brand span{color:var(--gold)}
.brand.small{font-size:23px;letter-spacing:-.7px}

.eyebrow{
  margin:6px 0 0;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.11em;
}

h1{
  margin:20px 0 8px;
  color:var(--text-strong);
  font-size:30px;
  line-height:1.18;
  letter-spacing:-.65px;
}

h2{
  margin:0 0 18px;
  color:var(--text-strong);
  font-size:18px;
  line-height:1.3;
  letter-spacing:-.2px;
}

.muted{
  color:var(--muted);
  line-height:1.62;
}

.small-copy{font-size:14px}

.login-card,
.boot-card{
  max-width:470px;
  margin:72px auto;
  padding:36px;
  background:rgba(255,255,255,.96);
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:0 20px 60px rgba(15,23,42,.08);
}

.login-card::before,
.boot-card::before{
  content:"";
  display:block;
  width:44px;
  height:4px;
  margin:0 0 24px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--gold),#d5b04a);
}

label{
  display:block;
  margin:24px 0 8px;
  color:#344054;
  font-size:13px;
  font-weight:700;
}

input{
  width:100%;
  padding:13px 14px;
  color:var(--text);
  background:#fff;
  border:1px solid var(--border-strong);
  border-radius:12px;
  font-size:16px;
  outline:none;
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease;
}

input::placeholder{color:var(--muted-2)}

input:hover{border-color:#b8bec8}

input:focus{
  border-color:var(--gold);
  box-shadow:0 0 0 4px rgba(184,134,11,.11);
}

button,
.button-link{
  display:inline-flex;
  min-height:42px;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 17px;
  color:#fff;
  background:var(--gold);
  border:1px solid var(--gold);
  border-radius:11px;
  box-shadow:var(--shadow-sm);
  font-size:14px;
  font-weight:750;
  text-decoration:none;
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,transform .12s ease,box-shadow .16s ease;
}

button:hover,
.button-link:hover{
  background:var(--gold-dark);
  border-color:var(--gold-dark);
  box-shadow:0 4px 12px rgba(139,101,8,.18);
}

button:active,
.button-link:active{transform:translateY(1px)}

button:disabled{
  opacity:.52;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}

.secondary{
  color:#344054;
  background:#fff;
  border-color:var(--border-strong);
}

.secondary:hover{
  color:var(--text-strong);
  background:#f8fafc;
  border-color:#b8bec8;
  box-shadow:var(--shadow-sm);
}

.login-card button:not(.secondary){
  width:100%;
  margin-top:15px;
}

.login-card .secondary{
  width:100%;
  margin-top:9px;
}

.message{
  min-height:22px;
  margin:14px 0 0;
  font-size:14px;
  font-weight:600;
}

.message.error{color:var(--red)}
.message.success{color:var(--green)}

.notice{
  margin:18px 0 4px;
  padding:12px 14px;
  color:#5f4a0a;
  background:var(--gold-soft);
  border:1px solid #ead8a2;
  border-radius:11px;
  font-size:13px;
  line-height:1.55;
}

.security-note{
  position:relative;
  margin:24px 0 0;
  padding:20px 0 0 24px;
  color:var(--muted);
  border-top:1px solid var(--border);
  font-size:12px;
  line-height:1.6;
}

.security-note::before{
  content:"✓";
  position:absolute;
  left:0;
  top:18px;
  width:16px;
  height:16px;
  display:grid;
  place-items:center;
  color:var(--green);
  background:var(--green-bg);
  border-radius:50%;
  font-size:10px;
  font-weight:800;
}

.boot-content{
  display:flex;
  min-height:250px;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.boot-content h1{
  margin:20px 0 6px;
  font-size:25px;
}

.boot-content .muted{margin:0}

.portal-spinner{
  width:38px;
  height:38px;
  border:4px solid #e6e8ec;
  border-top-color:var(--gold);
  border-radius:50%;
  animation:portal-spin .8s linear infinite;
}

@keyframes portal-spin{to{transform:rotate(360deg)}}

.topbar{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:17px 20px;
  background:rgba(255,255,255,.94);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow-sm);
}

.topbar::after{
  content:"";
  position:absolute;
  left:20px;
  right:20px;
  bottom:-1px;
  height:2px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--gold),transparent 38%);
  opacity:.32;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.status-pill{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:7px 11px;
  color:var(--green);
  background:var(--green-bg);
  border:1px solid #ccebd8;
  border-radius:999px;
  font-size:12px;
  font-weight:750;
}

.status-pill::before{
  content:"";
  width:7px;
  height:7px;
  background:#22a06b;
  border-radius:50%;
  box-shadow:0 0 0 3px rgba(34,160,107,.11);
}

.status-pill.live{
  color:var(--green);
  background:var(--green-bg);
  border-color:#ccebd8;
}

.status-pill.live::before{
  background:#22a06b;
  box-shadow:0 0 0 3px rgba(34,160,107,.11);
}

.status-pill.sandbox{
  color:var(--amber);
  background:var(--amber-bg);
  border-color:#ecdca2;
}

.status-pill.sandbox::before{
  background:#d39a00;
  box-shadow:0 0 0 3px rgba(211,154,0,.13);
}

.small-btn{
  min-height:36px;
  padding:8px 12px;
}

.welcome-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:20px;
  margin:30px 2px 20px;
}

.welcome-row h1{
  margin:0 0 5px;
  font-size:31px;
}

.welcome-row p{margin:0}

.metrics{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
}

.metric,
.panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:17px;
  box-shadow:var(--shadow-sm);
}

.metric{
  position:relative;
  min-height:150px;
  padding:21px;
  overflow:hidden;
}

.metric::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  width:4px;
  height:100%;
  background:linear-gradient(180deg,var(--gold),rgba(184,134,11,.18));
}

.metric p{
  margin:0 0 12px;
  color:var(--muted);
  font-size:13px;
  font-weight:650;
}

.metric strong{
  display:block;
  color:var(--text-strong);
  font-size:29px;
  line-height:1.12;
  letter-spacing:-.65px;
}

.metric span{
  display:block;
  margin-top:8px;
  color:var(--muted-2);
  font-size:12px;
}

.content-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:14px;
}

.panel{
  padding:22px;
}

.panel.wide{grid-column:1/-1}

.detail-row{
  display:flex;
  justify-content:space-between;
  gap:24px;
  padding:13px 0;
  border-bottom:1px solid #f0f1f3;
  font-size:14px;
}

.detail-row:last-of-type{border-bottom:0}

.detail-row span{color:var(--muted)}

.detail-row b{
  color:#344054;
  text-align:right;
  overflow-wrap:anywhere;
}

.button-link{margin-top:18px}

.empty-state{
  padding:24px;
  background:var(--surface-soft);
  border:1px dashed #d6d9df;
  border-radius:12px;
}

.empty-state p{
  margin:8px 0 0;
  color:var(--muted);
  font-size:14px;
  line-height:1.6;
}

/* Transaction history */
.transactions-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}

.transactions-header h2{margin-bottom:4px}
.transactions-header p{margin:0}

.tx-filters{
  display:grid;
  grid-template-columns:minmax(150px,190px) minmax(150px,190px) 1fr;
  gap:12px;
  align-items:end;
  padding:15px;
  margin-bottom:12px;
  background:#fbfcfd;
  border:1px solid var(--border);
  border-radius:13px;
}

.tx-filter-field label{
  margin:0 0 7px;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.tx-filter-field input{
  padding:10px 11px;
  border-radius:10px;
  font-size:14px;
}

.tx-filter-actions{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}

.tx-filter-actions button{
  width:auto;
  margin:0;
}

.tx-summary-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:10px 2px 12px;
}

.tx-state{
  padding:24px;
  color:var(--muted);
  background:#fbfcfd;
  border:1px dashed #d6d9df;
  border-radius:12px;
  font-size:14px;
  text-align:center;
}

.tx-error{
  color:var(--red);
  background:var(--red-bg);
  border-color:#f1c7c3;
}

.table-wrap{
  overflow-x:auto;
  background:#fff;
  border:1px solid var(--border);
  border-radius:13px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}

.tx-table{
  width:100%;
  min-width:820px;
  border-collapse:collapse;
  background:#fff;
}

.tx-table th,
.tx-table td{
  padding:13px 14px;
  border-bottom:1px solid #eef0f3;
  text-align:left;
  vertical-align:middle;
  font-size:13px;
}

.tx-table th{
  color:#475467;
  background:#f9fafb;
  font-size:12px;
  font-weight:750;
  letter-spacing:.015em;
  white-space:nowrap;
}

.tx-table tbody tr{
  transition:background .14s ease;
}

.tx-table tbody tr:hover{background:#fcfcfd}
.tx-table tbody tr:last-child td{border-bottom:0}

.tx-ref{
  max-width:220px;
  overflow:hidden;
  color:#344054;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.tx-status{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:750;
  white-space:nowrap;
}

.tx-status::before{
  content:"";
  width:6px;
  height:6px;
  border-radius:50%;
  background:currentColor;
  opacity:.75;
}

.tx-success{color:var(--green);background:var(--green-bg)}
.tx-failed{color:var(--red);background:var(--red-bg)}
.tx-processing{color:var(--amber);background:var(--amber-bg)}
.tx-unavailable{color:#667085;background:#f2f4f7}

.tx-pagination{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  margin-top:15px;
}

.tx-pagination button:disabled{
  opacity:.45;
  cursor:not-allowed;
}

.tx-footnote{
  margin:15px 2px 0;
  padding-top:14px;
  border-top:1px solid #f0f1f3;
  font-size:12px;
}

/* Responsive */
@media(max-width:800px){
  .tx-filters{grid-template-columns:1fr 1fr}
  .tx-filter-actions{
    grid-column:1/-1;
    justify-content:flex-start;
  }
}

@media(max-width:760px){
  .shell{padding:18px 14px 50px}

  .login-card,
  .boot-card{
    margin:36px auto;
    padding:26px 22px;
    border-radius:18px;
  }

  .metrics{grid-template-columns:1fr}
  .content-grid{grid-template-columns:1fr}
  .panel.wide{grid-column:auto}

  .topbar{align-items:flex-start}
  .top-actions{
    flex-direction:column;
    align-items:flex-end;
  }

  .welcome-row{
    align-items:flex-start;
    flex-direction:column;
  }

  .welcome-row h1{font-size:27px}

  .transactions-header{
    align-items:stretch;
    flex-direction:column;
  }

  .transactions-header .small-btn{align-self:flex-start}

  .detail-row{align-items:flex-start}

  .tx-table th,
  .tx-table td{padding:11px 12px}
}

@media(max-width:560px){
  .brand{font-size:28px}

  .tx-filters{grid-template-columns:1fr}

  .tx-filter-actions{
    grid-column:auto;
  }

  .tx-filter-actions button{
    flex:1 1 auto;
  }

  .tx-summary-row{
    align-items:flex-start;
    flex-direction:column;
    gap:4px;
  }

  .tx-pagination{
    justify-content:space-between;
  }
}

@media(prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    scroll-behavior:auto!important;
    transition:none!important;
  }

  .portal-spinner{animation-duration:1.8s}
}

/* Clickable transaction rows + professional transaction detail modal */
.tx-clickable{
  cursor:pointer;
}

.tx-clickable:hover{
  background:#fffdf7!important;
}

.tx-clickable:focus-visible{
  position:relative;
  z-index:1;
  outline:3px solid rgba(184,134,11,.22);
  outline-offset:-3px;
}

.modal-open{
  overflow:hidden;
}

.tx-modal{
  position:fixed;
  inset:0;
  z-index:1000;
  display:grid;
  place-items:center;
  padding:20px;
}

.tx-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.55);
  backdrop-filter:blur(3px);
}

.tx-modal-card{
  position:relative;
  z-index:1;
  width:min(100%,620px);
  max-height:min(86vh,760px);
  overflow:auto;
  padding:25px;
  background:#fff;
  border:1px solid rgba(255,255,255,.7);
  border-radius:20px;
  box-shadow:0 28px 80px rgba(15,23,42,.24);
}

.tx-modal-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding-bottom:18px;
  border-bottom:1px solid var(--border);
}

.tx-modal-header .eyebrow{
  margin:0 0 6px;
}

.tx-modal-header h2{
  margin:0;
  font-size:24px;
  letter-spacing:-.4px;
}

.tx-modal-close{
  width:38px;
  min-width:38px;
  height:38px;
  min-height:38px;
  padding:0;
  color:#475467;
  background:#fff;
  border:1px solid var(--border);
  border-radius:10px;
  box-shadow:none;
  font-size:27px;
  font-weight:400;
  line-height:1;
}

.tx-modal-close:hover{
  color:var(--text-strong);
  background:#f8fafc;
  border-color:var(--border-strong);
  box-shadow:none;
}

.tx-detail-status-row{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding:17px 0 4px;
}

.tx-detail-list{
  margin:0;
}

.tx-detail-row{
  display:grid;
  grid-template-columns:minmax(150px,.8fr) minmax(0,1.2fr);
  gap:22px;
  padding:14px 0;
  border-bottom:1px solid #eef0f3;
}

.tx-detail-row dt{
  color:var(--muted);
  font-size:13px;
  font-weight:650;
}

.tx-detail-row dd{
  margin:0;
  color:#344054;
  font-size:14px;
  font-weight:700;
  text-align:right;
  overflow-wrap:anywhere;
}

.tx-detail-reference{
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  font-size:12px!important;
}

.tx-detail-note{
  margin:18px 0 0;
  padding:13px 14px;
  color:var(--muted);
  background:#fafbfc;
  border:1px solid var(--border);
  border-radius:11px;
  font-size:12px;
  line-height:1.55;
}

.tx-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:9px;
  margin-top:20px;
}

.tx-modal-actions button{
  min-width:112px;
}

@media(max-width:600px){
  .tx-modal{
    align-items:end;
    padding:0;
  }

  .tx-modal-card{
    width:100%;
    max-height:88vh;
    padding:22px 18px 20px;
    border-radius:20px 20px 0 0;
  }

  .tx-detail-row{
    grid-template-columns:1fr;
    gap:5px;
  }

  .tx-detail-row dd{
    text-align:left;
  }

  .tx-detail-status-row{
    justify-content:flex-start;
  }

  .tx-modal-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .tx-modal-actions button{
    width:100%;
  }
}

@media print{
  body{
    background:#fff!important;
  }

  .shell{
    display:none!important;
  }

  .tx-modal{
    position:static!important;
    display:block!important;
    padding:0!important;
  }

  .tx-modal-backdrop,
  .tx-modal-close,
  .tx-modal-actions{
    display:none!important;
  }

  .tx-modal-card{
    width:100%!important;
    max-height:none!important;
    overflow:visible!important;
    padding:0!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
  }
}
