:root {
  color-scheme: dark;
  --bg: #05060c;
  --bg-soft: #0c1020;
  --card: rgba(16, 20, 36, 0.92);
  --card-strong: #161b31;
  --text: #f4f7ff;
  --muted: #a8b0c7;
  --accent: #7c5cff;
  --accent-2: #23c4ff;
  --success: #32d583;
  --danger: #ff6b6b;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 92, 255, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(35, 196, 255, 0.14), transparent 28%),
    linear-gradient(180deg, #03040a 0%, #060816 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 14px 14px;
  outline: none;
}

input::placeholder {
  color: #7f88a5;
}

select option {
  color: #111827;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.background-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.7;
  pointer-events: none;
}

.orb-a {
  width: 220px;
  height: 220px;
  top: -50px;
  left: -60px;
  background: rgba(124, 92, 255, 0.2);
}

.orb-b {
  width: 180px;
  height: 180px;
  bottom: 10%;
  right: -40px;
  background: rgba(35, 196, 255, 0.15);
}

.phone-frame {
  width: min(100%, 420px);
  min-height: calc(100vh - 40px);
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.topbar h1 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.05;
}

.eyebrow,
.section-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--muted);
}

.status-banner {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.status-banner span {
  color: var(--accent-2);
}

.status-banner[data-tone='success'] {
  border-color: rgba(50, 213, 131, 0.25);
  color: #d8ffe8;
}

.status-banner[data-tone='error'] {
  border-color: rgba(255, 107, 107, 0.25);
  color: #ffd5d5;
}

#app {
  padding-bottom: 92px;
}

.app-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.main-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.payment-done-screen {
  min-height: calc(100vh - 170px);
  justify-content: center;
}

.payment-done-card {
  padding: 28px 20px;
  text-align: center;
  display: grid;
  gap: 12px;
  place-items: center;
}

.done-badge {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 34px;
  color: white;
  background: linear-gradient(135deg, var(--success), #1dbf73);
  box-shadow: 0 14px 30px rgba(50, 213, 131, 0.28);
  border: 3px solid rgba(255, 255, 255, 0.12);
}

.done-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.payment-done-card h2 {
  margin: 0;
  font-size: 38px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.balance-value {
  margin: 10px 0 8px;
  font-size: 40px;
  line-height: 1;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.inline-form,
.form-card {
  display: grid;
  gap: 12px;
}

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

.inline-form input {
  min-width: 0;
}

.primary-btn,
.ghost-btn,
.nav-tab,
.filter-chip {
  border-radius: 16px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.primary-btn,
.ghost-btn {
  padding: 14px 16px;
  font-weight: 700;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #5aa8ff);
  color: white;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}

.primary-btn:hover,
.ghost-btn:hover,
.nav-tab:hover,
.filter-chip:hover {
  transform: translateY(-1px);
}

.full-width {
  width: 100%;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.compact-head {
  align-items: center;
}

.section-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.pill {
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(124, 92, 255, 0.16);
  color: #cfd0ff;
  border: 1px solid rgba(124, 92, 255, 0.22);
  white-space: nowrap;
}

.pill.danger {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.22);
  color: #ffd7d7;
}

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

.category-card {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-button {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.category-button p {
  margin: 0;
  font-weight: 600;
}

.category-button .category-icon {
  background: color-mix(in srgb, var(--tile-accent) 18%, transparent);
}

.category-card p,
.transaction-topline strong,
.transaction-meta,
.emi-card strong {
  margin: 0;
}

.category-icon,
.transaction-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.category-card strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.emi-summary {
  padding: 16px 18px;
}

.transaction-list,
.stack-list {
  display: grid;
  gap: 12px;
}

.transaction-row {
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.transaction-icon {
  background: rgba(124, 92, 255, 0.16);
  font-size: 18px;
}

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

.transaction-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.transaction-amount {
  color: #ff9b9b;
  white-space: nowrap;
}

.transaction-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.search-box {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.search-field-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.search-field-wrap input {
  display: block;
  padding-right: 44px;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: 0.9;
  z-index: 2;
  padding: 0;
}

.search-clear:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-box span,
.form-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.filter-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

.filter-chip.active,
.nav-tab.active {
  background: rgba(124, 92, 255, 0.18);
  border-color: rgba(124, 92, 255, 0.4);
  color: white;
}

.form-card {
  padding: 18px;
}

.toggle-group {
  display: flex;
  gap: 10px;
}

.toggle-pill {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  color: var(--text);
}

.toggle-pill input {
  width: auto;
  margin: 0;
}

.compact-form {
  margin-top: 2px;
}

.progress-shell {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

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

.gst-tag {
  margin-top: 8px;
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(35, 196, 255, 0.1);
  color: #c9f5ff;
  font-size: 12px;
  border: 1px solid rgba(35, 196, 255, 0.2);
}

.bottom-nav {
  position: sticky;
  bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  margin-top: 4px;
  background: rgba(9, 12, 24, 0.9);
  backdrop-filter: blur(18px);
}

.nav-tab {
  padding: 12px 8px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

.loading {
  padding: 22px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 420px) {
  .shell {
    padding: 12px;
  }

  .phone-frame {
    min-height: calc(100vh - 24px);
  }

  .balance-value {
    font-size: 34px;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    bottom: 8px;
  }
}
