﻿
* ,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #edf3ff;
  --bg-soft: #e4edff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-muted: #f1f6ff;
  --border: #c5d6f2;
  --border-strong: #a8c1ea;
  --text: #10282f;
  --text-muted: #667da3;
  --primary: #2563eb;
  --primary-strong: #1e3a8a;
  --primary-soft: #dbeafe;
  --accent: #60a5fa;
  --accent-soft: #dbeafe;
  --income: #16a34a;
  --expense: #dc2626;
  --gold: #b45309;
  --partner: #be185d;
  --shared: #38bdf8;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow-sm: 0 8px 20px rgba(11, 48, 51, 0.08);
  --shadow-md: 0 14px 40px rgba(11, 48, 51, 0.12);
  --shadow-lg: 0 24px 70px rgba(11, 48, 51, 0.16);
  --font-title: 'Sora', 'Trebuchet MS', sans-serif;
  --font: 'Manrope', 'Segoe UI', Tahoma, sans-serif;
}

html {
  font-size: 15px;
  color-scheme: light;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at 10% 14%, rgba(59, 130, 246, 0.45), transparent 24%),
    radial-gradient(circle at 92% 16%, rgba(56, 189, 248, 0.34), transparent 24%),
    radial-gradient(circle at 52% 100%, rgba(30, 58, 138, 0.36), transparent 34%),
    linear-gradient(165deg, #071635 0%, #0b2454 46%, #123574 100%);
  min-height: 100vh;
  line-height: 1.45;
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 85%);
  pointer-events: none;
  z-index: -1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  background: rgba(37, 99, 235, 0.1);
  color: #1e3a8a;
  border-radius: 7px;
  padding: 0 5px;
}

.hidden {
  display: none !important;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.screen {
  display: none;
  width: 100%;
  height: 100vh;
}

.screen.active {
  display: flex;
}

#login-screen {
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.4;
  animation: loginFloat 11s ease-in-out infinite;
}

.b1 {
  width: 420px;
  height: 420px;
  background: rgba(37, 99, 235, 0.5);
  top: -140px;
  right: -120px;
}

.b2 {
  width: 300px;
  height: 300px;
  background: rgba(56, 189, 248, 0.4);
  bottom: -120px;
  left: -100px;
  animation-delay: 2.6s;
}

.b3 {
  width: 240px;
  height: 240px;
  background: rgba(56, 189, 248, 0.35);
  top: 38%;
  left: 48%;
  animation-delay: 4.6s;
}

@keyframes loginFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.08);
  }
}

.login-card {
  width: min(440px, calc(100vw - 24px));
  border-radius: 26px;
  padding: 34px 30px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: cardIn 0.45s ease-out;
}

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

.login-logo {
  margin-inline: auto;
  width: 80px;
  margin-bottom: 12px;
}

.login-logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 12px 20px rgba(37, 99, 235, 0.3));
}

.login-title {
  text-align: center;
  font-family: var(--font-title);
  font-size: 2rem;
  letter-spacing: 0.02em;
  color: #0d4d4a;
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-top: 7px;
  margin-bottom: 24px;
  font-weight: 500;
}

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

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #225c58;
  margin-bottom: 6px;
}

.form-group small {
  display: block;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.error-text {
  color: var(--expense);
  margin-top: 8px;
  text-align: center;
  font-weight: 600;
}

.login-status {
  text-align: center;
  margin-top: 10px;
  color: #356865;
  font-size: 0.87rem;
}

.login-hint {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 13px;
  border: 1px dashed rgba(37, 99, 235, 0.38);
  padding: 12px;
  background: rgba(37, 99, 235, 0.07);
  color: #2f5e5b;
  font-size: 0.84rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  padding: 11px 20px;
  min-height: 42px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 62%, #1e40af 100%);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.36);
}

.btn-secondary,
.btn-ghost {
  background: #ffffff;
  color: #365c5a;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
  filter: brightness(0.985);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
}
#dashboard-screen {
  overflow: hidden;
  align-items: stretch;
}

.sidebar {
  width: 284px;
  min-width: 284px;
  height: 100vh;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(247, 253, 251, 0.88) 100%);
  padding: 22px 16px 18px;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 10px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0.06));
  border: 1px solid rgba(37, 99, 235, 0.22);
  overflow: hidden;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
  display: block;
}

.sidebar-brand {
  font-family: var(--font-title);
  font-size: 1.2rem;
  letter-spacing: 0.03em;
  color: #0f5f59;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-family: var(--font-title);
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 8px 14px rgba(37, 99, 235, 0.24);
  overflow: hidden;
  position: relative;
}

.user-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
  opacity: 0;
}

.user-avatar.has-image {
  color: transparent;
}

.user-avatar.has-image img {
  opacity: 1;
}

.telegram-photo-avatar {
  position: relative;
  overflow: hidden;
}

.telegram-photo-avatar .avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
  opacity: 0;
}

.telegram-photo-avatar.has-image {
  color: transparent !important;
}

.telegram-photo-avatar.has-image .avatar-photo {
  opacity: 1;
}

.user-info {
  min-width: 0;
}

.user-name {
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.user-premium-badge {
  display: inline-flex;
  margin-top: 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.user-premium-badge.premium {
  color: #854d0e;
  background: #fff1cc;
  border-color: #f6d382;
}

.user-premium-badge.free {
  color: #425866;
  background: #e7eef5;
  border-color: #c8d4e0;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.35);
  border-radius: 999px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border-radius: 12px;
  text-decoration: none;
  color: #486766;
  padding: 8px 11px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-item:hover {
  background: rgba(37, 99, 235, 0.11);
  color: #0d5a54;
}

.nav-item.active {
  color: #0b4f4a;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.24), rgba(37, 99, 235, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.24);
  box-shadow: 0 8px 14px rgba(37, 99, 235, 0.16);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 7px;
  bottom: 7px;
  width: 4px;
  border-radius: 999px;
  background: #2563eb;
}

.nav-icon {
  width: 22px;
  display: inline-flex;
  justify-content: center;
  font-size: 1rem;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: grid;
  gap: 10px;
}

.month-selector {
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  gap: 7px;
  align-items: center;
}

.month-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #ffffff;
  color: #315f5c;
  font-size: 1rem;
  cursor: pointer;
}

.month-btn:hover {
  background: var(--primary-soft);
  color: #0a4f49;
}

#current-month-label {
  font-size: 0.8rem;
  text-align: center;
  font-weight: 700;
  text-transform: capitalize;
  color: #255753;
}

.main-content {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 28px 28px 34px;
  scrollbar-gutter: stable;
}

.main-content::-webkit-scrollbar {
  width: 9px;
}

.main-content::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 999px;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: pageFade 0.28s ease;
}

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

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

.page-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-size: clamp(1.18rem, 2.2vw, 1.62rem);
  letter-spacing: 0.02em;
  color: #0c4744;
}

.month-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 5px 10px;
  font-weight: 700;
  color: #145e58;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select,
.edit-modal-input,
.edit-modal-select {
  background: #ffffff;
  border: 1px solid var(--border);
  color: #244e4b;
  border-radius: 10px;
  min-height: 38px;
  padding: 8px 12px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-select {
  min-width: 148px;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath fill='none' stroke='%23607a78' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4.5 5L10 1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}

.filter-select:focus,
.edit-modal-input:focus,
.edit-modal-select:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.filter-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #3f6662;
  font-size: 0.82rem;
  font-weight: 700;
  user-select: none;
  cursor: pointer;
}

.toggle-label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-slider {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(120, 141, 144, 0.25);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s ease;
}

.toggle-label input:checked + .toggle-slider {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.5);
}

.toggle-label input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.toggle-label.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.toggle-label.is-loading .toggle-slider::after {
  content: '';
  position: absolute;
  right: 5px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-right-color: transparent;
  animation: spinTiny 0.68s linear infinite;
}

@keyframes spinTiny {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

.card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.95), rgba(247, 252, 250, 0.9));
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.1);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.card-content {
  min-width: 0;
}

.card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 800;
}

.card-value {
  margin-top: 3px;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 800;
  color: #0c4642;
  word-break: break-word;
}

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

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

.card-net .card-value {
  color: var(--gold);
}

.card-total .card-value {
  color: var(--primary);
}

.card-partner .card-value {
  color: var(--partner);
}

.card-shared .card-value {
  color: var(--shared);
}

.card-income .card-icon {
  background: rgba(22, 163, 74, 0.14);
}

.card-expense .card-icon {
  background: rgba(220, 38, 38, 0.13);
}

.card-net .card-icon {
  background: rgba(180, 83, 9, 0.14);
}

.card-total .card-icon {
  background: rgba(37, 99, 235, 0.13);
}

.card-partner .card-icon {
  background: rgba(190, 24, 93, 0.12);
}

.card-shared .card-icon {
  background: rgba(56, 189, 248, 0.12);
}
.section-card,
.chart-card {
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.section-card {
  padding: 18px;
  margin-bottom: 16px;
}

.chart-card {
  padding: 16px 18px;
}

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

.section-header h3,
.chart-card h3 {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: #154f4b;
  letter-spacing: 0.02em;
}

.link-action {
  font-size: 0.82rem;
  color: #2e6a66;
  font-weight: 700;
  text-decoration: none;
}

.link-action:hover {
  color: #0a4f4a;
}

.wallet-focus-card {
  background:
    linear-gradient(160deg, rgba(216, 239, 233, 0.54), rgba(255, 255, 255, 0.9));
}

.wallet-focus-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.wallet-focus-controls .filter-select {
  flex: 1;
  min-width: 210px;
}

.wallet-focus-select {
  background-color: #f6fffc;
}

.wallet-focus-amount {
  font-family: var(--font-title);
  font-size: clamp(1.3rem, 2.8vw, 1.8rem);
  color: #0a4f49;
  margin-bottom: 4px;
}

.wallet-focus-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.wallet-focus-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wallet-focus-chip {
  border: 1px solid var(--border);
  background: #ffffff;
  color: #315e5b;
  border-radius: 999px;
  min-height: 34px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
}

.wallet-focus-chip strong {
  color: #0f5f59;
  font-size: 0.75rem;
}

.wallet-focus-chip:hover {
  border-color: rgba(37, 99, 235, 0.4);
}

.wallet-focus-chip.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.08));
  border-color: rgba(37, 99, 235, 0.42);
  color: #0d544f;
}

.wallet-focus-chip.partner {
  border-color: rgba(190, 24, 93, 0.28);
}

.wallet-focus-chip.shared {
  border-color: rgba(56, 189, 248, 0.3);
}

.wallet-focus-chip.all {
  border-style: dashed;
}

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

.chart-wrap {
  position: relative;
  height: 240px;
}

#trendChart {
  max-height: 360px;
}

.budget-strip-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.budget-strip-item {
  border-radius: 13px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 10px;
}

.bsi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #265f5b;
  font-weight: 700;
  font-size: 0.82rem;
}

.bsi-bar-bg,
.budget-bar-bg {
  width: 100%;
  border-radius: 999px;
  background: #e6f0ed;
  height: 9px;
  margin-top: 8px;
  overflow: hidden;
}

.bsi-bar-fill,
.budget-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s ease;
}

.bsi-amounts {
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  color: #2f5f5c;
  font-size: 0.78rem;
  font-weight: 700;
}

.bsi-amounts span {
  color: var(--text-muted);
  font-weight: 600;
}

.strip-empty,
.loading-state,
.empty-state {
  text-align: center;
  border: 1px dashed var(--border-strong);
  background: #f8fcfb;
  border-radius: 14px;
  color: var(--text-muted);
}

.strip-empty,
.loading-state {
  padding: 16px;
  font-size: 0.88rem;
}

.loading-state {
  font-weight: 700;
  color: #2b5e5b;
}

.empty-state {
  padding: 28px 16px;
}

.empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.premium-help-card {
  overflow: hidden;
}

.premium-ad-box {
  position: relative;
  min-height: 210px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.premium-ad-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.premium-ad-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(122deg, rgba(6, 24, 32, 0.9) 8%, rgba(8, 36, 42, 0.66) 54%, rgba(11, 48, 51, 0.36) 100%),
    radial-gradient(circle at 90% 14%, rgba(59, 130, 246, 0.42), transparent 36%);
}

.premium-ad-content {
  position: relative;
  z-index: 1;
  color: #effeff;
  max-width: 620px;
  padding: 18px;
}

.premium-ad-title {
  font-family: var(--font-title);
  font-size: clamp(1rem, 2.1vw, 1.5rem);
  margin-bottom: 5px;
}

.premium-status-line {
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #d4f4f2;
}

.premium-free-info {
  font-size: 0.78rem;
  color: #d5eceb;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  padding: 8px;
  margin-bottom: 10px;
}

.premium-ad-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.premium-ad-points span {
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 9px;
}

.premium-upgrade-btn {
  min-height: 38px;
  padding-inline: 18px;
}

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

.tx-item {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 11px;
  background: #ffffff;
}

.tx-type-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f0f7f4;
}

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

.tx-desc {
  font-size: 0.87rem;
  font-weight: 700;
  color: #133f3d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  margin-top: 2px;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-amount {
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}

.tx-amount.income,
.income,
.income-color {
  color: var(--income);
}

.tx-amount.expense,
.expense,
.expense-color {
  color: var(--expense);
}

.tx-stats-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 11px;
}

.tx-stat {
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #395f5d;
}
.tx-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  font-size: 0.84rem;
}

.tx-table th,
.tx-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #e8efec;
  vertical-align: middle;
}

.tx-table thead th {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.68rem;
  color: #567170;
  background: #f5fbf9;
  position: sticky;
  top: 0;
  z-index: 1;
}

.tx-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.05);
}

.tx-table tbody tr:last-child td {
  border-bottom: none;
}

@keyframes txRowFlash {
  from {
    box-shadow: inset 0 0 0 999px rgba(22, 163, 74, 0.24);
  }
  to {
    box-shadow: inset 0 0 0 999px rgba(22, 163, 74, 0.06);
  }
}

.tx-table tbody tr.tx-row-highlight {
  animation: txRowFlash 2s ease;
}

.tx-table .td-date {
  width: 180px;
  color: var(--text-muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.tx-table .td-desc {
  max-width: 280px;
}

.tx-desc-text {
  font-weight: 700;
  color: #153f3d;
}

.tx-table .td-cat {
  width: 210px;
}

.tx-cat-main {
  display: block;
  font-weight: 700;
  color: #234f4c;
}

.tx-cat-wallet {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.73rem;
}

.tx-table .td-owner {
  width: 110px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.tx-table .td-type {
  width: 88px;
}

.tx-table .td-amt {
  width: 150px;
  font-weight: 800;
  white-space: nowrap;
}

.tx-table .tx-actions,
.tx-actions {
  width: 72px;
  white-space: nowrap;
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0 9px;
  border: 1px solid transparent;
}

.badge-income {
  color: #166534;
  background: #ddf8e7;
  border-color: #b5efca;
}

.badge-expense {
  color: #991b1b;
  background: #ffe2e2;
  border-color: #ffc5c5;
}

.text-right {
  text-align: right !important;
}

.tx-btn-edit,
.tx-btn-del,
.tx-btn-save,
.tx-btn-cancel {
  border: 1px solid transparent;
  background: transparent;
  color: #3d5f5c;
  border-radius: 8px;
  min-width: 30px;
  min-height: 30px;
  cursor: pointer;
  font-size: 1rem;
}

.tx-btn-edit:hover,
.tx-btn-save:hover {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.26);
}

.tx-btn-del:hover,
.tx-btn-cancel:hover {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.24);
}

#tx-table-body tr {
  transition: opacity 0.24s ease;
}

#tx-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.edit-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 28, 30, 0.46);
  backdrop-filter: blur(4px);
}

.edit-modal-box {
  position: relative;
  width: min(440px, 100%);
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  animation: modalIn 0.24s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.edit-modal-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: #104643;
  margin-bottom: 10px;
}

.edit-modal-label {
  display: block;
  margin-top: 11px;
  margin-bottom: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4f6c6a;
  font-weight: 800;
}

.edit-modal-label:first-of-type {
  margin-top: 0;
}

.edit-modal-actions {
  display: flex;
  gap: 9px;
  margin-top: 15px;
}

.edit-modal-actions .btn {
  flex: 1;
}

.wallets-grid,
.wallets-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.wallets-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #3f6462;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.76rem;
  font-weight: 800;
}

.section-total {
  font-size: 0.94rem;
  text-transform: none;
  letter-spacing: normal;
  color: #0b4642;
}

.wallet-card {
  position: relative;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.wallet-card:hover {
  transform: translateY(-2px);
}

.wallet-header {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wallet-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.1);
  font-size: 1rem;
}

.wallet-name {
  font-weight: 800;
  color: #113e3c;
}

.wallet-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wallet-balance {
  margin-top: 10px;
  font-family: var(--font-title);
  font-size: 1.15rem;
  color: #0d4a46;
}

.wallet-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
}

.wallet-badge {
  display: inline-flex;
  margin-top: 6px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 800;
  padding: 3px 10px;
}

.wallet-badge.mine {
  color: #145e58;
  background: rgba(37, 99, 235, 0.15);
}

.wallet-badge.partner {
  color: #831843;
  background: rgba(190, 24, 93, 0.13);
}

.wallet-badge.shared {
  color: #0f5f59;
  background: rgba(56, 189, 248, 0.15);
}

.wallet-card-partner {
  border-color: rgba(190, 24, 93, 0.25) !important;
}

.wallet-card-shared {
  border-color: rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 12px 26px rgba(56, 189, 248, 0.16) !important;
}

.wallet-toggle-hint {
  margin-top: 14px;
  border-style: dashed;
  color: #3a5f5c;
}
.budget-list,
.goals-list {
  display: grid;
  gap: 11px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.budget-card,
.goal-card {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 12px;
}

.budget-card-header,
.goal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.budget-cat,
.goal-icon-name {
  font-weight: 800;
  color: #174a47;
}

.budget-status,
.goal-pct {
  font-size: 0.8rem;
  font-weight: 800;
}

.budget-amounts,
.goal-stats,
.goal-footer {
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.79rem;
  color: #496968;
}

.goal-footer {
  border-top: 1px dashed #d7e5e2;
  padding-top: 8px;
}

.budget-alert {
  margin-top: 8px;
  border-radius: 10px;
  padding: 8px;
  background: #ffe5e5;
  border: 1px solid #ffc5c5;
  color: #991b1b;
  font-size: 0.79rem;
  font-weight: 700;
}

.budget-remaining {
  margin-top: 8px;
  border-radius: 10px;
  padding: 8px;
  background: #e6f7ed;
  border: 1px solid #bfe8cd;
  color: #166534;
  font-size: 0.79rem;
  font-weight: 700;
}

.budget-ok {
  border-left: 4px solid #16a34a;
}

.budget-warn {
  border-left: 4px solid #d97706;
}

.budget-over {
  border-left: 4px solid #dc2626;
}

.deadline-urgent {
  color: #b91c1c;
  font-weight: 800;
}

.goals-section-title {
  margin-bottom: 8px;
  font-family: var(--font-title);
  color: #0f504b;
  font-size: 0.95rem;
}

.goal-completed {
  background: linear-gradient(140deg, rgba(22, 163, 74, 0.09), rgba(255, 255, 255, 0.94));
  border-color: rgba(22, 163, 74, 0.36);
}

.no-partner-card {
  text-align: center;
  padding-block: 32px;
}

.np-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

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

.partner-card {
  border-radius: 15px;
  padding: 16px;
  border: 1px solid var(--border);
}

.partner-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.partner-card-name {
  font-family: var(--font-title);
  color: #0f4f4b;
  margin-bottom: 8px;
}

.partner-stats {
  display: grid;
  gap: 8px;
}

.partner-stat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.75);
  padding: 7px 9px;
  font-size: 0.8rem;
}

.partner-stat-label {
  color: #486968;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(460px, calc(100vw - 26px));
  border-radius: 12px;
  padding: 10px 14px;
  background: #2563eb;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: var(--shadow-md);
  z-index: 2100;
  font-weight: 700;
  animation: toastIn 0.22s ease;
}

.toast.is-error {
  background: #dc2626;
}

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

.audit-list {
  display: flex;
  flex-direction: column;
}

.audit-row {
  display: flex;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #e6efec;
}

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

.audit-row:hover {
  background: rgba(37, 99, 235, 0.06);
  border-radius: 11px;
}

.audit-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.12);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}

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

.audit-summary {
  font-size: 0.88rem;
  color: #214f4b;
  line-height: 1.5;
  word-break: break-word;
}

.audit-time {
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.audit-actor {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.73rem;
  font-weight: 800;
  margin-right: 5px;
}

.audit-actor-me {
  background: rgba(37, 99, 235, 0.13);
  color: #0b5a54;
}

.audit-actor-partner {
  background: rgba(190, 24, 93, 0.14);
  color: #831843;
}

.hamburger {
  position: fixed;
  top: 14px;
  left: 14px;
  width: 42px;
  height: 42px;
  z-index: 250;
  display: none;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #24524f;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 32, 33, 0.34);
  backdrop-filter: blur(2px);
  display: none;
  z-index: 180;
}

.sidebar-overlay.active {
  display: block;
}

:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.58);
  outline-offset: 2px;
}
@media (max-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    width: 254px;
    min-width: 254px;
  }
}

@media (max-width: 980px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }

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

  .main-content {
    padding-inline: 18px;
  }
}

@media (max-width: 768px) {
  body {
    overflow-y: auto;
    overflow-x: hidden;
  }

  #dashboard-screen {
    overflow: visible;
    min-height: 100vh;
  }

  .hamburger {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: -270px;
    top: 0;
    height: 100vh;
    z-index: 200;
    transition: left 0.24s ease;
    width: 250px;
    min-width: 250px;
  }

  .sidebar.open {
    left: 0;
  }

  .main-content {
    width: 100%;
    min-height: 100vh;
    height: auto;
    overflow: visible;
    padding: 66px 12px 24px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .filter-select {
    flex: 1;
    min-width: 130px;
  }

  .wallet-focus-controls .filter-select {
    min-width: 100%;
  }

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

  .card {
    padding: 12px;
  }

  .card-icon {
    width: 38px;
    height: 38px;
  }

  .chart-wrap {
    height: 210px;
  }

  .premium-ad-box {
    min-height: 190px;
  }

  .premium-ad-content {
    padding: 12px;
  }

  .budget-strip-list,
  .budget-list,
  .goals-list {
    grid-template-columns: 1fr;
  }

  .wallets-grid,
  .wallets-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tx-table {
    min-width: 100%;
  }

  .tx-table thead {
    display: none;
  }

  .tx-table,
  .tx-table tbody {
    display: block;
  }

  .tx-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'desc amt'
      'meta type'
      'empty actions';
    gap: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 8px;
    padding: 10px;
    background: #ffffff;
  }

  .tx-table td {
    border-bottom: 0;
    padding: 2px 0;
  }

  .tx-table .td-date,
  .tx-table .td-owner {
    display: none;
  }

  .tx-table .td-desc {
    grid-area: desc;
    max-width: none;
  }

  .tx-table .td-cat {
    grid-area: meta;
    width: auto;
  }

  .tx-table .td-type {
    grid-area: type;
    width: auto;
    justify-self: end;
  }

  .tx-table .td-amt {
    grid-area: amt;
    width: auto;
    justify-self: end;
  }

  .tx-table .tx-actions {
    grid-area: actions;
    width: auto;
    justify-self: end;
  }

  .tx-table-wrapper {
    border: 0;
    background: transparent;
  }

  .edit-modal-box {
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }

  #tx-edit-modal {
    align-items: flex-end;
    padding: 0;
  }

  .toast {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }
}

@media (max-width: 520px) {
  .cards-grid,
  .wallets-grid,
  .wallets-section-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 24px 18px;
  }

  .login-title {
    font-size: 1.72rem;
  }

  .login-logo,
  .login-logo img {
    width: 68px;
    height: 68px;
  }

  .page-header h2 {
    font-size: 1.08rem;
  }

  .btn-sm {
    min-height: 33px;
    padding-inline: 10px;
  }

  .tx-stat {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================================
   Deep Ocean Theme (Unified Override)
   ============================================================= */
:root {
  --bg: #040f2b;
  --bg-soft: #08183d;
  --surface: rgba(8, 20, 52, 0.78);
  --surface-solid: #0a1f4f;
  --surface-muted: #0f2a63;
  --border: rgba(140, 176, 235, 0.24);
  --border-strong: rgba(140, 176, 235, 0.42);
  --text: #e8f2ff;
  --text-muted: #a8c0e4;
  --primary: #60a5fa;
  --primary-strong: #2563eb;
  --primary-soft: rgba(96, 165, 250, 0.22);
  --accent: #67e8f9;
  --accent-soft: rgba(103, 232, 249, 0.22);
  --income: #4ade80;
  --expense: #fb7185;
  --gold: #fbbf24;
  --partner: #f9a8d4;
  --shared: #67e8f9;
  --shadow-sm: 0 10px 30px rgba(3, 9, 28, 0.45);
  --shadow-md: 0 20px 52px rgba(3, 9, 28, 0.55);
  --shadow-lg: 0 30px 80px rgba(3, 9, 28, 0.62);
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 14% 12%, rgba(59, 130, 246, 0.34), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(103, 232, 249, 0.24), transparent 30%),
    radial-gradient(circle at 55% 100%, rgba(37, 99, 235, 0.36), transparent 36%),
    linear-gradient(165deg, #030b1f 0%, #071736 45%, #0b2454 100%);
}

body::before {
  background-image:
    linear-gradient(to right, rgba(147, 173, 224, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(147, 173, 224, 0.08) 1px, transparent 1px);
  opacity: 0.7;
}

code {
  background: rgba(96, 165, 250, 0.2);
  color: #cde0ff;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

#login-screen {
  background:
    radial-gradient(circle at 18% 24%, rgba(56, 189, 248, 0.24), transparent 36%),
    radial-gradient(circle at 86% 12%, rgba(96, 165, 250, 0.28), transparent 40%);
}

.login-card {
  background: linear-gradient(160deg, rgba(10, 28, 67, 0.88), rgba(9, 23, 56, 0.82));
}

.login-title,
.sidebar-brand,
.page-header h2,
.section-header h3,
.chart-card h3,
.partner-card-name,
.edit-modal-title,
.wallet-focus-amount {
  color: #eaf3ff;
}

.login-subtitle,
.login-status,
.form-group small,
.form-group label,
.login-hint,
.user-tag,
.card-label,
.tx-meta,
.wallet-type,
.wallet-focus-meta,
.partner-stat-label,
.audit-time,
.empty-state,
.loading-state,
.strip-empty {
  color: var(--text-muted);
}

.login-hint {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(125, 173, 248, 0.45);
}

.btn-primary {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 62%, #1d4ed8 100%);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.42);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.54);
}

.btn-secondary,
.btn-ghost {
  background: rgba(18, 42, 92, 0.7);
  color: #d4e4ff;
  border-color: rgba(140, 176, 235, 0.35);
}

.btn-secondary:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) {
  filter: brightness(1.08);
}

.sidebar {
  background: linear-gradient(180deg, rgba(8, 20, 52, 0.96) 0%, rgba(7, 18, 46, 0.92) 100%);
  border-right-color: rgba(140, 176, 235, 0.3);
}

.sidebar-logo {
  background: linear-gradient(145deg, rgba(96, 165, 250, 0.3), rgba(56, 189, 248, 0.18));
  border-color: rgba(145, 191, 255, 0.4);
}

.sidebar-user,
.card,
.section-card,
.chart-card,
.wallet-card,
.tx-item,
.budget-strip-item,
.budget-card,
.goal-card,
.tx-table-wrapper,
.tx-stat,
.partner-stat,
.edit-modal-box {
  background: linear-gradient(165deg, rgba(11, 30, 72, 0.86), rgba(10, 24, 58, 0.82));
  border-color: rgba(138, 175, 235, 0.28);
  box-shadow: var(--shadow-sm);
}

.main-content {
  background:
    radial-gradient(circle at 92% 2%, rgba(56, 189, 248, 0.12), transparent 30%),
    radial-gradient(circle at 0% 80%, rgba(96, 165, 250, 0.12), transparent 32%);
}

.nav-item {
  color: #b9cff0;
}

.nav-item:hover {
  color: #e4efff;
  background: rgba(96, 165, 250, 0.18);
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.35), rgba(37, 99, 235, 0.3));
  border-color: rgba(140, 176, 235, 0.55);
  box-shadow: 0 12px 24px rgba(10, 27, 67, 0.45);
}

.nav-item.active::before {
  background: #7cc4ff;
}

.month-btn,
.filter-select,
.edit-modal-input,
.edit-modal-select {
  background: rgba(15, 38, 88, 0.86);
  color: #dbebff;
  border-color: rgba(140, 176, 235, 0.38);
}

.filter-select,
.edit-modal-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath fill='none' stroke='%23b8d3f8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4.5 5L10 1'/%3E%3C/svg%3E");
}

.filter-select option,
.edit-modal-select option {
  background: #0d265f;
  color: #e8f2ff;
}

.filter-select:focus,
.edit-modal-input:focus,
.edit-modal-select:focus,
.month-btn:hover {
  border-color: rgba(125, 176, 248, 0.75);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.toggle-label {
  color: #b8cef0;
}

.toggle-slider {
  border-color: rgba(140, 176, 235, 0.45);
  background: rgba(64, 93, 148, 0.6);
}

.toggle-label input:checked + .toggle-slider {
  border-color: rgba(125, 176, 248, 0.75);
  background: rgba(96, 165, 250, 0.62);
}

.card {
  border-color: rgba(140, 176, 235, 0.3);
}

.card::after {
  background: linear-gradient(90deg, rgba(103, 232, 249, 0), rgba(96, 165, 250, 0.55), rgba(103, 232, 249, 0));
}

.card-icon,
.tx-type-icon,
.wallet-icon {
  background: rgba(96, 165, 250, 0.2);
}

.card-value,
.tx-desc,
.tx-desc-text,
.wallet-name,
.wallet-balance,
.section-total,
.budget-cat,
.goal-icon-name,
.audit-summary,
.tx-table td,
.tx-table th,
.tx-stat,
#current-month-label {
  color: var(--text);
}

.month-badge {
  color: #d8e9ff;
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(140, 176, 235, 0.42);
}

.link-action {
  color: #7bc8ff;
}

.link-action:hover {
  color: #b8e5ff;
}

.wallet-focus-card {
  background: linear-gradient(165deg, rgba(12, 33, 78, 0.86), rgba(11, 27, 64, 0.84));
}

.wallet-focus-chip {
  background: rgba(14, 35, 82, 0.82);
  border-color: rgba(140, 176, 235, 0.42);
  color: #d8e7ff;
}

.wallet-focus-chip strong {
  color: #e8f4ff;
}

.wallet-focus-chip.active {
  background: linear-gradient(135deg, rgba(103, 232, 249, 0.18), rgba(96, 165, 250, 0.26));
  border-color: rgba(125, 176, 248, 0.7);
}

.premium-ad-overlay {
  background:
    linear-gradient(122deg, rgba(5, 16, 40, 0.92) 8%, rgba(8, 28, 69, 0.76) 54%, rgba(11, 37, 90, 0.5) 100%),
    radial-gradient(circle at 90% 14%, rgba(103, 232, 249, 0.45), transparent 36%);
}

.tx-table {
  background: transparent;
}

.tx-table thead th {
  background: rgba(15, 38, 88, 0.9);
  color: #d5e7ff;
  border-bottom-color: rgba(140, 176, 235, 0.28);
}

.tx-table th,
.tx-table td {
  border-bottom-color: rgba(140, 176, 235, 0.16);
}

.tx-table tbody tr:hover,
.audit-row:hover {
  background: rgba(96, 165, 250, 0.14);
}

.badge-income {
  color: #d1ffe0;
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(74, 222, 128, 0.42);
}

.badge-expense {
  color: #ffdbe2;
  background: rgba(244, 63, 94, 0.24);
  border-color: rgba(251, 113, 133, 0.42);
}

.edit-modal-backdrop {
  background: rgba(2, 8, 22, 0.7);
}

.edit-modal-box {
  background: linear-gradient(165deg, rgba(10, 25, 60, 0.95), rgba(9, 21, 50, 0.93));
}

.edit-modal-label {
  color: #b4cbef;
}

.wallet-badge.mine {
  color: #dcecff;
  background: rgba(96, 165, 250, 0.28);
}

.wallet-badge.partner {
  color: #ffe0f0;
  background: rgba(190, 24, 93, 0.28);
}

.wallet-badge.shared {
  color: #def7ff;
  background: rgba(56, 189, 248, 0.26);
}

.bsi-bar-bg,
.budget-bar-bg {
  background: rgba(132, 166, 220, 0.24);
}

.budget-alert {
  background: rgba(244, 63, 94, 0.22);
  border-color: rgba(251, 113, 133, 0.44);
  color: #ffdce3;
}

.budget-remaining {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(74, 222, 128, 0.4);
  color: #dcffe8;
}

.empty-state,
.loading-state,
.strip-empty {
  background: rgba(11, 32, 78, 0.72);
  border-color: rgba(140, 176, 235, 0.36);
}

.toast {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  border-color: rgba(182, 209, 255, 0.5);
}

.toast.is-error {
  background: linear-gradient(135deg, #be123c, #7f1d1d);
}

.audit-row {
  border-bottom-color: rgba(140, 176, 235, 0.15);
}

.audit-icon {
  background: rgba(96, 165, 250, 0.24);
}

.audit-actor-me {
  background: rgba(96, 165, 250, 0.24);
  color: #dcecff;
}

.audit-actor-partner {
  background: rgba(244, 114, 182, 0.22);
  color: #ffe6f4;
}

.hamburger {
  background: rgba(10, 24, 58, 0.92);
  border-color: rgba(140, 176, 235, 0.36);
}

.hamburger span {
  background: #cfe2ff;
}

.sidebar-overlay {
  background: rgba(2, 8, 22, 0.6);
}

:focus-visible {
  outline-color: rgba(125, 176, 248, 0.85);
}

@media (max-width: 768px) {
  .tx-table tr {
    background: rgba(10, 26, 62, 0.92);
    border-color: rgba(140, 176, 235, 0.3);
  }
}

/* =============================================================
   Global Light/Dark Theme System
   ============================================================= */
:root {
  --ui-page-bg:
    radial-gradient(circle at 8% 12%, rgba(15, 118, 110, 0.16), transparent 24%),
    radial-gradient(circle at 92% 18%, rgba(234, 88, 12, 0.14), transparent 22%),
    radial-gradient(circle at 52% 100%, rgba(10, 89, 84, 0.12), transparent 30%),
    linear-gradient(160deg, #f4faf8 0%, #ecf5f2 55%, #e8f1ee 100%);
  --ui-grid-color: rgba(17, 75, 78, 0.04);
  --ui-grid-opacity: 1;
  --ui-text: #10282f;
  --ui-muted: #3f5a6b;
  --ui-surface: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(246, 250, 255, 0.92));
  --ui-border: rgba(123, 157, 205, 0.24);
  --ui-border-strong: rgba(123, 157, 205, 0.45);
  --ui-shadow: 0 12px 30px rgba(11, 48, 51, 0.12);
  --ui-primary-grad: linear-gradient(135deg, #0f766e 0%, #0b5d56 62%, #075e56 100%);
  --ui-primary-glow: rgba(15, 118, 110, 0.36);
  --ui-secondary-bg: rgba(255, 255, 255, 0.92);
  --ui-secondary-text: #365c5a;
  --ui-nav-text: #486766;
  --ui-nav-hover-bg: rgba(15, 118, 110, 0.11);
  --ui-nav-hover-text: #0d5a54;
  --ui-nav-active-text: #0b4f4a;
  --ui-nav-active-bg: linear-gradient(90deg, rgba(15, 118, 110, 0.24), rgba(15, 118, 110, 0.08));
  --ui-nav-active-border: rgba(15, 118, 110, 0.24);
  --ui-nav-rail: #0f766e;
  --ui-input-bg: rgba(255, 255, 255, 0.9);
  --ui-input-text: #244e4b;
  --ui-input-border: rgba(123, 157, 205, 0.36);
  --ui-focus-ring: rgba(15, 118, 110, 0.18);
  --ui-table-head-bg: rgba(238, 247, 252, 0.95);
  --ui-table-head-text: #496969;
  --ui-table-divider: rgba(108, 141, 174, 0.22);
  --ui-pill-bg: rgba(15, 118, 110, 0.14);
  --ui-pill-text: #145e58;
  --ui-link: #2e6a66;
  --ui-link-hover: #0a4f4a;
  --ui-chip-bg: rgba(255, 255, 255, 0.9);
  --ui-chip-border: rgba(123, 157, 205, 0.42);
  --ui-chip-active-bg: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(15, 118, 110, 0.08));
  --ui-chip-active-border: rgba(15, 118, 110, 0.42);
  --ui-chip-amount: #1f3f5c;
  --ui-tx-subtle: #4e6576;
  --ui-badge-income-text: #166534;
  --ui-badge-income-bg: #ddf8e7;
  --ui-badge-income-border: #b5efca;
  --ui-badge-expense-text: #991b1b;
  --ui-badge-expense-bg: #ffe2e2;
  --ui-badge-expense-border: #ffc5c5;
  --ui-premium-overlay:
    linear-gradient(122deg, rgba(6, 24, 32, 0.9) 8%, rgba(8, 36, 42, 0.66) 54%, rgba(11, 48, 51, 0.36) 100%),
    radial-gradient(circle at 90% 14%, rgba(234, 88, 12, 0.42), transparent 36%);
  --ui-toast-bg: linear-gradient(135deg, #0f766e, #0b5d56);
  --ui-toast-border: rgba(255, 255, 255, 0.42);
  --ui-hamburger-bg: rgba(255, 255, 255, 0.95);
  --ui-hamburger-line: #24524f;
  --ui-empty-bg: linear-gradient(165deg, rgba(255, 255, 255, 0.92), rgba(237, 245, 255, 0.9));
  --ui-empty-border: rgba(123, 157, 205, 0.45);
  --ui-empty-text: #2f4654;
}

body[data-theme='dark'] {
  --ui-page-bg:
    radial-gradient(circle at 14% 12%, rgba(59, 130, 246, 0.34), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(103, 232, 249, 0.24), transparent 30%),
    radial-gradient(circle at 55% 100%, rgba(37, 99, 235, 0.36), transparent 36%),
    linear-gradient(165deg, #030b1f 0%, #071736 45%, #0b2454 100%);
  --ui-grid-color: rgba(147, 173, 224, 0.08);
  --ui-grid-opacity: 0.7;
  --ui-text: #e8f2ff;
  --ui-muted: #a8c0e4;
  --ui-surface: linear-gradient(165deg, rgba(11, 30, 72, 0.88), rgba(10, 24, 58, 0.84));
  --ui-border: rgba(140, 176, 235, 0.28);
  --ui-border-strong: rgba(140, 176, 235, 0.5);
  --ui-shadow: 0 16px 36px rgba(3, 9, 28, 0.5);
  --ui-primary-grad: linear-gradient(135deg, #60a5fa 0%, #2563eb 62%, #1d4ed8 100%);
  --ui-primary-glow: rgba(37, 99, 235, 0.54);
  --ui-secondary-bg: rgba(18, 42, 92, 0.72);
  --ui-secondary-text: #d4e4ff;
  --ui-nav-text: #b9cff0;
  --ui-nav-hover-bg: rgba(96, 165, 250, 0.18);
  --ui-nav-hover-text: #e4efff;
  --ui-nav-active-text: #ffffff;
  --ui-nav-active-bg: linear-gradient(90deg, rgba(96, 165, 250, 0.35), rgba(37, 99, 235, 0.3));
  --ui-nav-active-border: rgba(140, 176, 235, 0.55);
  --ui-nav-rail: #7cc4ff;
  --ui-input-bg: rgba(15, 38, 88, 0.86);
  --ui-input-text: #dbebff;
  --ui-input-border: rgba(140, 176, 235, 0.4);
  --ui-focus-ring: rgba(96, 165, 250, 0.22);
  --ui-table-head-bg: rgba(15, 38, 88, 0.92);
  --ui-table-head-text: #d5e7ff;
  --ui-table-divider: rgba(140, 176, 235, 0.18);
  --ui-pill-bg: rgba(96, 165, 250, 0.2);
  --ui-pill-text: #d8e9ff;
  --ui-link: #7bc8ff;
  --ui-link-hover: #b8e5ff;
  --ui-chip-bg: rgba(14, 35, 82, 0.82);
  --ui-chip-border: rgba(140, 176, 235, 0.44);
  --ui-chip-active-bg: linear-gradient(135deg, rgba(103, 232, 249, 0.18), rgba(96, 165, 250, 0.26));
  --ui-chip-active-border: rgba(125, 176, 248, 0.7);
  --ui-chip-amount: #e8f4ff;
  --ui-tx-subtle: #a8c0e4;
  --ui-badge-income-text: #d1ffe0;
  --ui-badge-income-bg: rgba(34, 197, 94, 0.25);
  --ui-badge-income-border: rgba(74, 222, 128, 0.42);
  --ui-badge-expense-text: #ffdbe2;
  --ui-badge-expense-bg: rgba(244, 63, 94, 0.24);
  --ui-badge-expense-border: rgba(251, 113, 133, 0.42);
  --ui-premium-overlay:
    linear-gradient(122deg, rgba(5, 16, 40, 0.92) 8%, rgba(8, 28, 69, 0.76) 54%, rgba(11, 37, 90, 0.5) 100%),
    radial-gradient(circle at 90% 14%, rgba(103, 232, 249, 0.45), transparent 36%);
  --ui-toast-bg: linear-gradient(135deg, #2563eb, #1e3a8a);
  --ui-toast-border: rgba(182, 209, 255, 0.5);
  --ui-hamburger-bg: rgba(10, 24, 58, 0.92);
  --ui-hamburger-line: #cfe2ff;
  --ui-empty-bg: rgba(11, 32, 78, 0.72);
  --ui-empty-border: rgba(140, 176, 235, 0.36);
  --ui-empty-text: #a8c0e4;
}

body {
  color: var(--ui-text) !important;
  background: var(--ui-page-bg) !important;
}

body::before {
  background-image:
    linear-gradient(to right, var(--ui-grid-color) 1px, transparent 1px),
    linear-gradient(to bottom, var(--ui-grid-color) 1px, transparent 1px) !important;
  opacity: var(--ui-grid-opacity) !important;
}

.glass,
.sidebar,
.sidebar-user,
.card,
.section-card,
.chart-card,
.wallet-card,
.tx-item,
.budget-strip-item,
.budget-card,
.goal-card,
.tx-table-wrapper,
.tx-stat,
.partner-stat,
.edit-modal-box {
  background: var(--ui-surface) !important;
  border-color: var(--ui-border) !important;
  color: var(--ui-text) !important;
  box-shadow: var(--ui-shadow) !important;
}

.login-title,
.sidebar-brand,
.page-header h2,
.section-header h3,
.chart-card h3,
.partner-card-name,
.edit-modal-title,
.wallet-focus-amount,
.card-value,
.tx-desc,
.tx-desc-text,
.wallet-name,
.wallet-balance,
.section-total,
.budget-cat,
.goal-icon-name,
.audit-summary,
.tx-table td,
.tx-table th,
.tx-stat,
#current-month-label {
  color: var(--ui-text) !important;
}

.login-subtitle,
.login-status,
.form-group small,
.form-group label,
.login-hint,
.user-tag,
.card-label,
.tx-meta,
.wallet-type,
.wallet-focus-meta,
.partner-stat-label,
.audit-time,
.empty-state,
.loading-state,
.strip-empty {
  color: var(--ui-muted) !important;
}

.empty-state,
.loading-state,
.strip-empty {
  background: var(--ui-empty-bg) !important;
  border-color: var(--ui-empty-border) !important;
  color: var(--ui-empty-text) !important;
}

.empty-state code,
.strip-empty code,
.loading-state code {
  color: #1f4f7b !important;
  background: rgba(37, 99, 235, 0.16) !important;
}

.empty-state [style*='opacity:.6'],
.empty-state [style*='opacity:.5'],
.strip-empty [style*='opacity:.6'],
.strip-empty [style*='opacity:.5'] {
  opacity: 1 !important;
  color: var(--ui-empty-text) !important;
}

.wallets-section-title-muted {
  color: var(--ui-muted) !important;
}

.shared-wallet-empty-card {
  border: 1px dashed var(--ui-border-strong) !important;
}

.btn-primary {
  background: var(--ui-primary-grad) !important;
  box-shadow: 0 12px 28px var(--ui-primary-glow) !important;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 16px 34px var(--ui-primary-glow) !important;
}

.btn-secondary,
.btn-ghost {
  background: var(--ui-secondary-bg) !important;
  color: var(--ui-secondary-text) !important;
  border-color: var(--ui-border) !important;
}

.nav-item {
  color: var(--ui-nav-text) !important;
}

.nav-item:hover {
  color: var(--ui-nav-hover-text) !important;
  background: var(--ui-nav-hover-bg) !important;
}

.nav-item.active {
  color: var(--ui-nav-active-text) !important;
  background: var(--ui-nav-active-bg) !important;
  border-color: var(--ui-nav-active-border) !important;
}

.nav-item.active::before {
  background: var(--ui-nav-rail) !important;
}
.month-btn,
.filter-select,
.edit-modal-input,
.edit-modal-select {
  background: var(--ui-input-bg) !important;
  color: var(--ui-input-text) !important;
  border-color: var(--ui-input-border) !important;
}

.filter-select,
.edit-modal-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath fill='none' stroke='%23b8d3f8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4.5 5L10 1'/%3E%3C/svg%3E") !important;
}

.filter-select option,
.edit-modal-select option {
  background: var(--ui-input-bg);
  color: var(--ui-text);
}

.filter-select:focus,
.edit-modal-input:focus,
.edit-modal-select:focus,
.month-btn:hover {
  border-color: var(--ui-border-strong) !important;
  box-shadow: 0 0 0 3px var(--ui-focus-ring) !important;
}

.month-badge {
  color: var(--ui-pill-text) !important;
  background: var(--ui-pill-bg) !important;
  border-color: var(--ui-border-strong) !important;
}

.link-action {
  color: var(--ui-link) !important;
}

.link-action:hover {
  color: var(--ui-link-hover) !important;
}

.wallet-focus-chip {
  background: var(--ui-chip-bg) !important;
  border-color: var(--ui-chip-border) !important;
  color: var(--ui-text) !important;
}

.wallet-focus-chip.active {
  background: var(--ui-chip-active-bg) !important;
  border-color: var(--ui-chip-active-border) !important;
}

.wallet-focus-chip strong {
  color: var(--ui-chip-amount) !important;
  opacity: 1 !important;
}

.tx-table thead th {
  background: var(--ui-table-head-bg) !important;
  color: var(--ui-table-head-text) !important;
}

.tx-table th,
.tx-table td,
.audit-row {
  border-bottom-color: var(--ui-table-divider) !important;
}

.tx-table tbody tr:hover,
.audit-row:hover {
  background: var(--ui-nav-hover-bg) !important;
}

.tx-cat-wallet,
.tx-table .td-owner,
.tx-table .td-date {
  color: var(--ui-tx-subtle) !important;
  opacity: 1 !important;
}

.badge-income {
  color: var(--ui-badge-income-text) !important;
  background: var(--ui-badge-income-bg) !important;
  border-color: var(--ui-badge-income-border) !important;
}

.badge-expense {
  color: var(--ui-badge-expense-text) !important;
  background: var(--ui-badge-expense-bg) !important;
  border-color: var(--ui-badge-expense-border) !important;
}

.premium-ad-overlay {
  background: var(--ui-premium-overlay) !important;
}

.toast {
  background: var(--ui-toast-bg) !important;
  border-color: var(--ui-toast-border) !important;
}

.toast.is-error {
  background: linear-gradient(135deg, #be123c, #7f1d1d) !important;
}

.hamburger {
  background: var(--ui-hamburger-bg) !important;
  border-color: var(--ui-border) !important;
}

.hamburger span {
  background: var(--ui-hamburger-line) !important;
}

.sidebar-overlay {
  background: rgba(2, 8, 22, 0.55) !important;
}

.global-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.theme-toggle-floating {
  position: static;
  min-height: 38px;
  padding-inline: 12px;
  border-radius: 999px;
  border: 1px solid var(--ui-border-strong);
  background: var(--ui-secondary-bg);
  color: var(--ui-secondary-text);
  box-shadow: var(--ui-shadow);
}

.theme-toggle-floating:hover {
  filter: brightness(1.08);
}

.privacy-toggle-floating {
  position: static;
  min-height: 38px;
  padding-inline: 12px;
  border-radius: 999px;
  border: 1px solid var(--ui-border-strong);
  background: var(--ui-secondary-bg);
  color: var(--ui-secondary-text);
  box-shadow: var(--ui-shadow);
}

.privacy-toggle-floating:hover {
  filter: brightness(1.08);
}

.privacy-toggle-floating.active {
  background: var(--ui-primary-grad);
  color: #ffffff;
  border-color: transparent;
}

.telegram-profile-card {
  margin-bottom: 16px;
}

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

.telegram-profile-item {
  border-radius: 12px;
  border: 1px solid var(--ui-border);
  background: var(--ui-chip-bg);
  padding: 10px 12px;
}

.telegram-profile-label {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ui-muted);
  font-weight: 700;
}

.telegram-profile-value {
  margin-top: 3px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ui-text);
  word-break: break-word;
}

.telegram-profile-privacy-note {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--ui-muted);
}

.owner-login-list .owner-login-row {
  align-items: flex-start;
}

.owner-login-ua {
  margin-top: 2px;
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .global-toolbar {
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 10px;
  }

  .theme-toggle-floating {
    min-height: 36px;
    font-size: 0.76rem;
    padding-inline: 10px;
  }

  .privacy-toggle-floating {
    min-height: 34px;
    font-size: 0.72rem;
    padding-inline: 10px;
  }

  .tx-table tr {
    background: var(--ui-surface) !important;
    border-color: var(--ui-border) !important;
  }
}

/* =============================================================
   Mobile UX Hotfix (Overview + Sidebar)
   ============================================================= */
@media (max-width: 768px) {
  body,
  #dashboard-screen,
  .main-content,
  #page-overview {
    overflow-x: hidden !important;
  }

  #recent-transactions-list {
    overflow-x: clip;
  }

  #recent-transactions-list .tx-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      'icon info'
      'icon amount';
    align-items: start;
    column-gap: 10px;
    row-gap: 6px;
    padding: 10px;
    max-width: 100%;
    min-width: 0;
  }

  #recent-transactions-list .tx-type-icon {
    grid-area: icon;
    align-self: start;
    margin-top: 2px;
  }

  #recent-transactions-list .tx-info {
    grid-area: info;
    min-width: 0;
    width: 100%;
  }

  #recent-transactions-list .tx-desc {
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
  }

  #recent-transactions-list .tx-meta {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  #recent-transactions-list .tx-amount {
    grid-area: amount;
    justify-self: end;
    max-width: 100%;
    white-space: normal;
    text-align: right;
    font-size: 0.82rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .sidebar {
    top: 0 !important;
    bottom: 0 !important;
    height: 100svh !important;
    height: 100dvh !important;
    min-height: 100svh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-nav {
    min-height: 0;
    overflow-y: auto;
  }

  .sidebar-footer {
    margin-top: auto;
  }

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