/* ==========================================================================
   Walletly — Professional UI (light fintech theme)
   Layout: navy sidebar + white surfaces, indigo accents.
   All existing class names / IDs kept intact for the JS layer.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;

  /* Text */
  --text-main: #0f172a;
  --text-soft: #475569;
  --text-dim: #8a94a6;

  /* Lines */
  --line: #e2e8f0;
  --line-soft: #eef1f7;
  --line-strong: #d8dee9;

  /* Brand */
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef2ff;
  --brand-ring: rgba(79, 70, 229, 0.18);

  /* Semantic */
  --ok: #15803d;
  --ok-soft: #e8f6ee;
  --ok-line: #c8ead6;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --danger-line: #f6cfcf;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --warn-line: #f3ddb7;
  --info: #1d4ed8;
  --info-soft: #e8f0fe;
  --purple: #7e22ce;
  --purple-soft: #f3ecfe;
  --cyan: #0e7490;
  --cyan-soft: #e0f2fe;

  /* Navy (sidebar / balance card / auth panel) */
  --navy-950: #0a1124;
  --navy-900: #101a36;
  --navy-800: #17244a;
  --navy-700: #22315e;

  /* Radii */
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;

  /* Shadows */
  --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 30px -22px rgba(15, 23, 42, 0.28);
  --shadow-pop: 0 24px 48px -20px rgba(15, 23, 42, 0.35);

  /* Typography */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", var(--font-body);

  /* Legacy aliases (older inline styles reference these) */
  --accent-hot: var(--brand);
  --accent-warm: var(--brand);
  --accent-gold: var(--warn);
  --accent: var(--brand);
  --text: var(--text-main);
  --card-bg: var(--surface);
  --card-border: var(--line);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

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

body {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-main);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(99, 102, 241, 0.07), transparent 60%),
    radial-gradient(900px 460px at -10% 110%, rgba(14, 165, 233, 0.06), transparent 60%),
    var(--bg);
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

p { margin: 0; }

a { color: inherit; -webkit-tap-highlight-color: transparent; }

button, input, select, textarea {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  color-scheme: light;
}

a, button, input, select, textarea { outline: none; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: rgba(79, 70, 229, 0.18); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #cdd5e1;
  border-radius: 999px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #b6c0cf; }

/* Ambient background blobs (kept, now very subtle) */
.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

.ambient-one {
  width: 520px;
  height: 520px;
  background: rgba(99, 102, 241, 0.14);
  top: -200px;
  right: -120px;
}

.ambient-two {
  width: 420px;
  height: 420px;
  background: rgba(56, 189, 248, 0.12);
  bottom: -160px;
  left: -140px;
}

.ambient-three {
  width: 300px;
  height: 300px;
  background: rgba(165, 180, 252, 0.12);
  top: 30%;
  left: -140px;
}

/* --------------------------------------------------------------------------
   App shell + sidebar
   -------------------------------------------------------------------------- */

.app-shell {
  position: relative;
  z-index: 2;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 48px);
  border-radius: 20px;
  padding: 22px 16px 18px;
  color: #e6ebf7;
  background:
    radial-gradient(140% 70% at 100% 0%, rgba(99, 102, 241, 0.35), transparent 55%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 28px 56px -28px rgba(10, 17, 36, 0.65);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(150deg, #ffffff, #dfe3ff);
  color: var(--brand-strong);
  box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.55), inset 0 -2px 0 rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 25px;
  height: 25px;
  display: block;
}

.brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.06em;
  font-size: 0.98rem;
  color: #ffffff;
}

.brand-text p + p { margin-top: 3px; }

.menu { display: grid; gap: 4px; }

.menu-section-label {
  margin: 16px 10px 6px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(230, 235, 247, 0.42);
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  width: 100%;
  text-align: left;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 12px;
  background: transparent;
  color: rgba(230, 235, 247, 0.74);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
}

.nav-icon svg, .nav-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.nav-icon svg { stroke: currentColor; }

.menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.menu-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.32), rgba(99, 102, 241, 0.1));
  color: #ffffff;
  font-weight: 600;
}

.menu-item.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #818cf8;
}

.sidebar-card {
  margin-top: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 14px 15px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-card h4 {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(230, 235, 247, 0.45);
  margin-bottom: 7px;
}

.sidebar-card .tier {
  color: #fff9d8;
  font-weight: 700;
  margin-bottom: 6px;
}

.sidebar-card p {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.86rem;
  word-break: break-all;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Main column + header
   -------------------------------------------------------------------------- */

.dashboard {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.wallet-header {
  position: sticky;
  top: 16px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.wallet-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.wallet-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  background: linear-gradient(140deg, var(--brand), #7c3aed);
  box-shadow: 0 8px 18px -8px rgba(79, 70, 229, 0.65);
  flex-shrink: 0;
}

.wallet-greeting {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

.wallet-name {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-settings {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}

.wallet-settings svg { width: 19px; height: 19px; }

.wallet-settings:hover {
  border-color: #c7d2fe;
  background: var(--brand-soft);
  color: var(--brand);
  transform: translateY(-1px);
}

.page-subtitle {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-top: -6px;
}

/* --------------------------------------------------------------------------
   Cards, panels, common bits
   -------------------------------------------------------------------------- */

.card {
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  min-width: 0;
  transition: box-shadow 0.24s ease, border-color 0.24s ease;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h3 {
  font-size: 1.02rem;
  font-weight: 700;
}

.view-all {
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.18s ease;
}

.view-all:hover { color: var(--brand-strong); }

.muted { color: var(--text-soft); }

.tag {
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-3);
  color: var(--text-soft);
  white-space: nowrap;
}

.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.tag.hot { background: var(--brand-soft); color: var(--brand); }

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

/* Dashboard content area */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

/* --------------------------------------------------------------------------
   Balance card
   -------------------------------------------------------------------------- */

.balance-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 24px 26px;
  color: #ffffff;
  background:
    radial-gradient(120% 170% at 100% 0%, rgba(99, 102, 241, 0.6) 0%, rgba(99, 102, 241, 0) 48%),
    radial-gradient(130% 150% at 0% 100%, rgba(56, 189, 248, 0.32) 0%, rgba(56, 189, 248, 0) 52%),
    linear-gradient(135deg, #172554 0%, #1e1b4b 48%, #312e81 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 26px 52px -22px rgba(30, 27, 75, 0.6);
  display: flex;
  flex-direction: column;
}

.balance-card::before,
.balance-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.balance-card::before {
  width: 230px;
  height: 230px;
  right: -80px;
  top: -110px;
}

.balance-card::after {
  width: 150px;
  height: 150px;
  right: -20px;
  top: -60px;
  border-color: rgba(255, 255, 255, 0.07);
}

.balance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.balance-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.balance-chip {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.85);
}

.balance-amount {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 22px;
}

.balance-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.balance-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.balance-note {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.62);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.wallet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.wallet-btn-primary {
  background: #ffffff;
  color: #1e1b4b;
  box-shadow: 0 12px 24px -12px rgba(10, 17, 36, 0.7);
}

.wallet-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px -12px rgba(10, 17, 36, 0.75);
}

.glow-btn, .outline-btn {
  border-radius: 11px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.glow-btn {
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), #6366f1);
  box-shadow: 0 12px 24px -12px rgba(79, 70, 229, 0.75);
}

.glow-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px -12px rgba(79, 70, 229, 0.8);
}

.glow-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.outline-btn {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--line-strong);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.outline-btn:hover {
  background: var(--surface-2);
  border-color: #c3ccdb;
}

.outline-btn:disabled { opacity: 0.45; cursor: default; }

.full { width: 100%; }

.small { padding: 8px 13px; font-size: 0.82rem; }

/* --------------------------------------------------------------------------
   Inputs
   -------------------------------------------------------------------------- */

.upi-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--text-main);
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.upi-input::placeholder { color: var(--text-dim); }

.upi-input:hover { border-color: #c3ccdb; }

.upi-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.upi-input:disabled { opacity: 0.6; }

select.upi-input {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
  padding-right: 36px;
}

.upi-input option { color: var(--text-main); background: #ffffff; }

.field { display: grid; gap: 7px; }

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
}

.amount-input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.amount-input-wrap:hover { border-color: #c3ccdb; }

.amount-input-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.amount-prefix {
  padding: 0 0 0 14px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-soft);
  font-family: var(--font-display);
}

.amount-input {
  flex: 1;
  background: none;
  border: 0;
  padding: 12px 14px 12px 8px;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
  outline: none;
  min-width: 0;
}

.amount-input::placeholder { color: #b6c0cf; }

.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.amount-input[type=number] { -moz-appearance: textfield; }

.upi-select-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.upi-select-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.upi-select-badge {
  padding: 0 0 0 14px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--brand);
  flex-shrink: 0;
}

.upi-select {
  flex: 1;
  background: none;
  border: 0;
  padding: 12px 14px 12px 8px;
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  padding-right: 34px;
}

.upi-select option { background: #ffffff; color: var(--text-main); }

/* --------------------------------------------------------------------------
   Transactions
   -------------------------------------------------------------------------- */

.tx-list { display: grid; gap: 4px; }

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.tx-item:hover {
  background: var(--surface-2);
  border-color: var(--line-soft);
}

.tx-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex: 0 0 38px;
}

.tx-icon.credit { background: var(--ok-soft); color: var(--ok); }
.tx-icon.debit { background: var(--danger-soft); color: var(--danger); }

.tx-info { flex: 1; min-width: 0; }

.tx-info p {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
}

.tx-info > span {
  display: block;
  margin-top: 2px;
  font-size: 0.77rem;
  color: var(--text-dim);
}

.tx-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
}

.tx-amount.credit { color: var(--ok); }
.tx-amount.debit { color: var(--danger); }

.tx-info-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.tx-info-btn:hover {
  color: var(--brand);
  border-color: #c7d2fe;
  background: var(--brand-soft);
}

/* --------------------------------------------------------------------------
   History page
   -------------------------------------------------------------------------- */

.history-card { padding: 0; overflow: hidden; }

/* History transactions list — bordered table-like rows */
#historyList.tx-list {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}

#historyList .tx-item {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

#historyList .tx-item:last-child { border-bottom: 0; }

#historyList .tx-item:hover { background: var(--surface-2); }

.history-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.history-stat {
  display: grid;
  gap: 6px;
  padding: 20px 22px;
}

.history-stat + .history-stat { border-left: 1px solid var(--line-soft); }

.history-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.history-stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.history-stat-value.credit { color: var(--ok); }
.history-stat-value.debit { color: var(--danger); }

.history-filters { min-width: 0; }

.history-filter-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.history-filter-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.history-filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-soft);
}

.history-filter-btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 22px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #ffffff;
  background: var(--brand);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}

.history-filter-btn:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.7);
}

.pagination {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Profile page
   -------------------------------------------------------------------------- */

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

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

.profile-card-wide { grid-column: 1 / -1; }

.profile-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.profile-card-head h3 {
  font-size: 1rem;
  font-weight: 700;
}

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

.profile-field {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
}

.profile-field-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.profile-field-value {
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text-main);
  word-break: break-all;
}

.profile-upi-action { margin-top: 14px; }

.upi-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.upi-link-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.upi-link-btn:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.7);
}

.upi-link-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.upi-link-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.upi-link-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.upi-link-row .upi-input { flex: 1; min-width: 0; }

.upi-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.upi-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.upi-divider::before,
.upi-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Linked UPI / bank list */
.settings-upi-list {
  display: grid;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 2px;
}

.settings-upi-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.settings-upi-item:hover { border-color: #c7d2fe; background: var(--brand-soft); }

.settings-upi-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.settings-upi-left > div { min-width: 0; }

.settings-upi-left strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-all;
}

.settings-upi-left span {
  display: block;
  font-size: 0.73rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.settings-upi-badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  flex-shrink: 0;
}

.settings-bank-badge {
  background: var(--cyan-soft) !important;
  color: var(--cyan) !important;
}

.settings-upi-remove {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.settings-upi-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger-line);
}

.settings-upi-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 22px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

.settings-upi-footer {
  margin-top: 10px;
  font-size: 0.76rem;
  color: var(--text-dim);
  text-align: right;
}

.settings-logout {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: 11px;
  border: 1px solid var(--danger-line);
  background: var(--danger-soft);
  color: var(--danger);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.settings-logout svg { width: 16px; height: 16px; }

.settings-logout:hover { background: #fbdede; border-color: #efb9b9; }

.bank-link-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bank-link-grid .upi-input { width: 100%; }

.bank-link-grid #settingsBankNameInput { grid-column: 1 / -1; }

.bank-link-grid .upi-link-btn { grid-column: 1 / -1; justify-content: center; }

/* --------------------------------------------------------------------------
   Modals (base)
   -------------------------------------------------------------------------- */

body.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.modal.open { opacity: 1; visibility: visible; pointer-events: auto; }
.modal.open::before, .modal.closing::before { opacity: 1; }
.modal.closing { opacity: 0; visibility: visible; pointer-events: none; }

.modal-card {
  position: relative;
  z-index: 1;
  width: min(520px, 94vw);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-radius: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.modal.open .modal-card { opacity: 1; transform: translateY(0) scale(1); }
.modal.closing .modal-card { opacity: 0; transform: translateY(16px) scale(0.98); }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-head h3 { font-size: 1.05rem; font-weight: 700; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text-main);
  border-color: var(--line-strong);
}

.modal-body { display: grid; gap: 12px; }

.modal-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-note { font-size: 0.84rem; color: var(--text-soft); }

/* Transaction detail rows */
.txn-detail-grid { display: grid; gap: 0; }

.txn-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.88rem;
}

.txn-detail-row:last-child { border-bottom: 0; }

.txn-detail-row span { color: var(--text-dim); flex-shrink: 0; }

.txn-detail-row strong {
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
  word-break: break-all;
  max-width: 62%;
}

/* --------------------------------------------------------------------------
   Settings modal
   -------------------------------------------------------------------------- */

.settings-card { max-width: 540px; }

.settings-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.settings-head-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.settings-head-icon svg { width: 19px; height: 19px; }

.settings-head > div:nth-child(2) { flex: 1; min-width: 0; }

.settings-head h3 { font-size: 1.02rem; }

.settings-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* CSS-only tabs (UPI / Bank) */
.settings-tabs { position: relative; }

.settings-tabs > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.settings-tab-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
}

.settings-tab-bar label {
  text-align: center;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.settings-tab-bar label:hover { color: var(--text-soft); }

#settingsTabUpi:checked ~ .settings-tab-bar label[for="settingsTabUpi"],
#settingsTabBank:checked ~ .settings-tab-bar label[for="settingsTabBank"] {
  background: var(--surface);
  color: var(--brand-strong);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.22);
}

.settings-tabs input:focus-visible ~ .settings-tab-bar {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.settings-tab-panel { display: none; }

#settingsTabUpi:checked ~ .settings-tab-panel[data-panel="upi"],
#settingsTabBank:checked ~ .settings-tab-panel[data-panel="bank"] {
  display: grid;
  gap: 12px;
  animation: tabFadeIn 0.22s ease;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Withdraw modal
   -------------------------------------------------------------------------- */

.withdraw-card { max-width: 440px; }

.withdraw-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.withdraw-head-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.withdraw-head-icon svg { width: 19px; height: 19px; }

.withdraw-head > div:nth-child(2) { flex: 1; min-width: 0; }

.withdraw-head h3 { font-size: 1.05rem; }

.withdraw-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.withdraw-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.88rem;
}

.withdraw-balance-row span { color: var(--text-soft); }

.withdraw-balance-row strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-main);
}

.withdraw-method-row {
  display: flex;
  gap: 8px;
}

.withdraw-method-pill {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.withdraw-method-pill:hover:not(:disabled) { border-color: #c7d2fe; }

.withdraw-method-pill.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-strong);
  font-weight: 700;
}

.withdraw-method-pill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.withdraw-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ok-soft);
  border: 1px solid var(--ok-line);
  color: var(--ok);
  font-size: 0.8rem;
}

.withdraw-no-upi {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  font-size: 0.84rem;
  color: var(--warn);
}

.withdraw-no-upi .withdraw-no-upi-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.withdraw-no-upi .withdraw-no-upi-link:hover { background: var(--brand-strong); }
.withdraw-no-upi .withdraw-no-upi-link:active { transform: translateY(1px); }
.withdraw-no-upi .withdraw-no-upi-link:focus-visible {
  outline: 2px solid var(--brand-strong);
  outline-offset: 2px;
}

.withdraw-actions {
  margin-top: 4px;
  display: flex;
  gap: 10px;
}

.withdraw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  border: 0;
  padding: 12px 16px;
  border-radius: 11px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), #6366f1);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.withdraw-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -12px rgba(79, 70, 229, 0.8);
}

.withdraw-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

/* --------------------------------------------------------------------------
   Admin
   -------------------------------------------------------------------------- */

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

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

.admin-limits-bar {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
  min-width: 0;
}

.admin-limits-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-limits-bar-head h3 { font-size: 0.98rem; font-weight: 700; }

.admin-limits-bar-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.admin-limit-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.admin-limit-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-soft);
}

.admin-limit-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-limit-input-row .upi-input { flex: 1; min-width: 0; }

.admin-limit-input-row .amount-prefix { padding: 0; font-size: 0.95rem; }

.admin-limits-bar-body > .upi-link-btn { align-self: end; justify-content: center; }

#adminWorkersList .admin-limit-field {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

/* Admin tables */
.admin-table-card {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  min-width: 0;
}

.admin-table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.admin-table-head h3 { font-size: 1rem; font-weight: 700; }

.admin-search-wrap { flex: 1; max-width: 320px; min-width: 200px; }

.admin-table-scroll { overflow-x: auto; }

.admin-table { width: 100%; }

.admin-table-name {
  display: inline-block;
  max-width: 190px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.admin-table-email {
  display: inline-block;
  max-width: 220px;
  color: var(--text-soft);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.admin-table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-table-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.admin-table-btn:hover { filter: brightness(0.96); transform: translateY(-1px); }

.admin-table-btn-ban { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.admin-table-btn-add { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.admin-table-btn-sub { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.admin-table-btn-tx { background: var(--brand-soft); color: var(--brand); border-color: #dbe1ff; }

.admin-table-foot { padding-top: 6px; }

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0 2px;
}

.admin-page-btn {
  padding: 7px 14px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.admin-page-btn:hover:not(:disabled) { background: var(--surface-2); border-color: #c3ccdb; }
.admin-page-btn:disabled { opacity: 0.45; cursor: default; }

.admin-page-info { font-size: 0.82rem; color: var(--text-dim); }

/* Admin transactions modal */
.admin-tx-card {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  max-height: min(86dvh, 700px);
  overflow: hidden;
  padding: 0;
}

.admin-tx-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}

.admin-tx-head h3 { font-size: 1.02rem; }

.admin-tx-filters {
  padding: 14px 20px 4px;
  flex-shrink: 0;
}

.admin-tx-filter-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-tx-filter-group { display: grid; gap: 5px; min-width: 0; }

.admin-tx-filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.admin-tx-filter-btn {
  padding: 11px 18px;
  border-radius: 10px;
  border: 0;
  background: var(--brand);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, transform 0.18s ease;
}

.admin-tx-filter-btn:hover { background: var(--brand-strong); transform: translateY(-1px); }

.admin-tx-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 20px;
  min-height: 180px;
}

.admin-tx-list { display: grid; }

.admin-tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line-soft);
}

.admin-tx-item:last-child { border-bottom: 0; }

.admin-tx-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.admin-tx-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-tx-amount { font-size: 1.02rem; font-weight: 700; }

.tx-credit { color: var(--ok); }
.tx-debit { color: var(--danger); }

.admin-tx-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 230px;
}

.admin-tx-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.admin-tx-right-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-tx-info-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  flex-shrink: 0;
  padding: 0;
}

.admin-tx-info-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: #c7d2fe; }

.admin-tx-date { font-size: 0.72rem; color: var(--text-dim); }

.admin-tx-foot {
  padding: 10px 20px 14px;
  border-top: 1px solid var(--line-soft);
  flex-shrink: 0;
}

.admin-tx-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* CSV refund upload */
.csv-zone {
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  padding: 30px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.csv-zone:hover { border-color: #a5b4fc; background: var(--brand-soft); }

.csv-zone svg { color: var(--text-dim); margin-bottom: 8px; }

.csv-zone p { font-size: 0.9rem; color: var(--text-soft); }

.csv-zone .csv-browse { color: var(--brand); font-weight: 600; text-decoration: underline; }

.csv-hint { margin-top: 4px !important; font-size: 0.75rem !important; color: var(--text-dim) !important; }

.csv-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 0;
  font-size: 0.88rem;
  color: var(--text-soft);
  text-align: center;
}

.csv-loading .spinner { flex-shrink: 0; vertical-align: middle; }

.csv-summary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.csv-table-scroll {
  overflow: auto;
  max-height: 350px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.csv-table-scroll .admin-table { margin: 0; }

.csv-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.csv-actions .outline-btn { flex: 1; min-width: 100px; }
.csv-actions .glow-btn { flex: 2; min-width: 150px; }

.csv-failed-download { margin-top: 10px; }

.csv-progress { margin-top: 14px; }

.csv-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.csv-progress-meta span:first-child { color: var(--text-soft); }

.csv-progress-result { font-weight: 600; color: var(--text-main); }

.csv-progress-track {
  height: 6px;
  background: var(--surface-3);
  border-radius: 6px;
  overflow: hidden;
}

.csv-progress-track > div {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), #8b5cf6);
  border-radius: 6px;
  transition: width 0.3s ease;
}

/* Switch */
.switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #d3dae5;
  border: 1px solid transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  flex: 0 0 auto;
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.25);
  transition: left 0.2s ease;
}

.switch.on { background: var(--brand); }
.switch.on::after { left: 20px; }

.switch:disabled { opacity: 0.6; cursor: default; }

/* --------------------------------------------------------------------------
   Auth (login / signup)
   -------------------------------------------------------------------------- */

.auth-shell {
  position: relative;
  z-index: 2;
  width: min(1080px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.auth-side {
  border-radius: 22px;
  padding: 34px;
  color: #e8ecf8;
  background:
    radial-gradient(130% 70% at 100% 0%, rgba(99, 102, 241, 0.42), transparent 55%),
    radial-gradient(120% 60% at 0% 100%, rgba(56, 189, 248, 0.22), transparent 55%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 30px 60px -28px rgba(10, 17, 36, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
}

.auth-side .brand {
  border-bottom: 0;
  padding: 0;
  margin-bottom: 22px;
}

.auth-side h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  color: #ffffff;
  margin-top: 6px;
}

.auth-side p { margin-top: 8px; color: rgba(232, 236, 248, 0.78); }

.auth-side .muted { color: rgba(232, 236, 248, 0.55); font-size: 0.84rem; }

.auth-side-desc {
  margin-top: 8px;
  color: rgba(232, 236, 248, 0.78);
  font-size: 0.95rem;
  line-height: 1.55;
}

.auth-highlights { margin-top: 20px; display: grid; gap: 10px; }

.auth-highlight {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px 14px;
}

.auth-highlight strong {
  display: block;
  margin-bottom: 3px;
  color: #ffffff;
  font-size: 0.9rem;
}

.auth-highlight p {
  margin-top: 0;
  color: rgba(232, 236, 248, 0.72);
  font-size: 0.82rem;
  line-height: 1.5;
}

.auth-card {
  border-radius: 22px;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card h1 {
  font-size: clamp(1.4rem, 2.4vw, 1.7rem);
}

.auth-card > p {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

.auth-form { margin-top: 20px; display: grid; gap: 12px; }

.auth-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.auth-inline a, .auth-alt a { color: var(--brand); font-weight: 600; text-decoration: none; }

.auth-alt { margin-top: 14px; color: var(--text-soft); text-align: center; font-size: 0.9rem; }

.auth-card .auth-eyebrow {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.auth-card .auth-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.55;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  padding: 12px 16px;
  background: #ffffff;
  color: #1f2937;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.google-btn:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 18px -10px rgba(15, 23, 42, 0.25);
  transform: translateY(-1px);
}

.google-btn svg { width: 18px; height: 18px; }

.auth-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.auth-footer a {
  color: var(--text-dim);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.18s ease;
}

.auth-footer a:hover { color: var(--brand); }

.auth-dot { color: var(--text-dim); font-size: 0.78rem; }

.auth-msg { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 0.88rem; }
.auth-msg.error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }
.auth-msg.success { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-soft);
  font-size: 0.86rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

.mobile-brand { display: none; }
.mobile-desc { display: none; }
.auth-card-desc { display: block; }

/* --------------------------------------------------------------------------
   Legal pages
   -------------------------------------------------------------------------- */

.legal-wrap {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px;
}

.legal-card {
  width: min(720px, 100%);
  background: var(--surface);
  border-radius: 20px;
  padding: 36px 40px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.legal-card h1 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.legal-card h2 {
  font-size: 1rem;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text-main);
}

.legal-card p {
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 0.92rem;
  margin: 0 0 8px;
}

.legal-card a { color: var(--brand); font-weight: 600; }

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 18px;
  transition: color 0.18s ease;
}

.legal-back:hover { color: var(--brand); }

.legal-updated {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-bottom: 18px;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  --toast-duration: 2400ms;
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 120;
  width: min(430px, calc(100vw - 24px));
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 14px 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px -18px rgba(15, 23, 42, 0.4);
  color: var(--text-main);
  opacity: 0;
  transform: translateX(-50%) translateY(-16px) scale(0.98);
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.26s ease, transform 0.26s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: auto;
}

.toast-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}

.toast-icon::before {
  content: "i";
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
}

.toast[data-tone="success"] .toast-icon { background: var(--ok-soft); color: var(--ok); }
.toast[data-tone="success"] .toast-icon::before { content: "✓"; }

.toast[data-tone="error"] .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast[data-tone="error"] .toast-icon::before { content: "!"; }

.toast-copy { min-width: 0; padding-top: 2px; }

.toast-title {
  display: block;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
}

.toast-message {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.85rem;
  line-height: 1.45;
}

.toast-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 1.15rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.toast-close:hover { background: var(--surface-3); color: var(--text-main); }

.toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--surface-3);
  overflow: hidden;
}

.toast-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--brand), #8b5cf6);
  animation: toastProgress var(--toast-duration) linear forwards;
}

.toast[data-tone="success"] .toast-progress::after { background: linear-gradient(90deg, #16a34a, #4ade80); }
.toast[data-tone="error"] .toast-progress::after { background: linear-gradient(90deg, #dc2626, #f87171); }

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* --------------------------------------------------------------------------
   Spinners / loaders
   -------------------------------------------------------------------------- */

.spinner-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 0;
}

.spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 3px solid rgba(15, 23, 42, 0.12);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.inline-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 0;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.inline-loading .spinner {
  width: 19px;
  height: 19px;
  border-width: 2px;
  flex-shrink: 0;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(243, 245, 250, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity 0.35s ease;
}

.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.page-loader-inner {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.page-loader-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--brand), #7c3aed);
  color: #ffffff;
  box-shadow: 0 18px 34px -16px rgba(79, 70, 229, 0.75);
  animation: loaderPulse 1.5s ease-in-out infinite;
}

.page-loader-mark svg { width: 30px; height: 30px; display: block; }

.page-loader-brand {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.34em;
  padding-left: 0.34em;
  text-transform: uppercase;
  color: var(--brand-strong);
  animation: loaderFade 1.5s ease-in-out infinite;
}

.page-loader-bar {
  width: 108px;
  height: 3px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.16);
  overflow: hidden;
  position: relative;
}

.page-loader-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 46%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), #7c3aed);
  animation: loaderSweep 1.1s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.93); }
}

@keyframes loaderFade {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes loaderSweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(240%); }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader-mark,
  .page-loader-brand { animation: none; }
  .page-loader-bar::after {
    animation: none;
    left: 27%;
  }
}

/* HTMX progress helper (kept for compatibility) */
.htmx-indicator { opacity: 0; transition: opacity 0.2s ease; }
.htmx-request .htmx-indicator { opacity: 1; }

/* --------------------------------------------------------------------------
   Generic tables (admin table + CSV preview)
   -------------------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

th {
  color: var(--text-dim);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--surface-2);
}

th:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
th:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }

tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }

/* --------------------------------------------------------------------------
   Reveal animation
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(14px) scale(0.99);
  animation: rise 0.6s ease forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --------------------------------------------------------------------------
   Mobile bottom navigation
   -------------------------------------------------------------------------- */

.mobile-nav {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 80;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.45);
  pointer-events: auto;
  touch-action: pan-y;
}

.mobile-nav-admin { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.mobile-nav-item {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.68rem;
  line-height: 1.15;
  border-radius: 12px;
  padding: 9px 4px;
  text-align: center;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item .nav-icon { width: 19px; height: 19px; flex: none; }
.mobile-nav-item .nav-label { display: block; }

.mobile-nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.mobile-nav-item:active { transform: translateY(1px); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 236px minmax(0, 1fr); gap: 20px; }
  .history-filter-row { grid-template-columns: 140px minmax(0, 1fr) minmax(0, 1fr) auto; }
}

@media (max-width: 1024px) {
  body.has-mobile-nav { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    margin: 0;
    padding: 16px;
    gap: 16px;
  }

  .sidebar { display: none; }
  .dashboard { gap: 16px; }
  .mobile-nav { display: grid; }

  .wallet-header { top: 12px; padding: 12px 16px; }

  .profile-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-cols { grid-template-columns: minmax(0, 1fr); }

  .auth-shell { grid-template-columns: minmax(0, 1fr); align-items: center; padding: 24px 16px; }
  .auth-side { display: none; }
  .mobile-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
  }
  .mobile-brand .brand-icon {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
    background: linear-gradient(140deg, var(--brand), #7c3aed);
    color: #ffffff;
    box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.7);
  }
  .mobile-brand .brand-text p { color: var(--text-main); font-size: 1rem; }
  .auth-card { width: 100%; }
}

@media (max-width: 760px) {
  body { font-size: 14.5px; }

  .app-shell { padding: 12px; gap: 14px; }
  .card { padding: 16px; border-radius: 16px; }
  .dashboard { gap: 14px; }

  .wallet-header { top: 8px; padding: 11px 14px; border-radius: 14px; }
  .wallet-avatar { width: 40px; height: 40px; font-size: 0.95rem; }
  .wallet-name { font-size: 0.95rem; }
  .wallet-settings { width: 38px; height: 38px; border-radius: 11px; }

  .page-subtitle { font-size: 0.86rem; margin-top: -2px; }

  .balance-card { padding: 20px; border-radius: 18px; }
  .balance-amount { font-size: clamp(1.7rem, 7vw, 2.2rem); margin-bottom: 18px; }
  .balance-bottom { align-items: stretch; }
  .balance-note { width: 100%; }

  .history-strip { grid-template-columns: repeat(3, 1fr); }
  .history-stat { padding: 14px 12px; }
  .history-stat-value { font-size: 1.15rem; }
  .history-stat-label { font-size: 0.62rem; }

  .history-filter-row { grid-template-columns: 1fr 1fr; }
  .history-filter-group { min-width: 0; }
  .history-filter-btn { grid-column: 1 / -1; }

  .pagination { justify-content: center; }

  .profile-details { grid-template-columns: 1fr; }

  .admin-limits-bar { padding: 16px; }
  .admin-limits-bar-body { grid-template-columns: 1fr 1fr; }
  .admin-table-card { padding: 16px; }

  .admin-tx-card { width: 100%; max-height: 92dvh; border-radius: 18px; }
  .admin-tx-filter-row { grid-template-columns: 1fr 1fr; }
  .admin-tx-filter-row .admin-tx-filter-group:first-child { grid-column: 1 / -1; }
  .admin-tx-filter-btn { grid-column: 1 / -1; }
  .admin-tx-item { align-items: flex-start; }
  .admin-tx-meta { max-width: 100%; white-space: normal; }

  /* Modals become bottom sheets */
  .modal { align-items: end; padding: 8px; }
  .modal-card {
    width: 100%;
    max-height: 90dvh;
    border-radius: 18px;
    padding: 18px;
  }

  .modal-actions { justify-content: stretch; }
  .modal-actions > * { flex: 1 1 100%; }

  .settings-head { flex-wrap: wrap; }
  .settings-head .icon-btn { margin-left: auto; }

  .upi-link-row { flex-direction: column; }
  .upi-link-row .upi-link-btn { width: 100%; }

  .bank-link-grid { grid-template-columns: 1fr; }
  .bank-link-grid #settingsBankNameInput { grid-column: auto; }
  .bank-link-grid .upi-link-btn { grid-column: auto; }

  .withdraw-actions { flex-direction: column; }
  .withdraw-actions > * { width: 100%; }

  /* Tables → cards */
  .admin-table-scroll { overflow: visible; }
  table { border-collapse: separate; border-spacing: 0; }
  table thead { display: none; }
  table tbody { display: grid; gap: 10px; }
  table tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--surface);
  }
  table tbody tr:hover { background: var(--surface); }
  table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    white-space: normal;
    border-bottom: 1px dashed var(--line-soft);
    padding: 8px 0;
    font-size: 0.9rem;
  }
  table tbody td::before {
    content: attr(data-label);
    color: var(--text-dim);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex: 0 0 76px;
    white-space: nowrap;
    padding-top: 2px;
  }
  table tbody td:last-child { border-bottom: 0; padding-bottom: 2px; }
  .admin-table-name, .admin-table-email { max-width: 100%; white-space: normal; text-align: right; }
  .admin-table-actions { justify-content: flex-end; }

  .csv-table-scroll { max-height: 300px; }

  .auth-shell { padding: 20px 14px; min-height: 100dvh; align-content: center; }
  .auth-card { padding: 24px 20px; border-radius: 18px; }
  .auth-card-desc { display: none; }
  .mobile-desc {
    display: block;
    color: var(--text-soft);
    font-size: 0.88rem;
    line-height: 1.55;
    margin: 10px 0 4px;
  }
  .auth-footer { gap: 10px; }
  .auth-footer a { font-size: 0.78rem; }

  .legal-wrap { padding: 24px 14px; }
  .legal-card { padding: 24px 20px; border-radius: 16px; }

  .toast {
    top: calc(12px + env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    width: auto;
    grid-template-columns: 36px minmax(0, 1fr) 24px;
    gap: 9px;
    padding: 11px 11px 13px;
    transform: translateY(-12px) scale(0.98);
  }
  .toast.show { transform: translateY(0) scale(1); }
  .toast-icon { width: 36px; height: 36px; border-radius: 10px; }
  .toast-icon::before { font-size: 0.84rem; }
  .toast-copy { padding-top: 0; }
  .toast-title { font-size: 0.86rem; }
  .toast-message { font-size: 0.8rem; margin-top: 2px; }
}

@media (max-width: 520px) {
  .app-shell { padding: 10px; }

  .balance-card { padding: 18px; }
  .balance-label { font-size: 0.68rem; }
  .balance-chip { display: none; }
  .balance-actions { width: 100%; }
  .balance-actions .wallet-btn { width: 100%; }

  .history-filter-row { grid-template-columns: 1fr; }
  .history-stat { padding: 12px 10px; }

  .admin-limits-bar-body { grid-template-columns: 1fr; }

  .mobile-nav { padding: 7px 6px; gap: 4px; border-radius: 16px; }
  .mobile-nav-item { font-size: 0.64rem; padding: 8px 3px; }

  .tx-item { padding: 10px 8px; gap: 10px; }
  .tx-icon { width: 34px; height: 34px; flex-basis: 34px; font-size: 0.85rem; }
  .tx-amount { font-size: 0.88rem; }

  .modal { padding: 0; }
  .modal-card {
    border-radius: 18px 18px 0 0;
    max-height: 94dvh;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .tag { font-size: 0.68rem; padding: 3px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .modal, .modal::before, .modal-card, .card, .menu-item, .toast, .balance-card, .settings-tab-panel {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
  .toast-progress::after { animation: none !important; }
}

/* Legacy helpers still referenced in markup */
.disabled-field { position: relative; }

.actions-row { margin-top: 11px; display: flex; gap: 8px; flex-wrap: wrap; }
