/* murata-pay shop dashboard — built on GIPSIC design system tokens (web channel) */

:root {
  --brand-red: #c1123f;
  --brand-purple: #540187;
  --brand-navy: #03003d;
  --brand-blue: #0049ab;
  --brand-blue-bright: #0085d5;
  --brand-cyan: #00bfff;
  --on-brand: #ffffff;

  --surface: #ffffff;
  --surface-alt: #f5f6f9;
  --line: #ebebec;
  --line-strong: #d6d6d9;
  --ink: #0b0b12;
  --ink-muted: #5b5b66;
  --ink-faint: #8b93a3;

  --accent: #0049ab;
  --accent-red: #c1123f;
  --red-soft: #fbe9ee;
  --blue-soft: #e4edfa;

  --ok: #0f7b52;
  --ok-soft: #e1f3eb;
  --warn: #8a5b00;
  --warn-soft: #fbf0da;
  --bad: #b3261e;
  --bad-soft: #fbe7e5;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-card: 20px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(11, 11, 18, 0.05), 0 8px 24px -16px rgba(3, 0, 61, 0.3);
  --shadow-hover: 0 10px 15px -3px rgba(3, 0, 61, 0.05), 0 4px 6px -4px rgba(3, 0, 61, 0.05);

  --font-sans: "Poppins", "Noto Sans Thai", ui-sans-serif, system-ui, sans-serif;

  --sidebar-w: 248px;
  --tabbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #0b0c14;
    --surface-alt: #14161f;
    --line: #1d1e27;
    --line-strong: #33353f;
    --ink: #eceef6;
    --ink-muted: #a7adc2;
    --ink-faint: #757c93;
    --accent: #4aa3ff;
    --accent-red: #f2a7bc;
    --red-soft: #3a1422;
    --blue-soft: #10233f;
    --ok: #5fd3a0;
    --ok-soft: #0b3a2a;
    --warn: #e9be6a;
    --warn-soft: #3a2b08;
    --bad: #f49189;
    --bad-soft: #4a1512;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px -16px rgba(0, 0, 0, 0.9);
  }
}

:root[data-theme="dark"] {
  --surface: #0b0c14;
  --surface-alt: #14161f;
  --line: #1d1e27;
  --line-strong: #33353f;
  --ink: #eceef6;
  --ink-muted: #a7adc2;
  --ink-faint: #757c93;
  --accent: #4aa3ff;
  --accent-red: #f2a7bc;
  --red-soft: #3a1422;
  --blue-soft: #10233f;
  --ok: #5fd3a0;
  --ok-soft: #0b3a2a;
  --warn: #e9be6a;
  --warn-soft: #3a2b08;
  --bad: #f49189;
  --bad-soft: #4a1512;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px -16px rgba(0, 0, 0, 0.9);
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  font-size-adjust: from-font;
  background: var(--surface-alt);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.3;
  margin: 0;
  font-weight: 600;
}

a {
  color: var(--accent);
  text-decoration: none;
}

img {
  max-width: 100%;
}

code {
  font-family: inherit;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
}

.icon {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.muted {
  color: var(--ink-muted);
}

.strong {
  font-weight: 600;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.eyebrow-cyan {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-cyan);
}

/* Navy with purple / blue / cyan light — stands in for photography on hero bands. */
.gs-mesh {
  background:
    radial-gradient(70% 90% at 0% 0%, rgba(84, 1, 135, 0.6), transparent 60%),
    radial-gradient(60% 80% at 100% 0%, rgba(0, 73, 171, 0.55), transparent 60%),
    radial-gradient(45% 70% at 90% 115%, rgba(0, 191, 255, 0.28), transparent 60%),
    var(--brand-navy);
  color: var(--on-brand);
}

/* ---------- app shell ---------- */

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 28px 16px 20px;
  background: var(--brand-navy);
  color: var(--on-brand);
  z-index: 20;
}

.sidebar-brand {
  display: block;
  padding: 0 12px;
}

.sidebar-brand img {
  height: 30px;
  width: auto;
  display: block;
}

.sidebar-shop {
  margin: 20px 12px 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-shop-name {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.78);
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--on-brand);
}

.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--brand-cyan);
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  display: inline-grid;
  place-items: center;
  background: var(--brand-blue);
  color: var(--on-brand);
  font-weight: 600;
  font-size: 14px;
}

.sidebar-user-name {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.sidebar-logout:hover {
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
}

.sidebar-credit {
  margin: 14px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.main-wrap {
  margin-left: var(--sidebar-w);
}

.topbar,
.tabbar {
  display: none;
}

.main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 32px 48px;
}

/* ---------- page header & buttons ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--brand-blue);
  color: var(--on-brand);
}

.btn-primary:hover {
  background: var(--brand-blue-bright);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-icon {
  width: 40px;
  padding: 0;
  border-color: var(--line-strong);
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn.is-disabled {
  color: var(--ink-faint);
  border-color: var(--line);
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.link-more:hover {
  text-decoration: underline;
}

/* ---------- stat band ---------- */

.statband {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 32px;
  align-items: center;
  padding: 32px 36px;
  border-radius: var(--radius-card);
  margin-bottom: 24px;
}

.statband-value {
  margin: 6px 0 10px;
  font-size: 46px;
  line-height: 1.15;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.statband-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}

.statband-stats > div {
  padding: 4px 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.statband-stats dt {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.statband-stats dd {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.delta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  font-size: 14px;
  font-weight: 600;
}

.delta-up {
  color: #5fd3a0;
}

.delta-down {
  color: #f49189;
}

.delta-flat {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}

.delta-suffix {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- grid & cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.span-4 {
  grid-column: span 4;
}
.span-5 {
  grid-column: span 5;
}
.span-7 {
  grid-column: span 7;
}
.span-8 {
  grid-column: span 8;
}
.span-12 {
  grid-column: span 12;
}

.stack {
  display: grid;
  gap: 20px;
  align-content: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.card-alert {
  box-shadow: inset 0 3px 0 var(--brand-red), var(--shadow-card);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-head h2 {
  font-size: 17px;
}

.card-sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.card-sub strong {
  color: var(--ink);
  font-weight: 600;
}

.card-foot {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.kpi-big {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.kpi-note {
  margin: 4px 0 16px;
  font-size: 13px;
  color: var(--ink-muted);
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 56px;
}

.spark i {
  flex: 1;
  min-width: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
}

.empty-inline {
  margin: 8px 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 16px;
  color: var(--ink-muted);
}

.empty-state p {
  margin: 0;
}

.all-good,
.alert-count {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
}

.all-good {
  color: var(--ok);
}

.alert-count {
  color: var(--accent-red);
  margin-bottom: 8px;
}

.mini-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.mini-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.mini-list a:hover {
  color: var(--accent);
}

/* ---------- bar chart ---------- */

.bars {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  height: calc(var(--bars-h) + 24px);
}

.bars-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: var(--bars-h);
  font-size: 11px;
  color: var(--ink-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
  transform: translateY(-0.6em);
}

.bars-plot {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: var(--bars-h);
}

.bars-grid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.bars-grid i {
  display: block;
  border-top: 1px solid var(--line);
}

.bars-grid i:last-child {
  border-top-color: var(--line-strong);
}

.bar-col {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  outline: none;
}

.bar {
  width: min(70%, 36px);
  min-width: 3px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  transition: background-color 0.15s;
}

.bar-col:hover .bar,
.bar-col:focus-visible .bar {
  background: var(--brand-blue-bright);
}

.bar-label {
  position: absolute;
  top: calc(100% + 6px);
  font-size: 11px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.bar-label.is-hidden {
  visibility: hidden;
}

.bar-direct {
  position: absolute;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bar-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  min-width: 140px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--brand-navy);
  color: var(--on-brand);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
  z-index: 5;
  pointer-events: none;
}

.bar-tip strong {
  display: block;
  font-weight: 600;
}

.bar-col:hover .bar-tip,
.bar-col:focus-visible .bar-tip {
  display: block;
}

.bar-col:first-child .bar-tip {
  left: 0;
  transform: none;
}

.bar-col:last-child .bar-tip {
  left: auto;
  right: 0;
  transform: none;
}

/* ---------- ranked menu list ---------- */

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.rank-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.rank-no {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--blue-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.rank-body {
  flex: 1;
  min-width: 0;
}

.rank-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.rank-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rank-track {
  height: 6px;
  margin: 6px 0 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  overflow: hidden;
}

.rank-track span {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

.rank-meta {
  font-size: 12px;
  color: var(--ink-muted);
}

/* ---------- weekday bars ---------- */

.hbar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.hbar-list li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.hbar-label {
  color: var(--ink-muted);
}

.hbar-track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  overflow: hidden;
}

.hbar-track span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
}

.hbar-value {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- activity feed ---------- */

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed a {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 96px 84px;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-md);
  color: var(--ink);
}

.feed li + li a {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.feed a .pill {
  justify-self: end;
}

.feed a:hover {
  background: var(--surface-alt);
}

.feed-time {
  font-size: 14px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.feed-body {
  display: grid;
  min-width: 0;
}

.feed-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.feed-meta {
  font-size: 12px;
  color: var(--ink-muted);
}

.feed-amount {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- status pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-lg {
  padding: 4px 14px;
  font-size: 14px;
}

.pill-success {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill-pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-failed {
  background: var(--bad-soft);
  color: var(--bad);
}

.pill-canceled {
  background: var(--surface-alt);
  color: var(--ink-muted);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* ---------- toolbar, filters ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.search {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-muted);
}

.search:focus-within {
  border-color: var(--accent);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}

.field-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-muted);
}

input[type="date"],
input[type="month"],
.field input {
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

input[type="date"]:focus,
input[type="month"]:focus,
.field input:focus {
  border-color: var(--accent);
  outline: none;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
}

.chip:hover {
  color: var(--ink);
}

.chip.is-active {
  background: var(--brand-navy);
  color: var(--on-brand);
}

.month-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.month-form {
  display: flex;
  gap: 8px;
}

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 -24px;
  padding: 0 24px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface-alt);
  white-space: nowrap;
}

.table th:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.table th:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: var(--surface-alt);
}

.table th.num,
.table td.num {
  text-align: right;
}

.table tfoot td {
  padding: 12px;
  font-weight: 600;
  border-top: 1px solid var(--line-strong);
  border-bottom: 0;
}

.table tr.is-muted td {
  color: var(--ink-muted);
}

.cell-items {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-link {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.txn-cards {
  display: none;
  list-style: none;
  margin: 0 -16px;
  padding: 0;
}

.txn-cards a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.txn-cards a:active {
  background: var(--surface-alt);
}

.txn-title {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.txn-amount {
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.txn-meta {
  font-size: 13px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.txn-cards .pill {
  justify-self: end;
}

/* ---------- pagination (AntD-style) ---------- */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.pager-total {
  font-size: 13px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.pager-items {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pager-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, color 0.15s;
}

a.pager-item:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pager-item.is-active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.pager-item.is-disabled {
  color: var(--ink-faint);
  border-color: var(--line);
  cursor: not-allowed;
}

.pager-ellipsis {
  border-color: transparent;
  background: transparent;
  color: var(--ink-faint);
  letter-spacing: 1px;
  font-size: 10px;
}

/* ---------- detail ---------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 20px;
  align-items: start;
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--line-strong);
}

.receipt-amount {
  font-size: 36px;
  font-variant-numeric: tabular-nums;
}

.receipt-items th {
  background: transparent;
  padding-left: 0;
}

.receipt-items td:first-child,
.receipt-items tfoot td:first-child {
  padding-left: 0;
}

.receipt-items th:last-child,
.receipt-items td:last-child {
  padding-right: 0;
}

.kv {
  display: grid;
  gap: 0;
  margin: 0;
}

.kv > div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.kv dt {
  color: var(--ink-muted);
}

.kv dd {
  margin: 0;
}

.pay-method {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.details-table summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.details-table summary::-webkit-details-marker {
  display: none;
}

.details-table summary h2 {
  font-size: 17px;
}

.details-chevron {
  color: var(--ink-muted);
  transition: transform 0.2s;
}

.details-table[open] .details-chevron {
  transform: rotate(90deg);
}

.details-table[open] summary {
  margin-bottom: 16px;
}

/* ---------- callouts ---------- */

.callout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin: 16px 0 0;
}

.callout-red {
  background: var(--red-soft);
  color: var(--accent-red);
}

/* ---------- auth & status pages ---------- */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.auth-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: 48px 56px;
}

.auth-side-logo {
  height: 36px;
  width: auto;
  align-self: flex-start;
}

.auth-side-title {
  margin: 12px 0;
  font-size: 40px;
  line-height: 1.3;
}

.auth-side-text {
  margin: 0;
  max-width: 420px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.75);
}

.auth-side-credit {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.auth-main {
  display: grid;
  place-items: center;
  padding: 32px 24px;
  background: var(--surface);
}

.auth-card {
  width: min(380px, 100%);
}

.auth-logo {
  display: block;
  height: 36px;
  width: auto;
  margin-bottom: 32px;
}

.auth-card h1 {
  font-size: 28px;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-muted);
}

.field input {
  min-height: 46px;
  font-size: 15px;
}

.auth-form .btn {
  min-height: 46px;
  margin-top: 8px;
  font-size: 15px;
}

.status-page {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: var(--surface);
}

.status-page .auth-logo {
  margin: 0 0 16px;
}

.status-page h1 {
  font-size: 24px;
}

.status-code {
  margin: 0;
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}

.status-page .btn {
  margin-top: 8px;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .statband {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .statband-stats > div:first-child {
    border-left: 0;
    padding-left: 0;
  }

  .span-4,
  .span-5,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .main-wrap {
    margin-left: 0;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }

  .topbar-logo {
    height: 24px;
    width: auto;
  }

  .topbar-logout button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
  }

  .tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
  }

  .tabbar a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-muted);
  }

  .tabbar a.active {
    color: var(--accent);
  }

  .main {
    padding: 20px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom));
  }

  .page-head h1 {
    font-size: 22px;
  }

  .auth {
    grid-template-columns: 1fr;
  }

  .auth-side {
    display: none;
  }
}

@media (max-width: 640px) {
  .statband {
    padding: 24px 20px;
  }

  .statband-value {
    font-size: 36px;
  }

  .statband-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 16px;
  }

  .statband-stats > div:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }

  .card {
    padding: 20px 16px;
  }

  .table-wrap {
    margin: 0 -16px;
    padding: 0 16px;
  }

  .feed a {
    grid-template-columns: 44px minmax(0, 1fr) auto;
  }

  .feed .pill {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .table-desktop {
    display: none;
  }

  .txn-cards {
    display: block;
  }

  .toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .toolbar .search {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -16px 12px;
    padding: 0 16px 4px;
    scrollbar-width: none;
  }

  .chip {
    flex-shrink: 0;
  }

  .toolbar .field-inline {
    display: grid;
    gap: 4px;
  }

  .toolbar .field-inline input {
    width: 100%;
    min-width: 0;
  }

  .toolbar .btn {
    grid-column: 1 / -1;
  }

  .pager {
    justify-content: center;
  }

  .kv > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .hbar-list li {
    grid-template-columns: 64px minmax(0, 1fr) 64px;
  }

  .month-switch {
    width: 100%;
  }

  .month-form {
    flex: 1;
  }

  .month-form input {
    flex: 1;
    min-width: 0;
  }
}

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

@media (prefers-contrast: more) {
  :root {
    --ink-muted: #3b3b44;
    --ink-faint: #5b5b66;
  }
}
