:root {
  color-scheme: light;
  --bg: #fffef8;
  --panel: #ffffff;
  --panel-strong: #fff9dc;
  --ink: #111111;
  --muted: #5f5a47;
  --line: #efe7bc;
  --line-strong: #dbc96f;
  --brand: #f2de74;
  --brand-dark: #e2cc5a;
  --brand-soft: #fff6c8;
  --danger: #9f2f1f;
  --danger-bg: #fff0ed;
  --credit: #166534;
  --credit-bg: #e9f8ef;
  --debit: #b42318;
  --debit-bg: #fff0ed;
  --shadow: 0 22px 50px rgba(17, 17, 17, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(242, 222, 116, 0.18), transparent 24%),
    radial-gradient(circle at left center, rgba(255, 246, 200, 0.65), transparent 28%),
    var(--bg);
  color: var(--ink);
  font-family: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
}

.ambient-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(219, 201, 111, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(219, 201, 111, 0.16) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 80%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid #b8a548;
  border-radius: 6px;
  background: var(--brand);
  color: #111111;
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 0 18px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  padding: 0 14px;
  outline: 0;
  background: rgba(255, 255, 255, 0.96);
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  padding: 12px 14px;
  outline: 0;
  background: rgba(255, 255, 255, 0.96);
}

input:focus {
  border-color: #c8b34f;
  box-shadow: 0 0 0 4px rgba(242, 222, 116, 0.22);
}

input::placeholder,
textarea::placeholder {
  color: rgba(95, 90, 71, 0.52);
  font-weight: 400;
}

select:focus,
textarea:focus {
  border-color: #c8b34f;
  box-shadow: 0 0 0 4px rgba(242, 222, 116, 0.22);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
  position: relative;
  z-index: 1;
}

.auth-panel,
.dashboard {
  display: grid;
  gap: 22px;
}

.auth-panel {
  max-width: 720px;
  margin: 10vh auto 0;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 251, 232, 0.98), rgba(255, 255, 255, 0.98)),
    var(--panel);
  box-shadow: var(--shadow);
}

.auth-form,
.search-panel,
.transactions-panel,
.action-panel {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel-chrome {
  display: flex;
  gap: 8px;
}

.panel-chrome span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid var(--line-strong);
}

.auth-copy {
  display: grid;
  gap: 8px;
}

.auth-note,
.subhead {
  color: var(--muted);
  max-width: 40ch;
}

.input-row,
.search-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.search-grid {
  grid-template-columns: 1fr auto auto;
}

.hero-band,
.topbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-band {
  align-items: stretch;
}

.hero-aside {
  min-width: 280px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 247, 202, 0.94), rgba(255, 255, 255, 0.98));
  box-shadow: var(--shadow);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.hero-aside.is-match {
  border-color: #7dca98;
  background: linear-gradient(180deg, rgba(228, 250, 236, 0.98), rgba(255, 255, 255, 0.98));
}

.hero-aside.is-mismatch {
  border-color: #e7a49d;
  background: linear-gradient(180deg, rgba(255, 238, 235, 0.98), rgba(255, 255, 255, 0.98));
}

.hero-status-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.hero-status-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.hero-status-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  transform-origin: center;
}

.hero-status-icon.is-match {
  background: #dff5e7;
  border-color: #94d7ac;
  color: #166534;
  animation: status-pop 300ms ease;
}

.hero-status-icon.is-mismatch {
  background: #ffe4e0;
  border-color: #efb1aa;
  color: #b42318;
  animation: status-shake 360ms ease;
}

.hero-status-glyph {
  display: block;
  position: relative;
  width: 18px;
  height: 18px;
}

.hero-status-icon.is-match .hero-status-glyph::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 7px;
  height: 12px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(40deg);
}

.hero-status-icon.is-mismatch .hero-status-glyph::before,
.hero-status-icon.is-mismatch .hero-status-glyph::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 0;
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: currentColor;
}

.hero-status-icon.is-mismatch .hero-status-glyph::before {
  transform: rotate(45deg);
}

.hero-status-icon.is-mismatch .hero-status-glyph::after {
  transform: rotate(-45deg);
}

.hero-kicker,
.table-chip,
.timestamp {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.hero-kicker {
  color: #8b7b2c;
}

.hero-email {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.hero-meta {
  display: grid;
  gap: 6px;
}

.hero-meta-line {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

@keyframes status-pop {
  0% {
    transform: scale(0.65);
    opacity: 0;
  }
  70% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes status-shake {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  25% {
    transform: translateX(-3px);
    opacity: 1;
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-2px);
  }
  100% {
    transform: translateX(0);
  }
}

.eyebrow {
  margin: 0 0 4px;
  color: #8b7b2c;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1;
}

h2 {
  font-size: 1.18rem;
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.ghost-button:hover {
  border-color: #c8b34f;
  background: var(--panel-strong);
}

.header-actions,
.headline-block {
  display: grid;
  gap: 6px;
}

.header-actions {
  justify-items: end;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.action-panel,
.wallet-action-form {
  display: grid;
  gap: 18px;
}

.action-panel {
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.action-panel.is-credit {
  border-color: #93d6ab;
  background: linear-gradient(180deg, rgba(236, 252, 243, 0.98), rgba(255, 255, 255, 0.98));
}

.action-panel.is-debit {
  border-color: #efb1aa;
  background: linear-gradient(180deg, rgba(255, 242, 239, 0.98), rgba(255, 255, 255, 0.98));
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.action-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.action-tab {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
  box-shadow: none;
}

.action-tab:hover {
  background: #fffdf4;
}

.action-tab.is-active {
  color: #111111;
}

.action-panel.is-credit .action-tab.is-active {
  border-color: #6bb687;
  background: #dff5e7;
}

.action-panel.is-debit .action-tab.is-active {
  border-color: #df8c83;
  background: #ffe3df;
}

.action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.action-hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-card {
  display: grid;
  gap: 10px;
  min-height: 116px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 251, 232, 0.76), rgba(255, 255, 255, 0.98));
  padding: 20px;
  box-shadow: var(--shadow);
}

.summary-card span,
.muted,
.timestamp {
  color: var(--muted);
}

.summary-card span {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.summary-card strong {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  line-height: 1;
}

.status,
.error-box {
  border-radius: 8px;
  padding: 13px 16px;
  font-weight: 700;
  border-width: 1px;
  border-style: solid;
}

.status {
  border-color: #dbc96f;
  background: #fff9dc;
  color: #5f5320;
}

.error-box {
  border-color: #ffd0c8;
  background: var(--danger-bg);
  color: var(--danger);
}

.filters {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  gap: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fffdf4;
  padding: 4px;
}

.filter-button {
  min-height: 34px;
  border-radius: 5px;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--muted);
  padding: 0 12px;
}

.filter-button:hover,
.filter-button.is-active {
  background: var(--brand);
  color: #111111;
}

.remark-search {
  width: min(320px, 100%);
}

.remark-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fffef7;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: transparent;
}

th,
td {
  border-bottom: 1px solid #efe5b8;
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #fff8d9;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

tr:last-child td {
  border-bottom: 0;
}

.numeric {
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: capitalize;
  border: 1px solid transparent;
}

.badge.credit {
  background: var(--credit-bg);
  color: var(--credit);
  border-color: #b7e1c4;
}

.badge.debit {
  background: var(--debit-bg);
  color: var(--debit);
  border-color: #f2c0ba;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.table-chip {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff8d9;
  color: #65581f;
}

.dashboard {
  animation: rise-in 340ms ease;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.is-hidden {
  display: none;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .auth-panel,
  .auth-form,
  .search-panel,
  .transactions-panel,
  .hero-aside {
    padding: 16px;
  }

  .hero-band,
  .topbar,
  .section-head,
  .filters {
    align-items: stretch;
    flex-direction: column;
  }

  .input-row,
  .search-grid,
  .summary-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .action-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-items: stretch;
  }

  button {
    width: 100%;
  }

  .hero-aside {
    min-width: 0;
  }
}
