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

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(56px);
  opacity: var(--orb-opacity);
  pointer-events: none;
  z-index: 0;
}

.bg-orb-one {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -60px;
  background: var(--orb-one);
}

.bg-orb-two {
  width: 280px;
  height: 280px;
  top: 120px;
  right: -40px;
  background: var(--orb-two);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--topbar-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-logo {
  width: 86px;
  height: auto;
  max-height: 72px;
  object-fit: contain;
  display: block;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

/* Logo asset is dark-on-transparent; lighten on dark UI for contrast */
:root:not([data-theme="light"]) .brand-logo {
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.brand-logo-only {
  text-decoration: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .header-right {
    gap: 6px;
  }
  .header-today {
    font-size: 12px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.header-cal .chip-sm {
  padding: 6px 12px;
  font-size: 12px;
  min-width: 40px;
}

.header-today {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}

.et-date-field {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.et-date-field .et-date-month {
  flex: 1 1 140px;
  min-width: 120px;
}

.et-date-field .et-date-day {
  width: 72px;
}

.et-date-field .et-date-year {
  width: 96px;
}

.btn-icon {
  min-width: 40px;
  padding: 8px 12px;
  font-size: 16px;
}

.brand-copy span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-family: "Inter", sans-serif;
  letter-spacing: 0;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  height: fit-content;
  position: sticky;
  top: 88px;
}

.sidebar a {
  padding: 11px 14px;
  border-radius: 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.sidebar a.active,
.sidebar a:hover {
  background: rgba(110, 231, 255, 0.1);
  color: var(--text);
  border-color: rgba(110, 231, 255, 0.18);
  text-decoration: none;
}

.sidebar a.active {
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.16), rgba(167, 139, 250, 0.1));
}

main {
  min-width: 0;
}

.page-title {
  margin: 0 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.card {
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 18px;
  margin-bottom: 14px;
}

.card-glow-balance {
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(110, 231, 255, 0.04)),
    var(--glass-bg);
}

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

.card-header h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

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

.dashboard-grid .span-2 { grid-column: span 2; }

@media (max-width: 960px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .span-2 { grid-column: span 1; }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.summary-grid-6 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .summary-grid,
  .summary-grid-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .summary-grid,
  .summary-grid-6 { grid-template-columns: 1fr; }
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.metric-pill.income { color: var(--accent-income); border-color: rgba(104, 240, 183, 0.25); }
.metric-pill.expense { color: var(--accent-expense); border-color: rgba(248, 113, 113, 0.25); }
.metric-pill.neutral { color: var(--accent); border-color: rgba(110, 231, 255, 0.25); }

.tx-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.tx-row:last-child { border-bottom: none; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.filter-panel,
.search-panel {
  margin-bottom: 14px;
}

.filter-panel-title {
  margin: 0 0 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 700;
}

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

.filter-panel-head .filter-panel-title {
  margin: 0;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-filter {
  margin-top: 4px;
  margin-bottom: 12px;
}

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

.tx-cal-toolbar strong {
  flex: 1;
  text-align: center;
  font-family: "Space Grotesk", sans-serif;
}

.tx-cal-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
}

@media (max-width: 860px) {
  .tx-cal-layout {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 8px;
    align-items: stretch;
  }

  .tx-cal-main {
    min-width: 0;
  }

  .tx-month-rail {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    min-width: 76px;
    max-width: 76px;
    padding: 10px 6px;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tx-month-rail .card-title {
    font-size: 11px;
    margin-bottom: 6px;
    text-align: center;
  }

  .tx-month-btn {
    padding: 7px 4px;
    font-size: 10px;
    text-align: center;
    line-height: 1.2;
  }

  .tx-day-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .tx-day-chip {
    padding: 6px 4px;
  }

  .tx-day-num {
    font-size: 14px;
  }

  .tx-day-wd {
    font-size: 10px;
  }

  .tx-cal-toolbar strong {
    font-size: 14px;
  }

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

  .search-totals-row {
    flex-direction: column;
  }

  .modal-card {
    width: 100%;
    max-height: 92vh;
  }
}

@media (max-width: 400px) {
  .tx-cal-layout {
    grid-template-columns: minmax(0, 1fr) 68px;
  }

  .tx-month-rail {
    min-width: 68px;
    max-width: 68px;
  }

  .header-cal {
    display: none;
  }
}

.tx-day-strip-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.tx-day-window-btn {
  flex-shrink: 0;
}

.tx-day-strip {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 4px 0 8px;
}

.tx-window-hint {
  margin: 0 0 8px;
  text-align: center;
}

.global-search-results {
  margin-bottom: 16px;
}

.global-search-results.hidden {
  display: none;
}

.search-results-panel .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 13px;
}

.search-modal-card .filter-grid {
  margin-bottom: 4px;
}

.tx-day-chip {
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  scroll-snap-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tx-day-chip.active {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: transparent;
}

.tx-day-wd {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
}

.tx-day-num {
  font-size: 16px;
  font-weight: 800;
  font-family: "Space Grotesk", sans-serif;
}

.tx-day-dot {
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-income);
}

.tx-day-chip.active .tx-day-dot {
  background: var(--primary-fg);
}

.tx-day-totals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--glass-border);
  font-weight: 600;
}

.tx-day-totals-in {
  color: var(--accent-income);
  flex: 1;
}

.tx-day-totals-out {
  color: var(--accent-expense);
  flex: 1;
  text-align: right;
}

.tx-day-totals-sep {
  color: var(--muted);
  font-weight: 300;
}

.tx-selected-label {
  margin: 0 0 10px;
}

.tx-day-list {
  min-height: 120px;
}

.tx-month-rail {
  padding: 12px;
  min-width: 88px;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tx-month-btn {
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.tx-month-btn.active {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: transparent;
}

.search-totals-bar {
  margin-bottom: 14px;
}

.search-totals-bar.hidden {
  display: none;
}

.search-totals {
  margin-bottom: 0;
}

.search-totals-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.search-total-tile {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--surface);
}

.search-total-tile.income {
  border-color: rgba(104, 240, 183, 0.25);
  background: rgba(104, 240, 183, 0.08);
}

.search-total-tile.expense {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.08);
}

.search-total-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

.search-total-tile strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.search-total-tile.income strong {
  color: var(--accent-income);
}

.search-total-tile.expense strong {
  color: var(--accent-expense);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.search-row .form-input {
  flex: 1;
  min-width: 200px;
}

.toolbar-stack {
  flex-direction: column;
  align-items: stretch;
}

.tx-bank-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(110, 231, 255, 0.12);
  color: var(--accent);
  vertical-align: middle;
}

.tx-desc {
  font-weight: 600;
  font-size: 14px;
}

.tx-meta {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
}

.tx-amount {
  font-weight: 800;
  font-size: 15px;
  text-align: right;
}

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

.chart-wrap {
  position: relative;
  height: 280px;
  margin-top: 8px;
}

.chart-wrap-sm { height: 240px; }

.toolbar-glass {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--glass-blur));
}

.chip {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.chip:hover { transform: translateY(-1px); }

.chip.active {
  background: var(--primary-bg);
  color: var(--primary-fg);
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(110, 231, 255, 0.18);
}

.btn-tonal {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
}

.card-value {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-family: "Space Grotesk", sans-serif;
}

.summary-card .card-value.income { color: var(--accent-income); }
.summary-card .card-value.expense { color: var(--accent-expense); }
.summary-card .card-value.net { color: var(--accent); }

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

.topbar-spacer { flex: 1; }

.nav-menu-btn {
  display: none;
  flex-shrink: 0;
}

.nav-drawer-backdrop {
  display: none;
}

@media (max-width: 860px) {
  .nav-menu-btn {
    display: inline-flex;
  }

  .nav-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  body.nav-open .nav-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 12px 12px 40px;
    gap: 0;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(288px, 88vw);
    z-index: 40;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-top: none;
    border-bottom: none;
    height: 100%;
    max-height: none;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    padding: calc(72px + env(safe-area-inset-top, 0px)) 12px 24px;
    transform: translateX(-105%);
    transition: transform 0.24s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar a {
    flex: none;
    text-align: left;
  }

  .brand-logo {
    width: 64px;
    max-height: 52px;
  }

  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .page-title {
    font-size: 1.35rem;
  }

  main {
    width: 100%;
  }
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 8px;
}

.login-brand .brand-logo {
  width: 80px;
  height: 80px;
}

.login-brand h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.btn-primary {
  background: var(--primary-bg);
  color: var(--primary-fg);
  box-shadow: 0 8px 20px rgba(110, 231, 255, 0.15);
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tab {
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.list-row:last-child { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-warn { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.badge-ok { background: rgba(104, 240, 183, 0.18); color: var(--accent-3); }

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

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--text);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading-box {
  background: var(--surface-strong);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  font-weight: 600;
}

.content-loading {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 25%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.06) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  border-radius: 10px;
  min-height: 14px;
}

:root[data-theme="light"] .skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 25%,
    rgba(0, 0, 0, 0.08) 50%,
    rgba(0, 0, 0, 0.04) 75%
  );
  background-size: 200% 100%;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 16px;
  margin-bottom: 14px;
}

.skeleton-card .skeleton {
  margin-bottom: 10px;
}

.skeleton-card .skeleton:last-child {
  margin-bottom: 0;
}

.login-wrap {
  max-width: 420px;
  margin: 40px auto;
  padding: 16px;
}

.qr-box {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: white;
  border-radius: var(--radius-md);
  margin: 16px 0;
}

.qr-status {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-field input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.divider {
  text-align: center;
  color: var(--muted);
  margin: 20px 0;
  font-size: 13px;
}

.balance-total {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent-balance);
}

.balance-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  position: relative;
}

.calendar-day.selected {
  background: var(--surface-strong);
  border-color: var(--accent);
}

.calendar-day.today {
  border-color: var(--accent);
  font-weight: 700;
}

.calendar-day .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 4px;
}

.event-income { background: var(--accent-income); }
.event-outgoing { background: var(--accent-2); }
.event-goal { background: #3b82f6; }
.event-budget { background: #14b8a6; }

.event-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
}

.pro-teaser {
  border: 1px dashed var(--accent-2);
  background: rgba(167, 139, 250, 0.08);
}

.tx-row-link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--glass-border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-radius: 10px;
  margin: 0 -8px;
  cursor: pointer;
}

.tx-row-link:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tx-row-link:last-child {
  border-bottom: none;
}

.tx-amount-card {
  text-align: center;
  padding: 28px 20px;
  margin-bottom: 16px;
  border-radius: var(--radius-xl);
  color: white;
}

.tx-amount-card.tx-income {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.92), rgba(16, 185, 129, 0.65));
}

.tx-amount-card.tx-expense {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.92), rgba(239, 68, 68, 0.65));
}

.tx-amount-icon { font-size: 40px; margin-bottom: 8px; }
.tx-amount-value { font-size: 34px; font-weight: 800; }
.tx-amount-date { opacity: 0.9; margin-top: 8px; font-size: 14px; }
.tx-balance { margin-top: 10px; font-weight: 600; }
.tx-receipt-link { display: inline-block; margin-top: 12px; color: white; font-weight: 600; }

.receipt-card { margin-bottom: 16px; }
.receipt-url {
  font-size: 13px;
  word-break: break-all;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
}
.receipt-url-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.receipt-url a { color: var(--accent); font-weight: 500; }
.receipt-frame-wrap {
  width: 100%;
  height: min(72vh, 640px);
  min-height: 320px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}
.receipt-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}
.receipt-frame-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.receipt-frame-note.receipt-frame-warn {
  color: #fbbf24;
}

.receipt-preview-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.receipt-pdf {
  background: #525659;
}

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

.detail-card { padding: 16px; }
.detail-wide { grid-column: 1 / -1; }
.detail-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.detail-value { font-size: 16px; font-weight: 600; word-break: break-word; }
.detail-editable { cursor: pointer; }
.detail-editable:hover { border-color: var(--accent); }
.edit-hint { font-weight: 400; opacity: 0.7; }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0; }
.from-to-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.party-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.party-tail { font-size: 12px; color: var(--muted); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  width: min(440px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  backdrop-filter: blur(var(--glass-blur));
}

.modal-card-wide { width: min(520px, 100%); }
.modal-card h3 { margin: 0 0 16px; font-family: "Space Grotesk", sans-serif; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.form-input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
}

.form-error { color: #f87171; font-size: 13px; margin-top: 8px; }
.form-error.hidden { display: none; }

.list-row-actions { align-items: center; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 6px 10px; font-size: 12px; min-height: auto; }
.btn-danger-text { color: #f87171 !important; }

@media (max-width: 720px) {
  .from-to-grid { grid-template-columns: 1fr; }
  .row-actions { width: 100%; justify-content: flex-end; margin-top: 8px; }
  .list-row-actions { flex-direction: column; align-items: stretch; }
}

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

.tx-direct-link-card {
  margin-bottom: 14px;
}

.tx-direct-link-url {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 13px;
  word-break: break-all;
  font-weight: 500;
}

.receipt-card-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media print {
  body {
    background: #fff !important;
    color: #111 !important;
  }

  .bg-orb,
  .topbar,
  .nav-menu-btn,
  .nav-drawer-backdrop,
  .sidebar,
  .page-title,
  .page-subtitle,
  .tx-detail-toolbar,
  .no-print,
  .receipt-frame-wrap,
  .receipt-frame-note,
  .edit-hint,
  #edit-cat-btn {
    display: none !important;
  }

  .layout,
  main,
  #page-content {
    display: block !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    background: #fff !important;
    color: #111 !important;
  }

  .tx-amount-card {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .tx-direct-link-card,
  .receipt-url,
  .print-show {
    display: block !important;
  }

  .receipt-url a,
  .tx-direct-link-url {
    color: #000 !important;
    text-decoration: underline;
  }

  .detail-value,
  .tx-amount-value {
    color: #111 !important;
  }
}
