@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0b0f19;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f2f5fa;
  --text-secondary: #8d96a8;
  --accent-cyan: #22d3ee;
  --accent-blue: #3b82f6;
  --emerald: #34d399;
  --emerald-deep: #10b981;
  --coral: #fb7166;
  --coral-deep: #f0554a;
  --gold: #d9b26a;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur: 240ms;
  --dur-slow: 420ms;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: -220px;
  left: -160px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.16), transparent 70%);
  filter: blur(70px);
  z-index: -1;
  animation: glowDrift 28s ease-in-out infinite;
}

.app-shell {
  position: relative;
  min-height: 100vh;
}

.app-shell::before {
  content: "";
  position: fixed;
  bottom: -240px;
  right: -180px;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.09), transparent 70%);
  filter: blur(80px);
  z-index: -1;
  animation: glowDrift 34s ease-in-out infinite reverse;
}

.app-shell::after {
  content: "";
  position: fixed;
  top: 45%;
  left: 55%;
  width: 500px;
  height: 500px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(124, 108, 240, 0.06), transparent 70%);
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
}

@keyframes glowDrift {
  0%, 100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(14px, -10px);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(24px);
  }
}

.hidden {
  display: none !important;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 15, 25, 0.72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeInDown 0.5s var(--ease) both;
}

.header-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.32);
  color: var(--accent-cyan);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 6px 16px rgba(34, 211, 238, 0.14);
}

.brand-title {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.user-nav {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-greeting {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #04121c;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 10px 22px -6px rgba(34, 211, 238, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 14px 28px -6px rgba(34, 211, 238, 0.42);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 6px 14px -4px rgba(34, 211, 238, 0.35);
}

.btn-block {
  width: 100%;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(251, 113, 102, 0.4);
  color: var(--coral);
}

.btn-outline-danger:hover {
  background: rgba(251, 113, 102, 0.1);
  border-color: var(--coral);
}

.btn-sm {
  font-size: 0.8rem;
  padding: 8px 14px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition:
    color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.btn-text:hover {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.auth-card,
.summary-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 46px -26px rgba(0, 0, 0, 0.65);
}

.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.auth-section {
  min-height: calc(100vh - 220px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  animation: fadeInUp 0.55s var(--ease) both;
}

.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 10px 0;
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.auth-tab:hover:not(.active) {
  color: var(--text);
}

.auth-tab.active {
  background: rgba(56, 189, 248, 0.14);
  color: #eafcff;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3) inset;
}

.auth-tab:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.auth-form {
  animation: fadeInUp 0.4s var(--ease) both;
}

.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-group label {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.form-control::placeholder {
  color: rgba(141, 150, 168, 0.6);
}

.form-control:hover {
  border-color: var(--border-strong);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.05);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

select.form-control {
  appearance: none;
  -webkit-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='%238d96a8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px;
  padding-right: 36px;
}

input[type="date"].form-control {
  color-scheme: dark;
}

.form-control-sm {
  padding: 8px 30px 8px 12px;
  font-size: 0.84rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.summary-card {
  padding: 22px 24px;
  min-width: 0;
  transition:
    transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
  animation: fadeInUp 0.5s var(--ease) both;
}

.summary-card:nth-child(2) {
  animation-delay: 0.06s;
}

.summary-card:nth-child(3) {
  animation-delay: 0.12s;
}

.summary-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

.card-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.card-amount {
  margin: 0;
  min-width: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  overflow-wrap: anywhere;
}

.balance-card {
  border-top: 2px solid var(--gold);
}

.balance-card .card-amount {
  color: #e8cf9c;
}

.income-card {
  border-top: 2px solid var(--emerald);
}

.income-card .card-amount {
  color: var(--emerald);
}

.expense-card {
  border-top: 2px solid var(--coral);
}

.expense-card .card-amount {
  color: var(--coral);
}

.dashboard-content {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  padding: 26px;
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.panel-title {
  margin: 0;
  min-width: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.type-toggle-group {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.type-radio-label {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.type-radio-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.type-radio-label:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

#typeExpenseLabel:has(input:checked),
.type-radio-label.expense-active {
  background: linear-gradient(135deg, var(--coral), var(--coral-deep));
  border-color: transparent;
  color: #2a0705;
}

#typeIncomeLabel:has(input:checked),
.type-radio-label.income-active {
  background: linear-gradient(135deg, var(--emerald), var(--emerald-deep));
  border-color: transparent;
  color: #04231a;
}

.input-prefix-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.currency-symbol {
  position: absolute;
  left: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  pointer-events: none;
  transition: color var(--dur) var(--ease);
}

.input-prefix-wrapper:focus-within .currency-symbol {
  color: var(--accent-cyan);
}

.form-control.with-prefix {
  padding-left: 30px;
}

.tx-count {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

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

.filter-group {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.filter-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.filter-btn.active {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.4);
  color: #eafcff;
}

.filter-btn:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

.tx-list-container {
  max-height: 520px;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.tx-list-container::-webkit-scrollbar {
  width: 6px;
}

.tx-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.tx-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tx-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.tx-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.tx-list li:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  transform: translateX(2px);
}

.tx-list li .tx-title,
.tx-list li .description {
  min-width: 0;
  font-weight: 600;
  color: var(--text);
  font-size: 0.92rem;
}

.tx-list li .tx-category,
.tx-list li .category {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.tx-list li .tx-date,
.tx-list li .date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.tx-list li .tx-amount,
.tx-list li .amount {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tx-list li .tx-amount.income,
.tx-list li .amount.income,
.tx-list li[data-type="income"] .tx-amount {
  color: var(--emerald);
}

.tx-list li .tx-amount.expense,
.tx-list li .amount.expense,
.tx-list li[data-type="expense"] .tx-amount {
  color: var(--coral);
}

.tx-list li button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition:
    color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.tx-list li button:hover {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

.tx-list li button.delete-btn:hover,
.tx-list li button[data-action="delete"]:hover {
  color: var(--coral);
  background: rgba(251, 113, 102, 0.1);
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  animation: fadeInUp 0.5s var(--ease) both;
}

.empty-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}

.empty-subtext {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.toast {
  background: rgba(20, 26, 40, 0.85);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-size: 0.88rem;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.35s var(--ease) both;
}

.toast.toast-success,
.toast.success {
  border-left-color: var(--emerald);
}

.toast.toast-error,
.toast.error {
  border-left-color: var(--coral);
}

.toast.toast-warning,
.toast.warning {
  border-left-color: var(--gold);
}

.toast.hide,
.toast.removing {
  animation: toastOut 0.3s var(--ease) both;
}

.forgot-link {
  display: block;
  text-align: right;
  margin-top: -8px;
  margin-bottom: 18px;
  color: #5ec8ff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.forgot-link:hover {
  color: #22d3ee;
  text-decoration: underline;
  transform: translateX(-1px);
}

.theme-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.theme-toggle {
  position: absolute;
  right: 150px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  box-shadow:
    0 8px 24px -16px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    transform 180ms ease,
    box-shadow 220ms ease;
}

.theme-toggle:hover {
  transform: translateY(-50%) scale(1.06);
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(34, 211, 238, 0.35);
}

.theme-toggle:active {
  transform: translateY(-50%) scale(0.97);
}

.theme-toggle-input:focus-visible + .theme-toggle {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
}

.theme-icon {
  position: absolute;
  font-size: 18px;
  line-height: 1;
  transition:
    opacity 180ms ease,
    transform 220ms ease;
}

.theme-icon-sun {
  opacity: 0;
  transform: rotate(-30deg) scale(0.72);
}

.theme-icon-moon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

body:has(#themeToggleInput:checked) {
  --bg: #eef4f8;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: rgba(255, 255, 255, 0.97);
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #172033;
  --text-secondary: #64748b;
  color-scheme: light;
  background:
    radial-gradient(circle at 8% 10%, rgba(56, 189, 248, 0.20), transparent 28%),
    radial-gradient(circle at 91% 85%, rgba(45, 212, 191, 0.14), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #eff4f8 52%, #e8f0f5 100%);
}

body:has(#themeToggleInput:checked) .app-header {
  background: rgba(246, 249, 252, 0.84);
  border-bottom-color: rgba(15, 23, 42, 0.09);
  box-shadow: 0 10px 28px -24px rgba(15, 23, 42, 0.24);
}

body:has(#themeToggleInput:checked) .auth-card,
body:has(#themeToggleInput:checked) .summary-card,
body:has(#themeToggleInput:checked) .panel {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 23, 42, 0.10);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.98) inset,
    0 30px 65px -34px rgba(15, 23, 42, 0.30),
    0 0 60px -38px rgba(14, 165, 233, 0.20);
}

body:has(#themeToggleInput:checked) .auth-intro h2 {
  color: #172033;
}

body:has(#themeToggleInput:checked) .auth-intro p {
  color: #63738b;
}

body:has(#themeToggleInput:checked) .auth-tabs {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.08);
}

body:has(#themeToggleInput:checked) .auth-tab {
  color: #64748b;
}

body:has(#themeToggleInput:checked) .auth-tab.active {
  background:
    linear-gradient(
      135deg,
      rgba(56, 189, 248, 0.16),
      rgba(59, 130, 246, 0.09)
    );
  color: #173a50;
}

body:has(#themeToggleInput:checked) .form-group label {
  color: #586982;
}

body:has(#themeToggleInput:checked) .form-control {
  background: rgba(248, 250, 252, 0.96);
  border-color: rgba(15, 23, 42, 0.11);
  color: #172033;
}

body:has(#themeToggleInput:checked) .form-control:focus {
  background: #ffffff;
  border-color: rgba(8, 145, 178, 0.46);
}

body:has(#themeToggleInput:checked) .forgot-link {
  color: #0788ad;
}

body:has(#themeToggleInput:checked) .theme-toggle {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.10);
  color: #1e293b;
}

body:has(#themeToggleInput:checked) .theme-icon-sun {
  opacity: 1;
  transform: rotate(0) scale(1);
}

body:has(#themeToggleInput:checked) .theme-icon-moon {
  opacity: 0;
  transform: rotate(30deg) scale(0.72);
}

html.light-theme .form-control {
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
}

html.light-theme .form-control:focus {
  background: rgba(255, 255, 255, 0.95);
}

html.light-theme .auth-tabs {
  background: rgba(15, 23, 42, 0.035);
}

html.light-theme .type-radio-label {
  background: rgba(15, 23, 42, 0.025);
}

html.light-theme .filter-btn {
  background: rgba(15, 23, 42, 0.025);
}

html.light-theme .tx-count {
  background: rgba(15, 23, 42, 0.035);
}

html.light-theme .tx-list li {
  background: rgba(15, 23, 42, 0.025);
}

html.light-theme .tx-list li:hover {
  background: rgba(15, 23, 42, 0.05);
}

html.light-theme .transaction-item:hover {
  background: rgba(15, 23, 42, 0.025);
}

html.light-theme .custom-select-button {
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.95),
      rgba(248, 250, 252, 0.95)
    );
  color: var(--text);
}

html.light-theme .custom-select-menu {
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.98),
      rgba(248, 250, 252, 0.99)
    );
  border-color: var(--border);
}

html.light-theme .custom-select-option {
  color: var(--text);
}

html.light-theme #txCategory,
html.light-theme #categoryFilter {
  background-color: #ffffff;
  color: var(--text);
  color-scheme: light;
}

html.light-theme #txCategory option,
html.light-theme #categoryFilter option {
  background-color: #ffffff;
  color: var(--text);
}

html.light-theme .toast {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

html.light-theme .theme-toggle {
  background: rgba(15, 23, 42, 0.05);
}

.currency-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.currency-background span {
  position: absolute;
  display: block;
  color: rgba(93, 213, 255, 0.16);
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(3rem, 5.8vw, 5.6rem);
  font-weight: 600;
  line-height: 1;
  user-select: none;
  will-change: transform, opacity;
  animation: currencyFloat 16s ease-in-out infinite;
  text-shadow: 0 0 24px rgba(34, 211, 238, 0.12);
}

.currency-background span:nth-child(1) {
  left: 7%;
  top: 15%;
  animation-delay: -2s;
  animation-duration: 17s;
}

.currency-background span:nth-child(2) {
  left: 23%;
  top: 72%;
  animation-delay: -9s;
  animation-duration: 20s;
}

.currency-background span:nth-child(3) {
  left: 44%;
  top: 18%;
  animation-delay: -5s;
  animation-duration: 18s;
}

.currency-background span:nth-child(4) {
  left: 69%;
  top: 71%;
  animation-delay: -11s;
  animation-duration: 21s;
}

.currency-background span:nth-child(5) {
  left: 87%;
  top: 20%;
  animation-delay: -7s;
  animation-duration: 19s;
}

.currency-background span:nth-child(6) {
  left: 12%;
  top: 50%;
  animation-delay: -12s;
  animation-duration: 22s;
}

.currency-background span:nth-child(7) {
  left: 34%;
  top: 39%;
  animation-delay: -4s;
  animation-duration: 17s;
}

.currency-background span:nth-child(8) {
  left: 57%;
  top: 85%;
  animation-delay: -10s;
  animation-duration: 23s;
}

.currency-background span:nth-child(9) {
  left: 79%;
  top: 45%;
  animation-delay: -6s;
  animation-duration: 18s;
}

.currency-background span:nth-child(10) {
  left: 92%;
  top: 81%;
  animation-delay: -13s;
  animation-duration: 21s;
}

.currency-background span:nth-child(11) {
  left: 50%;
  top: 58%;
  animation-delay: -8s;
  animation-duration: 20s;
}

.currency-background span:nth-child(12) {
  left: 3%;
  top: 88%;
  animation-delay: -14s;
  animation-duration: 22s;
}

@keyframes currencyFloat {
  0%, 100% {
    transform: translate3d(0, 20px, 0) rotate(-5deg) scale(0.94);
    opacity: 0.22;
  }

  30% {
    opacity: 0.48;
  }

  50% {
    transform: translate3d(28px, -34px, 0) rotate(6deg) scale(1.07);
    opacity: 0.78;
  }

  75% {
    opacity: 0.42;
  }
}

.auth-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(34, 211, 238, 0.75),
    transparent
  );
}

.auth-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 34px 80px -36px rgba(0, 0, 0, 0.82),
    0 0 72px -34px rgba(34, 211, 238, 0.42);
}

.auth-ambient {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.auth-ambient-left {
  left: 7%;
  top: 24%;
  width: 170px;
  opacity: 0.42;
  transform: rotate(-7deg);
}

.auth-ambient-right {
  right: 7%;
  bottom: 23%;
  width: 180px;
  opacity: 0.36;
  transform: rotate(8deg);
}

.ambient-symbol {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 7rem;
  line-height: 0.8;
  color: rgba(56, 189, 248, 0.07);
  text-shadow: 0 0 35px rgba(56, 189, 248, 0.18);
}

.auth-ambient-right .ambient-symbol {
  color: rgba(52, 211, 153, 0.06);
  text-align: right;
}

.ambient-label {
  display: inline-block;
  margin-right: 7px;
  margin-top: 14px;
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 999px;
  color: rgba(148, 163, 184, 0.42);
  background: rgba(255, 255, 255, 0.015);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.ambient-line {
  display: block;
  height: 7px;
  margin: 12px 0 0 auto;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.05);
  border: 1px solid rgba(52, 211, 153, 0.06);
}

.ambient-line:nth-child(3) {
  width: 80%;
}

.ambient-line:nth-child(4) {
  width: 58%;
}

.ambient-line:nth-child(5) {
  width: 36%;
}

html.light-theme .auth-card {
  border-color: rgba(15, 23, 42, 0.09);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.98) inset,
    0 30px 65px -34px rgba(15, 23, 42, 0.25),
    0 0 70px -48px rgba(34, 211, 238, 0.28);
}

html.light-theme .auth-card::after {
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.72),
      transparent 42%
    );
}

html.light-theme .auth-tabs {
  background: rgba(15, 23, 42, 0.032);
}

html.light-theme .auth-tab.active {
  background:
    linear-gradient(
      135deg,
      rgba(56, 189, 248, 0.16),
      rgba(34, 211, 238, 0.08)
    );
  color: #12384d;
}

html.light-theme .input-icon {
  color: #94a3b8;
}

html.light-theme .input-shell:focus-within .input-icon {
  color: #0891b2;
}

html.light-theme .ambient-symbol {
  color: rgba(8, 145, 178, 0.045);
  text-shadow: none;
}

html.light-theme .auth-ambient-right .ambient-symbol {
  color: rgba(16, 185, 129, 0.04);
}

html.light-theme .ambient-label {
  color: rgba(71, 85, 105, 0.32);
  border-color: rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.32);
}

html.light-theme .ambient-line {
  background: rgba(16, 185, 129, 0.035);
  border-color: rgba(16, 185, 129, 0.05);
}

@media (min-width: 641px) {
  .user-nav {
    right: 78px;
  }

  .theme-toggle {
    right: 24px;
  }
}

@media (max-width: 960px) {
  .app-main {
    width: 100%;
    max-width: 100%;
    padding-left: 18px;
    padding-right: 18px;
  }

  .header-content {
    width: 100%;
    max-width: 100%;
    padding-left: 18px;
    padding-right: 18px;
  }

  .dashboard-content {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    gap: 12px;
  }
}

@media (max-width: 640px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-header {
    min-height: 58px;
  }

  .header-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    min-height: 58px;
    padding: 0 10px;
    gap: 8px;
  }

  .brand {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: calc(100% - 96px);
    flex: 1 1 auto;
    gap: 7px;
  }

  .brand-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    flex: 0 0 30px;
    font-size: 15px;
  }

  .brand-title {
    min-width: 0;
    max-width: 100%;
    margin: 0;
    font-size: 15px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .user-nav {
    position: static;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    margin: 0;
    gap: 6px;
    flex: 0 0 auto;
    transform: none;
  }

  .user-greeting {
    display: none;
  }

  #logoutBtn {
    height: 32px;
    min-height: 32px;
    padding: 6px 9px;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .theme-toggle {
    position: static;
    width: 32px;
    height: 32px;
    min-width: 32px;
    margin: 0;
    flex: 0 0 32px;
    font-size: 15px;
    transform: none;
  }

  .theme-toggle:hover {
    transform: scale(1.05);
  }

  .theme-toggle:active {
    transform: scale(0.97);
  }

  .app-main {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 18px 12px 40px;
    overflow-x: hidden;
  }

  .auth-section,
  .dashboard-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .auth-section {
    min-height: calc(100vh - 100px);
    padding: 0;
  }

  .auth-card {
    width: 100%;
    max-width: 420px;
    min-width: 0;
    margin: 14px auto;
    padding: 26px 18px 22px;
    border-radius: 18px;
  }

  .auth-intro {
    width: 100%;
    max-width: 100%;
    margin-bottom: 22px;
  }

  .auth-eyebrow {
    font-size: 9px;
    letter-spacing: 0.14em;
  }

  .auth-intro h2 {
    width: 100%;
    max-width: 100%;
    font-size: 1.55rem;
    line-height: 1.1;
  }

  .auth-intro p {
    width: 100%;
    max-width: 100%;
    font-size: 0.78rem;
    line-height: 1.5;
  }

  .auth-tabs {
    display: flex;
    width: 100%;
    min-width: 0;
    margin-bottom: 24px;
    padding: 4px;
    gap: 2px;
  }

  .auth-tab {
    min-width: 0;
    width: 50%;
    padding: 9px 5px;
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .auth-form,
  .form-group,
  .input-prefix-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-group label {
    font-size: 0.72rem;
  }

  .form-control,
  .btn-block {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .form-control {
    min-height: 46px;
    padding: 11px 12px;
    font-size: 0.9rem;
  }

  .form-control.with-prefix {
    padding-left: 29px;
  }

  .forgot-link {
    font-size: 12px;
  }

  .auth-footnote {
    gap: 8px;
    margin-top: 18px;
    font-size: 9px;
    text-align: center;
  }

  .summary-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 18px;
  }

  .summary-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 17px 16px;
    border-radius: 16px;
  }

  .card-label {
    font-size: 10px;
  }

  .card-amount {
    max-width: 100%;
    font-size: 1.45rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .dashboard-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 16px;
    border-radius: 16px;
    overflow: hidden;
  }

  .panel-header {
    width: 100%;
    min-width: 0;
    gap: 8px;
  }

  .panel-title {
    min-width: 0;
    font-size: 1rem;
  }

  .type-toggle-group {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .type-radio-label {
    width: 100%;
    min-width: 0;
    padding: 10px 5px;
    font-size: 12px;
    text-align: center;
  }

  .filter-bar {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filter-group {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .filter-btn {
    width: 100%;
    min-width: 0;
    padding: 7px 5px;
    font-size: 11px;
    white-space: nowrap;
  }

  .category-filter-group,
  .category-filter-group select,
  #categoryFilter {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .tx-list-container,
  .tx-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .tx-list-container {
    overflow-x: hidden;
  }

  .transaction-item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 13px 11px;
  }

  .transaction-info {
    min-width: 0;
    max-width: 100%;
  }

  .transaction-description {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
  }

  .transaction-meta {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 10px;
  }

  .transaction-amount {
    grid-column: 2;
    grid-row: 1;
    font-size: 13px;
    white-space: nowrap;
  }

  .transaction-actions {
    grid-column: 1 / -1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .transaction-actions button {
    padding: 6px 8px;
    font-size: 10px;
  }

  .toast-container {
    top: 68px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
  }

  .toast {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }

  .currency-background span {
    font-size: clamp(2.3rem, 10vw, 3.6rem);
  }

  .auth-ambient {
    display: none;
  }

  .custom-select-menu {
    max-height: 240px;
    overflow-y: auto;
  }
}

@media (max-width: 430px) {
  .header-content {
    padding-left: 8px;
    padding-right: 8px;
    gap: 5px;
  }

  .brand {
    max-width: calc(100% - 76px);
    gap: 5px;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    flex-basis: 28px;
  }

  .brand-title {
    font-size: 13px;
  }

  .user-nav {
    gap: 4px;
  }

  #logoutBtn {
    height: 30px;
    min-height: 30px;
    padding: 5px 7px;
    font-size: 9px;
  }

  .theme-toggle {
    width: 30px;
    height: 30px;
    min-width: 30px;
    flex-basis: 30px;
  }

  .app-main {
    padding-left: 9px;
    padding-right: 9px;
  }

  .auth-card {
    padding: 23px 14px 20px;
  }

  .auth-tab {
    font-size: 12px;
    padding-left: 3px;
    padding-right: 3px;
  }

  .auth-intro h2 {
    font-size: 1.4rem;
  }

  .summary-card {
    padding: 15px;
  }

  .card-amount {
    font-size: 1.32rem;
  }

  .panel {
    padding: 14px;
  }
}

@media (max-width: 300px) {
  .header-content {
    min-height: 52px;
    padding: 0 6px;
    gap: 4px;
  }

  .brand {
    max-width: 34px;
    flex: 0 0 34px;
  }

  .brand-title {
    display: none;
  }

  .brand-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    flex-basis: 26px;
    font-size: 12px;
  }

  .user-nav {
    margin-left: auto;
    gap: 3px;
  }

  #logoutBtn {
    height: 27px;
    min-height: 27px;
    padding: 4px 6px;
    font-size: 8px;
  }

  .theme-toggle {
    width: 27px;
    height: 27px;
    min-width: 27px;
    flex-basis: 27px;
    font-size: 12px;
  }

  .app-main {
    padding: 12px 6px 28px;
  }

  .auth-card {
    width: 100%;
    padding: 18px 9px 16px;
    border-radius: 14px;
  }

  .auth-intro {
    margin-bottom: 16px;
  }

  .auth-eyebrow {
    font-size: 7px;
  }

  .auth-intro h2 {
    font-size: 1.15rem;
  }

  .auth-intro p {
    font-size: 9px;
  }

  .auth-tabs {
    padding: 2px;
    margin-bottom: 17px;
  }

  .auth-tab {
    min-height: 34px;
    padding: 6px 2px;
    font-size: 10px;
  }

  .form-group {
    margin-bottom: 12px;
  }

  .form-group label {
    font-size: 8px;
  }

  .form-control {
    min-height: 40px;
    padding: 8px 9px;
    font-size: 10px;
  }

  .btn {
    padding: 9px 10px;
    font-size: 10px;
  }

  .auth-footnote {
    font-size: 7px;
    gap: 5px;
  }

  .summary-card {
    padding: 11px;
  }

  .card-label {
    font-size: 8px;
  }

  .card-amount {
    font-size: 1.05rem;
  }

  .panel {
    padding: 10px;
  }

  .panel-title {
    font-size: 0.82rem;
  }

  .currency-background span {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.custom-select {
  position: relative !important;
  width: 100% !important;
  min-width: 0 !important;
}

.custom-select > select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  min-height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
  padding: 0 !important;
}

.custom-select-button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 46px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
  padding: 11px 42px 11px 14px !important;
  margin: 0 !important;
  background: rgba(20, 31, 46, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 14px !important;
  color: #f2f5fa !important;
  font-family: inherit !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
  text-align: left !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: none !important;
}

.custom-select-menu {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: calc(100% + 6px) !important;
  width: 100% !important;
  min-width: 0 !important;
  max-height: 260px !important;
  padding: 6px !important;
  margin: 0 !important;
  display: block !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  background: #162536 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45) !important;
  z-index: 9999 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-5px) !important;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease !important;
}

.custom-select.open .custom-select-menu {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
}

.custom-select-option {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 40px !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  position: relative !important;
  padding: 9px 12px !important;
  margin: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 8px !important;
  color: #e8edf5 !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  text-align: left !important;
  white-space: nowrap !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  box-shadow: none !important;
  cursor: pointer !important;
}

.custom-select-option:hover {
  background: rgba(34, 211, 238, 0.10) !important;
  color: #ffffff !important;
}

.custom-select-option.selected {
  background: rgba(34, 211, 238, 0.14) !important;
  color: #7bdcff !important;
}

.custom-select-option.selected::after {
  content: "✓" !important;
  margin-left: auto !important;
  padding-left: 10px !important;
  color: #7bdcff !important;
  font-size: 13px !important;
}

.transaction-item {
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  gap: 12px !important;
}

.transaction-info {
  min-width: 0 !important;
  width: 100% !important;
}

.transaction-description {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.transaction-meta {
  min-width: 0 !important;
  max-width: 100% !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 5px !important;
}

.transaction-meta span {
  white-space: nowrap !important;
}

.transaction-amount {
  white-space: nowrap !important;
  min-width: max-content !important;
}

.transaction-actions {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
}

@media (max-width: 640px) {
  .custom-select-button {
    min-height: 48px !important;
    font-size: 15px !important;
  }

  .custom-select-menu {
    max-height: 230px !important;
  }

  .custom-select-option {
    min-height: 42px !important;
    font-size: 14px !important;
  }

  .transaction-item {
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 7px !important;
    padding: 13px 11px !important;
  }

  .transaction-amount {
    grid-column: 2 !important;
    grid-row: 1 !important;
    font-size: 13px !important;
  }

  .transaction-actions {
    grid-column: 1 / -1 !important;
    justify-content: flex-end !important;
  }

  .transaction-description {
    font-size: 14px !important;
  }

  .transaction-meta {
    gap: 4px !important;
    font-size: 10px !important;
  }
}

@media (max-width: 430px) {
  .custom-select-button {
    min-height: 46px !important;
    padding-left: 12px !important;
    padding-right: 38px !important;
    font-size: 14px !important;
  }

  .custom-select-option {
    min-height: 40px !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
  }

  .transaction-item {
    padding: 12px 10px !important;
  }

  .transaction-description {
    font-size: 13px !important;
  }

  .transaction-amount {
    font-size: 12px !important;
  }
}

@media (max-width: 300px) {
  .app-main {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .panel {
    padding: 9px !important;
  }

  .auth-card {
    padding: 16px 8px !important;
  }

  .auth-intro h2 {
    font-size: 1rem !important;
  }

  .auth-intro p {
    font-size: 8px !important;
  }

  .form-control,
  .custom-select-button {
    min-height: 38px !important;
    font-size: 9px !important;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
  }

  .custom-select-option {
    min-height: 32px !important;
    font-size: 9px !important;
    padding: 6px 8px !important;
  }

  .panel-title {
    font-size: 0.75rem !important;
  }

  .card-label {
    font-size: 7px !important;
  }

  .card-amount {
    font-size: 0.95rem !important;
  }

  .transaction-item {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  .transaction-amount {
    grid-column: 1 !important;
    grid-row: auto !important;
    justify-self: start !important;
    font-size: 10px !important;
  }

  .transaction-actions {
    grid-column: 1 !important;
    justify-content: flex-start !important;
  }
}

@media (max-width: 640px) {
  .panel-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .panel-title {
    font-size: 1rem !important;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
  }

  .tx-count {
    flex: 0 0 auto;
    font-size: 0.7rem !important;
    padding: 4px 7px !important;
    white-space: nowrap;
  }

  .empty-state {
    padding: 32px 14px !important;
  }

  .empty-text {
    font-size: 1.05rem !important;
    line-height: 1.25 !important;
    overflow-wrap: anywhere;
  }

  .empty-subtext {
    font-size: 0.8rem !important;
    line-height: 1.45 !important;
    overflow-wrap: anywhere;
  }

  .transaction-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: start !important;
    gap: 6px 10px !important;
  }

  .transaction-info {
    min-width: 0 !important;
  }

  .transaction-description {
    font-size: 13px !important;
    line-height: 1.25 !important;
    margin-bottom: 4px !important;
  }

  .transaction-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    line-height: 1.2 !important;
  }

  .transaction-meta span {
    font-size: 9px !important;
    padding: 3px 5px !important;
  }

  .transaction-amount {
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  .transaction-actions {
    grid-column: 1 / -1 !important;
    justify-content: flex-end !important;
  }
}

@media (max-width: 300px) {
  .panel-header {
    gap: 6px !important;
  }

  .panel-title {
    font-size: 0.78rem !important;
  }

  .tx-count {
    font-size: 7px !important;
    padding: 3px 5px !important;
  }

  .empty-state {
    padding: 24px 8px !important;
  }

  .empty-text {
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
  }

  .empty-subtext {
    font-size: 0.68rem !important;
    line-height: 1.35 !important;
  }

  .transaction-description {
    font-size: 10px !important;
  }

  .transaction-meta span {
    font-size: 7px !important;
    padding: 2px 4px !important;
  }

  .transaction-amount {
    font-size: 9px !important;
  }

  .transaction-actions button {
    font-size: 8px !important;
    padding: 4px 5px !important;
  }
}

.user-greeting {
  color: var(--text-secondary) !important;
}

.form-error {
  color: #ff5555 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-align: center !important;
  margin: 8px 0 16px !important;
}

@media (max-width: 640px) {
  .header-content {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 10px !important;
    gap: 7px !important;
  }

  .brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .brand-title {
    max-width: 120px !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .user-nav {
    position: static !important;
    transform: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex: 0 0 auto !important;
    min-width: 0 !important;
    gap: 5px !important;
    margin-left: auto !important;
  }

  .user-greeting {
    display: block !important;
    max-width: 95px !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 9px !important;
    color: var(--text-secondary) !important;
  }

  #logoutBtn {
    flex: 0 0 auto !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 5px 7px !important;
    font-size: 9px !important;
    white-space: nowrap !important;
  }

  .theme-toggle {
    position: static !important;
    flex: 0 0 30px !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    transform: none !important;
    margin: 0 !important;
  }

  .auth-card {
    text-align: center !important;
  }

  .auth-intro {
    text-align: center !important;
  }

  .auth-intro h2,
  .auth-intro p,
  .auth-eyebrow {
    text-align: center !important;
  }

  .auth-tabs {
    text-align: center !important;
  }

  .auth-tab {
    text-align: center !important;
  }

  .auth-form {
    text-align: center !important;
  }

  .auth-form .form-group label {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
  }

  .forgot-link {
    text-align: center !important;
  }

  .auth-footnote {
    justify-content: center !important;
    text-align: center !important;
  }

  .form-error {
    width: 100% !important;
    text-align: center !important;
    color: #ff5555 !important;
  }
}

@media (max-width: 430px) {
  .header-content {
    padding-left: 8px !important;
    padding-right: 8px !important;
    gap: 5px !important;
  }

  .brand-title {
    max-width: 105px !important;
    font-size: 12px !important;
  }

  .user-greeting {
    max-width: 72px !important;
    font-size: 8px !important;
  }

  #logoutBtn {
    padding: 5px 6px !important;
    font-size: 8px !important;
  }

  .theme-toggle {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    flex-basis: 28px !important;
  }
}

@media (max-width: 360px) {
  .brand-title {
    max-width: 82px !important;
  }

  .user-greeting {
    max-width: 58px !important;
    font-size: 7px !important;
  }

  #logoutBtn {
    padding: 4px 5px !important;
    font-size: 7px !important;
  }

  .theme-toggle {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    flex-basis: 26px !important;
  }
}

.header-content {
  position: relative !important;
  width: 100% !important;
  max-width: 1200px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
}

.brand {
  min-width: 0 !important;
}

.user-nav {
  position: absolute !important;
  top: 50% !important;
  right: 24px !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.theme-toggle {
  position: static !important;
  transform: none !important;
  flex: 0 0 auto !important;
}

@media (max-width: 640px) {
  .header-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 10px !important;
    gap: 8px !important;
  }

  .brand {
    flex: 1 1 auto !important;
    max-width: none !important;
  }

  .brand-title {
    display: block !important;
    max-width: 145px !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 14px !important;
  }

  .user-nav {
    position: static !important;
    transform: none !important;
    margin-left: auto !important;
    flex: 0 0 auto !important;
    gap: 5px !important;
  }

  .user-greeting {
    display: none !important;
  }

  #logoutBtn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 5px 8px !important;
    font-size: 9px !important;
    white-space: nowrap !important;
  }

  .theme-toggle {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    flex: 0 0 30px !important;
  }
}

@media (max-width: 430px) {
  .header-content {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .brand-title {
    max-width: 125px !important;
    font-size: 13px !important;
  }

  #logoutBtn {
    font-size: 8px !important;
    padding: 5px 7px !important;
  }

  .theme-toggle {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    flex-basis: 28px !important;
  }
}

@media (max-width: 300px) {
  .header-content {
    padding-left: 5px !important;
    padding-right: 5px !important;
    gap: 4px !important;
  }

  .brand-title {
    display: none !important;
  }

  .brand-icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    flex-basis: 26px !important;
  }

  #logoutBtn {
    height: 26px !important;
    min-height: 26px !important;
    padding: 4px 5px !important;
    font-size: 7px !important;
  }

  .theme-toggle {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    flex-basis: 26px !important;
  }

  .summary-grid {
    grid-template-columns: 1fr !important;
  }

  .panel-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 5px !important;
  }

  .panel-title {
    font-size: 11px !important;
    min-width: 0 !important;
  }

  .tx-count {
    font-size: 7px !important;
    padding: 3px 5px !important;
  }

  .filter-group {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .filter-btn {
    font-size: 8px !important;
    padding: 5px 2px !important;
  }

  .empty-text {
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  .empty-subtext {
    font-size: 9px !important;
    line-height: 1.35 !important;
  }
}

.header-content {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 1200px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
}

.brand {
  min-width: 0 !important;
  justify-self: start !important;
}

.user-nav {
  position: static !important;
  transform: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  min-width: 0 !important;
  gap: 10px !important;
  justify-self: end !important;
}

.theme-toggle {
  position: static !important;
  transform: none !important;
  flex: 0 0 auto !important;
}

@media (max-width: 700px) {
  .header-content {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 0 12px !important;
  }

  .brand {
    min-width: 0 !important;
  }

  .brand-title {
    font-size: 14px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .user-nav {
    gap: 6px !important;
  }

  .user-greeting {
    display: none !important;
  }

  #logoutBtn {
    height: 30px !important;
    min-height: 30px !important;
    padding: 5px 8px !important;
    font-size: 9px !important;
    white-space: nowrap !important;
  }

  .theme-toggle {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    flex-basis: 30px !important;
  }
}

@media (max-width: 400px) {
  .header-content {
    padding: 0 8px !important;
  }

  .brand-title {
    font-size: 13px !important;
  }

  #logoutBtn {
    padding: 5px 6px !important;
    font-size: 8px !important;
  }

  .theme-toggle {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    flex-basis: 28px !important;
  }
}

@media (max-width: 250px) {
  .header-content {
    grid-template-columns: auto auto !important;
    padding: 0 5px !important;
  }

  .brand-title {
    display: none !important;
  }

  .user-nav {
    gap: 4px !important;
  }

  #logoutBtn {
    height: 26px !important;
    min-height: 26px !important;
    padding: 4px 5px !important;
    font-size: 7px !important;
  }

  .theme-toggle {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    flex-basis: 26px !important;
  }
}

.auth-footnote {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  width: 100% !important;
  margin-top: 18px !important;
  text-align: center !important;
}

.auth-footnote span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  font-size: 0.68rem !important;
  line-height: 1 !important;
  color: var(--text-secondary) !important;
}

.auth-footnote span + span::before {
  content: "•" !important;
  display: inline-block !important;
  margin: 0 10px !important;
  color: rgba(141, 150, 168, 0.5) !important;
}

.form-error,
#loginError,
.login-error,
.error-message {
  color: #ff5555 !important;
  text-align: center !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  margin: 8px 0 16px !important;
  width: 100% !important;
}

.toast-container {
  width: auto !important;
  max-width: 340px !important;
}

.toast {
  font-size: 14px !important;
  line-height: 1.35 !important;
  padding: 12px 15px !important;
}

@media (max-width: 640px) {
  .header-content {
    min-height: 58px !important;
    padding: 0 10px !important;
  }

  .brand {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .brand-title {
    display: block !important;
    max-width: 150px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 14px !important;
  }

  .user-nav {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-left: auto !important;
    transform: none !important;
  }

  .user-greeting {
    display: none !important;
  }

  #logoutBtn {
    width: auto !important;
    min-width: 0 !important;
    height: 30px !important;
    min-height: 30px !important;
    padding: 5px 8px !important;
    font-size: 9px !important;
    white-space: nowrap !important;
  }

  .theme-toggle {
    position: static !important;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    flex: 0 0 30px !important;
    transform: none !important;
  }

  .auth-card {
    text-align: center !important;
  }

  .auth-intro {
    text-align: center !important;
  }

  .auth-tabs {
    width: 100% !important;
  }

  .auth-tab {
    text-align: center !important;
  }

  .auth-form {
    width: 100% !important;
  }

  .form-group label {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
  }

  .forgot-link {
    text-align: center !important;
  }

  .auth-footnote {
    justify-content: center !important;
    flex-wrap: nowrap !important;
    transform: none !important;
  }

  .auth-footnote span {
    font-size: 8px !important;
  }

  .auth-footnote span + span::before {
    margin: 0 7px !important;
  }

  .toast-container {
    top: 68px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
  }

  .toast {
    width: 100% !important;
    max-width: none !important;
    font-size: 12px !important;
    padding: 10px 12px !important;
  }
}

@media (max-width: 300px) {
  .header-content {
    min-height: 52px !important;
    padding: 0 6px !important;
  }

  .brand {
    flex: 0 0 auto !important;
  }

  .brand-title {
    display: none !important;
  }

  .brand-icon {
    width: 27px !important;
    height: 27px !important;
    min-width: 27px !important;
    flex-basis: 27px !important;
  }

  .user-nav {
    gap: 4px !important;
  }

  #logoutBtn {
    height: 27px !important;
    min-height: 27px !important;
    padding: 4px 6px !important;
    font-size: 7px !important;
  }

  .theme-toggle {
    width: 27px !important;
    height: 27px !important;
    min-width: 27px !important;
    flex-basis: 27px !important;
  }

  .auth-card {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .auth-footnote {
    width: 100% !important;
  }

  .auth-footnote span {
    font-size: 6px !important;
  }

  .auth-footnote span + span::before {
    margin: 0 4px !important;
    font-size: 6px !important;
  }

  .form-error,
  #loginError,
  .login-error,
  .error-message {
    font-size: 9px !important;
    margin: 6px 0 10px !important;
  }

  .toast {
    font-size: 8px !important;
    padding: 7px 9px !important;
  }
}
@media (max-width: 640px) {
  .app-header .header-content {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "brand theme"
      "user user" !important;
    align-items: center !important;
    row-gap: 6px !important;
    min-height: 86px !important;
    padding: 8px 12px 10px !important;
  }

  .app-header .brand {
    grid-area: brand !important;
    justify-self: start !important;
    min-width: 0 !important;
  }

  .app-header .theme-toggle {
    grid-area: theme !important;
    justify-self: end !important;
  }

  .app-header .user-nav {
    grid-area: user !important;
    position: static !important;
    transform: none !important;
    justify-self: start !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .app-header .user-greeting {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 12px !important;
  }

  .app-header #logoutBtn {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 430px) {
  .app-header .header-content {
    min-height: 82px !important;
    padding: 7px 10px 9px !important;
  }

  .app-header .brand-title {
    max-width: 145px !important;
    font-size: 13px !important;
  }

  .app-header .user-greeting {
    font-size: 10px !important;
  }
}

@media (max-width: 300px) {
  .app-header .header-content {
    min-height: 76px !important;
    padding: 6px 7px 8px !important;
    row-gap: 4px !important;
  }

  .app-header .brand-title {
    max-width: 120px !important;
    font-size: 11px !important;
  }

  .app-header .user-greeting {
    font-size: 8px !important;
  }

  .app-header #logoutBtn {
    height: 27px !important;
    min-height: 27px !important;
    padding: 4px 6px !important;
    font-size: 7px !important;
  }
}

.user-nav.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .header-content {
    min-height: 92px !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: 46px 36px !important;
    align-items: center !important;
    justify-content: initial !important;
    padding: 6px 16px !important;
    gap: 0 !important;
  }

  .brand {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  .brand-title {
    display: block !important;
    max-width: 190px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 18px !important;
  }

  .theme-toggle {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
  }

  .user-nav,
  .user-nav.hidden {
    grid-column: 1 / 3 !important;
    grid-row: 2 !important;
    position: static !important;
    transform: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }

  .user-nav.hidden {
    display: none !important;
  }

  .user-greeting {
    display: block !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 14px !important;
  }

  #logoutBtn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 430px) {
  .header-content {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .brand-title {
    max-width: 165px !important;
    font-size: 17px !important;
  }

  .user-greeting {
    font-size: 13px !important;
  }
}

@media (max-width: 300px) {
  .header-content {
    min-height: 84px !important;
    grid-template-rows: 40px 34px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .brand-title {
    display: block !important;
    max-width: 120px !important;
    font-size: 14px !important;
  }

  .brand-icon {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
  }

  .user-greeting {
    font-size: 10px !important;
  }

  #logoutBtn {
    height: 28px !important;
    min-height: 28px !important;
    padding: 4px 7px !important;
    font-size: 9px !important;
  }

  .theme-toggle {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
  }
}