/* ==========================================================================
   VIEW 1: AUTH VIEW (LOGIN / REGISTER)
   ========================================================================== */
#auth-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  z-index: 10;
}

.auth-container {
  width: 100%;
  max-width: 440px;
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.brand-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  width: 72px;
  height: 72px;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(56, 189, 248, 0.3));
}

.auth-header .logo-badge {
  margin: 0 auto 1rem;
  width: 52px;
  height: 52px;
}

.auth-header .logo-badge svg {
  width: 28px;
  height: 28px;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.auth-tabs {
  display: flex;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.auth-tab-btn {
  flex: 1;
  padding: 0.6rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.auth-tab-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  color: #1f2937;
  font-weight: 600;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.google-btn:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
}

.google-btn img, .google-btn svg {
  width: 20px;
  height: 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 0.75rem;
}

/* ==========================================================================
   VIEW 2: DASHBOARD VIEW
   ========================================================================== */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Summary Cards Wrapper & Carousel / Grid */
.summary-cards-wrapper {
  position: relative;
  width: 100%;
}

.summary-cards-grid {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 0;
  width: 100%;
  border-radius: var(--radius-lg);
}

.summary-cards-grid::-webkit-scrollbar {
  display: none;
}

.summary-cards-grid .stat-card {
  flex: 0 0 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.stat-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0 0.15rem;
}

.stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--border-medium, rgba(148, 163, 184, 0.35));
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.6;
}

.stat-dot:hover {
  opacity: 1;
}

.stat-dot.active {
  width: 24px;
  background: var(--primary, #6366f1);
  opacity: 1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

@media (min-width: 640px) {
  .summary-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow-x: visible;
    overflow-y: visible;
    scroll-snap-type: none;
    gap: 1rem;
  }

  .summary-cards-grid .stat-card {
    flex: initial;
    min-width: auto;
    max-width: none;
    scroll-snap-align: none;
  }

  .stat-carousel-dots {
    display: none;
  }
}

.stat-card.total-balance {
  --card-accent: var(--primary);
}

.stat-card.income-card {
  --card-accent: var(--income);
}

.stat-card.expense-card {
  --card-accent: var(--expense);
}

/* Filters bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.filter-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.filter-selects-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  justify-content: flex-end;
}

.filter-select-wrapper {
  min-width: 140px;
}

.filter-select {
  width: 100%;
  padding: 0.5rem 2.25rem 0.5rem 0.85rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 14px 14px !important;
}

[data-theme="light"] .filter-select {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 14px 14px !important;
}

.filter-select:focus {
  border-color: var(--primary);
}

@media (max-width: 640px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
    gap: 0.65rem;
  }
  .filter-left {
    width: 100%;
  }
  .month-stepper-control {
    width: 100%;
    display: flex;
  }
  .month-dropdown-anchor {
    flex: 1;
  }
  .month-dropdown-btn {
    width: 100%;
    justify-content: center;
  }
  .filter-selects-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.5rem;
    width: 100%;
  }
  .filter-select-wrapper {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .filter-selects-group {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   ROTATING UP/DOWN MONTH & YEAR DROPDOWN
   ========================================================================== */
.month-stepper-control {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
  position: relative;
  transition: all var(--transition-fast);
}

.month-stepper-control:hover,
.month-stepper-control:focus-within {
  border-color: var(--border-light);
}

[data-theme="light"] .month-stepper-control {
  background-color: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.month-step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 30px;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.month-step-btn:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

.month-step-btn:active {
  transform: scale(0.9);
}

[data-theme="light"] .month-step-btn:hover {
  background: #f1f5f9;
  color: #2563eb;
}

.month-dropdown-anchor {
  position: relative;
}

.month-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  background: transparent;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  border-radius: calc(var(--radius-md) - 2px);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

#month-label-display {
  display: inline-block;
  will-change: transform, opacity;
}

.month-label-forward {
  animation: monthLabelForward 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.month-label-backward {
  animation: monthLabelBackward 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes monthLabelForward {
  0% {
    opacity: 0.3;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes monthLabelBackward {
  0% {
    opacity: 0.3;
    transform: translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.month-dropdown-btn:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

[data-theme="light"] .month-dropdown-btn:hover {
  background: #f1f5f9;
  color: #2563eb;
}

.month-dropdown-btn .month-cal-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.month-dropdown-btn .rotating-chevron-icon {
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

/* Arrow smoothly rotates up 180 degrees when open */
.month-dropdown-btn.active .rotating-chevron-icon,
.month-dropdown-anchor.open .rotating-chevron-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

/* Popover Menu */
.month-popover-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  transform: translateY(4px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  padding: 0.85rem;
  width: 250px;
  max-width: calc(100vw - 2.5rem);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.month-dropdown-anchor.open .month-popover-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

[data-theme="light"] .month-popover-menu {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.popover-year-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.popover-year-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.year-nav-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.year-nav-btn:hover {
  background: var(--bg-surface);
  border-color: var(--primary);
  color: var(--primary);
}

[data-theme="light"] .year-nav-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
}

.popover-months-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.month-pill-btn {
  padding: 0.4rem 0.2rem;
  background: var(--bg-surface);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.month-pill-btn:hover {
  background: var(--primary-glow);
  color: var(--primary);
  border-color: var(--primary);
}

.month-pill-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

[data-theme="light"] .month-pill-btn {
  background: #f8fafc;
  color: #1e293b;
}

[data-theme="light"] .month-pill-btn:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
}

[data-theme="light"] .month-pill-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.popover-footer {
  display: flex;
  justify-content: center;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-subtle);
}

.popover-today-btn {
  background: transparent;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.popover-today-btn:hover {
  text-decoration: underline;
}

/* Transactions Feed */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-badge {
  font-size: 0.75rem;
  background: var(--bg-surface);
  color: var(--text-muted);
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.transactions-list.slide-forward {
  animation: txSlideForward 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.transactions-list.slide-backward {
  animation: txSlideBackward 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes txSlideForward {
  0% {
    opacity: 0.35;
    transform: translateX(16px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes txSlideBackward {
  0% {
    opacity: 0.35;
    transform: translateX(-16px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.tx-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast);
  position: relative;
  overflow: hidden;
  animation: txCardEnter var(--duration-normal) var(--ease-out-expo) both;
  animation-delay: calc(var(--stagger, 0) * 35ms);
}

@keyframes txCardEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tx-card:hover {
  border-color: var(--border-light);
  transform: translateY(-1.5px);
  background: var(--bg-surface);
}

.tx-card.tx-deleting {
  opacity: 0 !important;
  transform: translateX(18px) scale(0.96) !important;
  transition: opacity var(--duration-fast) var(--ease-out-quart),
              transform var(--duration-fast) var(--ease-out-quart);
}

.tx-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.tx-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.tx-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.tx-header-row .tx-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.tx-amount {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}

.tx-meta-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.tx-icon-pill {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.tx-icon-pill svg {
  width: 13px;
  height: 13px;
}

.tx-wallet-pill {
  padding: 0 4px;
  width: auto;
  min-width: 22px;
  gap: 2px;
  color: var(--text-muted);
}

.tx-meta-date {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tx-meta-time {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  opacity: 0.85;
}

.tx-amount.income {
  color: var(--income);
}

.tx-amount.expense {
  color: var(--expense);
}

.tx-amount.transfer {
  color: #38bdf8;
}

[data-theme="light"] .tx-amount.transfer {
  color: #0284c7;
}

.badge-transfer {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

[data-theme="light"] .badge-transfer {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.segment-btn.active.transfer {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

[data-theme="light"] .segment-btn.active.transfer {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.tx-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.transactions-list .tx-actions {
  display: none !important;
}

.transactions-list.is-editing .tx-actions {
  display: flex !important;
  animation: fadeIn 0.18s ease-in-out;
}

/* ==========================================================================
   VIEW 3: WALLETS VIEW
   ========================================================================== */
.wallets-overview-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.22) 0%, rgba(14, 165, 233, 0.12) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .wallets-overview-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem;
    gap: 1rem;
  }
  .wallets-overview-banner .banner-amount {
    font-size: clamp(1.6rem, 6.5vw, 2.2rem);
    word-break: break-word;
  }
  .banner-actions {
    width: 100%;
    display: flex;
    gap: 0.65rem;
    justify-content: flex-start;
    align-items: center;
  }
}

.banner-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #7dd3fc;
  letter-spacing: 0.05em;
}

.banner-amount {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

/* Light mode rich blue gradient for total liquid net worth */
[data-theme="light"] .wallets-overview-banner {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #0284c7 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.35), 0 8px 10px -6px rgba(37, 99, 235, 0.2);
}

[data-theme="light"] .wallets-overview-banner .banner-label {
  color: #e0f2fe;
  font-weight: 700;
  letter-spacing: 0.05em;
}

[data-theme="light"] .wallets-overview-banner .banner-amount {
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .wallets-overview-banner .btn-primary {
  background: #ffffff;
  color: #1d4ed8;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .wallets-overview-banner .btn-primary:hover {
  background: #f0f9ff;
  color: #1e40af;
  transform: translateY(-1px);
}

[data-theme="light"] .wallets-overview-banner #btn-toggle-edit-wallets {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

[data-theme="light"] .wallets-overview-banner #btn-toggle-edit-wallets:hover {
  background: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .wallets-overview-banner #btn-toggle-edit-wallets.btn-primary {
  background: #ffffff;
  color: #1d4ed8;
  border-color: #ffffff;
}

.wallets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .wallets-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

.wallet-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  position: relative;
  overflow: hidden;
  transition: opacity var(--transition-fast), border-color var(--transition-fast);
}

.wallet-card.is-excluded {
  opacity: 0.78;
  border-style: dashed;
}

.wallet-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--wallet-color, var(--primary));
}

.wallet-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.wallet-card-header .tx-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Include on/off toggle button */
.btn-toggle-include {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.26rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.btn-toggle-include:hover {
  border-color: var(--border-light);
  background: var(--bg-glass-card);
}

.btn-toggle-include.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: #10b981;
}

[data-theme="light"] .btn-toggle-include.active {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

.toggle-pill {
  position: relative;
  width: 24px;
  height: 14px;
  border-radius: 999px;
  background: var(--text-muted);
  opacity: 0.45;
  transition: all var(--transition-fast);
  display: inline-block;
}

.toggle-pill.on {
  background: #10b981;
  opacity: 1;
}

.toggle-switch-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform var(--transition-fast);
}

.toggle-pill.on .toggle-switch-slider {
  transform: translateX(10px);
}

.wallet-excluded-pill {
  font-size: 0.68rem;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-top: 0.2rem;
  width: fit-content;
}

[data-theme="light"] .wallet-excluded-pill {
  color: #d97706;
  background: #fef3c7;
  border-color: #fde68a;
}

.wallet-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.wallet-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.wallet-card .tx-actions {
  display: none;
  align-items: center;
  gap: 0.35rem;
}

.wallets-grid.is-editing .wallet-card .tx-actions {
  display: flex;
  animation: fadeIn 0.18s ease-in-out;
}

.wallet-card-header {
  cursor: pointer;
  user-select: none;
}

.wallet-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wallet-chevron-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.wallet-chevron-icon {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.wallet-card.is-expanded .wallet-chevron-icon {
  transform: rotate(180deg);
  color: var(--primary);
}

@media (max-width: 640px) {
  .wallet-chevron-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .wallet-card {
    padding: 1rem 1.15rem;
  }
  .wallet-card.is-collapsed .wallet-card-header {
    margin-bottom: 0;
  }
  .wallet-card.is-collapsed .wallet-collapsible-body {
    display: none;
  }
  .wallet-card.is-expanded .wallet-collapsible-body {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
  }
}

.wallet-balance-box {
  margin-top: 0.5rem;
}

.wallet-balance-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.wallet-balance-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* Privacy Mask (Asterisks) for Net Worth & Total Balance */
.privacy-blurred {
  color: transparent !important;
  text-shadow: none !important;
  user-select: none !important;
  cursor: pointer;
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.privacy-blurred::after {
  content: attr(data-mask);
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  color: var(--text-main);
  letter-spacing: 2px;
  font-weight: 800;
  font-family: var(--font-mono);
  pointer-events: none;
  white-space: nowrap;
}

.wallets-overview-banner .privacy-blurred::after {
  color: #ffffff !important;
}

[data-theme="light"] .wallets-overview-banner .privacy-blurred::after {
  color: #ffffff !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.wallet-balance-val.privacy-blurred::after {
  font-size: 1.15rem;
}

/* Privacy Mask Dissolving Transition */
.privacy-blur-target {
  transition: filter 180ms var(--ease-out-quint),
              opacity 180ms var(--ease-out-quint),
              transform 180ms var(--ease-out-quint);
  will-change: filter, opacity, transform;
}

.privacy-dissolving {
  filter: blur(8px) !important;
  opacity: 0.35 !important;
  transform: scale(0.97) !important;
}

.btn-privacy-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.btn-privacy-toggle svg {
  transition: transform var(--duration-fast) var(--ease-out-quint), color var(--duration-fast);
}

.btn-privacy-toggle:hover {
  color: var(--text-main);
  transform: scale(1.1);
}

.btn-privacy-toggle:active {
  transform: scale(0.9) !important;
}

.privacy-btn-spin svg {
  animation: eyeToggleSpin 320ms var(--ease-out-expo);
}

@keyframes eyeToggleSpin {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(0.72) rotate(-35deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Category Card Interactive Feedback */
.category-card {
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}

.category-card:active {
  transform: scale(0.99);
}

.cat-arrow-icon {
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.category-card:hover .cat-arrow-icon {
  transform: translateX(3px);
  color: var(--primary);
}

/* ==========================================================================
   VIEW 4: CATEGORIES VIEW
   ========================================================================== */
.categories-header-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 1.25rem;
}

.categories-tabs {
  max-width: 340px;
  width: 100%;
}

.header-right .categories-header-actions,
.header-right .loans-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   ADVANCED CATEGORY ANALYTICS & PIE CHARTS
   ========================================================================== */
.categories-analytics-container {
  margin-bottom: 2rem;
  animation: analyticsFadeIn 0.35s var(--ease-out-quint);
}

@keyframes analyticsFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.analytics-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.analytics-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.analytics-title-group p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .analytics-charts-grid {
    grid-template-columns: 1fr;
  }
}

.analytics-chart-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.analytics-chart-card:hover {
  border-color: var(--border-light);
}

.chart-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.chart-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.chart-type-pill {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.chart-type-pill.expense {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.chart-type-pill.income {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.chart-card-total {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  margin-top: 0.25rem;
}

.chart-card-total.expense {
  color: var(--expense);
}

.chart-card-total.income {
  color: var(--income);
}

.highest-cat-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  margin-top: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  max-width: 100%;
}

.highest-cat-banner.expense {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.highest-cat-banner.income {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}

/* Donut Visual Container & Center Readout */
.donut-visual-container {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 1.25rem auto 0.75rem;
  flex-shrink: 0;
}

.donut-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.3));
}

.pie-slice {
  cursor: pointer;
  transform-origin: 120px 120px;
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.24s ease,
              opacity 0.2s ease;
  outline: none;
}

.pie-slice:hover,
.pie-slice.is-hovered {
  transform: scale(1.055);
  filter: brightness(1.2) drop-shadow(0 4px 14px var(--slice-glow, rgba(99, 102, 241, 0.5)));
}

.pie-slice.is-selected {
  transform: scale(1.08);
  stroke: #ffffff;
  stroke-width: 2.5px;
  filter: brightness(1.25) drop-shadow(0 6px 18px var(--slice-glow, rgba(99, 102, 241, 0.6)));
}

.donut-empty-track {
  fill: none;
  stroke: var(--bg-hover);
  stroke-width: 28;
  stroke-dasharray: 6 6;
}

.donut-empty-text {
  fill: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.donut-center-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 1.25rem;
}

.donut-pct-text {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
  color: var(--text-main);
  transition: transform 0.2s ease;
}

.donut-name-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
  max-width: 105px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-amt-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.donut-hint-text {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  font-weight: 700;
  margin-top: 4px;
}

/* Category Ranking Legend */
.cat-ranking-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.cat-rank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
  gap: 0.65rem;
  user-select: none;
  border: 1px solid transparent;
}

.cat-rank-row:hover {
  background: var(--bg-surface);
  transform: translateX(2px);
}

.cat-rank-row.is-active-cat {
  background: var(--bg-surface);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.cat-rank-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.cat-rank-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-rank-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-rank-right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.cat-rank-bar-bg {
  width: 50px;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

[data-theme="light"] .cat-rank-bar-bg {
  background: #e2e8f0;
}

.cat-rank-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s var(--ease-out-quint);
}

.cat-rank-pct {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
  min-width: 40px;
  text-align: right;
}

.cat-rank-amt {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  min-width: 65px;
  text-align: right;
}

/* Category Inspection Panel */
.category-inspection-panel {
  margin-top: 1.25rem;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  animation: inspectionSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes inspectionSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.inspection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.inspection-cat-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inspection-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.inspection-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.inspection-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.inspection-type-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
}

.inspection-type-pill.expense {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.inspection-type-pill.income {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.inspection-pct-badge {
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono);
}

.inspection-total {
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.inspection-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inspection-tx-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 0.2rem;
  scrollbar-width: thin;
}

.categories-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 760px;
  width: 100%;
}

@media (max-width: 768px) {
  .categories-grid {
    gap: 0.65rem;
  }
  .category-card {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }
  .cat-title {
    font-size: 0.92rem;
  }
  .cat-amount-text {
    font-size: 0.88rem;
  }
}

/* Category Detail Drilldown Modal Sizing */
#category-detail-modal .modal-dialog {
  max-height: 85vh;
  max-height: 85dvh;
}

#category-detail-modal .modal-header {
  flex-shrink: 0;
  padding: 1.15rem 1.25rem 0.75rem;
}

#category-detail-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 1.25rem;
  max-height: calc(85dvh - 130px);
}

#category-detail-modal .modal-footer {
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
}

.category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.25rem;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  gap: 1rem;
  min-height: 60px;
}

.category-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.cat-info {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.cat-info > div {
  min-width: 0;
  flex: 1;
}

.cat-title {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.cat-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-shrink: 0;
}

.categories-grid.is-editing .cat-right {
  display: none !important;
}

.cat-amount-text {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

.cat-arrow-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.category-card:hover .cat-arrow-icon {
  transform: translateX(3px);
  color: var(--primary);
}

.category-card .tx-actions {
  display: none;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}

.categories-grid.is-editing .category-card .tx-actions {
  display: flex;
  animation: fadeIn 0.18s ease-in-out;
}


/* ==========================================================================
   VIEW 5: SETTINGS VIEW
   ========================================================================== */
.settings-section {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.profile-avatar-large {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.15);
}

.profile-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.profile-info p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ==========================================================================
   VIEW 5 & CATEGORY EMBED: LOAN TRACKER
   ========================================================================== */

/* Category Embedded Loans Section */
.category-loans-section {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px dashed var(--border-subtle);
}

.loans-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.loans-heading-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.loans-heading-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.loans-heading-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Overview Banner in View Loans */
.loans-overview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.loans-overview-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #ec4899, #10b981);
}

.loans-banner-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  flex: 1;
}

.loans-stat-box {
  display: flex;
  flex-direction: column;
}

.loans-stat-box .banner-amount {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0.25rem 0;
  letter-spacing: -0.02em;
}

.loans-stat-box .debt-amount {
  color: #ef4444;
}

.banner-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.stat-badge-glow {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.loan-progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0.35rem 0;
}

.loan-progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #6366f1, #10b981);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loans-banner-actions {
  display: flex;
  align-items: center;
}

/* Filter Bar in Loans View */
.loans-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.loans-filter-tabs {
  max-width: 360px;
}

.loans-filter-tabs .segment-btn {
  white-space: nowrap !important;
}

.loans-sort-wrapper {
  min-width: 175px;
}

.loans-sort-wrapper .filter-select {
  height: 38px;
  font-size: 0.82rem;
}

@media (max-width: 640px) {
  .loans-overview-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 1.15rem;
    gap: 1.15rem;
  }
  .loans-banner-main {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }
  .loans-banner-actions {
    width: 100%;
  }
  .loans-banner-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .loans-filter-bar {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 1rem;
    gap: 0.65rem;
  }
  .loans-filter-tabs {
    width: 100%;
    max-width: 100%;
    display: flex;
    gap: 4px;
  }
  .loans-filter-tabs .segment-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.4rem;
    font-size: 0.8rem;
    white-space: nowrap !important;
  }
  .loans-sort-wrapper {
    width: 100%;
  }
  .loans-sort-wrapper .filter-select {
    width: 100%;
  }
}

/* Loans List (Vertical Stack & Wide Cards) */
.loans-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* Loan Card (Collapsible) */
.loan-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  cursor: pointer;
}

.loan-card.is-collapsed {
  gap: 0 !important;
  padding: 1rem 1.25rem;
}

.loan-card.is-collapsed .loan-card-header {
  margin-bottom: 0;
}

.loan-card.is-collapsed .loan-collapsible-body {
  display: none !important;
}

.loan-card.is-collapsed .loan-menu-buttons {
  display: none !important;
}

.loan-card.is-expanded .loan-collapsible-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.25rem;
  animation: fadeIn 0.2s ease-in-out;
}

.loan-card.is-expanded .loan-menu-buttons {
  display: flex !important;
  animation: fadeIn 0.18s ease-in-out;
}

.loan-chevron-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.loan-chevron-icon {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.loan-card.is-expanded .loan-chevron-icon {
  transform: rotate(180deg);
  color: var(--primary);
}


.loan-header-dot {
  opacity: 0.5;
}

.loan-header-quick-info {
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.loan-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.loan-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--loan-accent, var(--primary));
  opacity: 0.8;
}

.loan-card.loan-completed {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 4px 20px -2px rgba(16, 185, 129, 0.16);
}

.loan-card.loan-completed::before {
  background: #10b981;
}

.loan-card.just-completed-celebrate {
  animation: loanCompleteGlow 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes loanCompleteGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    transform: scale(0.99);
  }
  40% {
    box-shadow: 0 0 0 14px rgba(16, 185, 129, 0);
    transform: scale(1.015);
  }
  100% {
    box-shadow: 0 4px 20px -2px rgba(16, 185, 129, 0.16);
    transform: scale(1);
  }
}

/* Loan Card Header */
.loan-card-header {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}

@media (max-width: 540px) {
  .loan-card {
    padding: 0.85rem 0.95rem;
    gap: 0.85rem;
  }
  .loan-card.is-collapsed {
    padding: 0.85rem 0.95rem;
  }
}

.loan-card-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.loan-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.loan-brand-info {
  flex: 1;
  min-width: 0;
}

.loan-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  padding-right: 85px;
}

.loan-card.is-expanded .loan-card-title {
  padding-right: 145px;
}

.loan-lender-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.loan-brand-subline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loan-header-actions-group {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
}

.loan-status-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

@media (max-width: 540px) {
  .loan-status-pill {
    font-size: 0.65rem;
    padding: 0.12rem 0.4rem;
  }
  .loan-card-title {
    font-size: 0.95rem;
    padding-right: 78px;
  }
  .loan-card.is-expanded .loan-card-title {
    padding-right: 135px;
  }
  .loan-brand-subline {
    font-size: 0.74rem;
    gap: 0.35rem;
  }
}

.loan-status-pill.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.loan-status-pill.completed {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.loan-menu-buttons {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.btn-icon-subtle {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-subtle:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.btn-icon-subtle.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* Visualization Row (Ring + Numbers) */
.loan-vis-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

@media (max-width: 540px) {
  .loan-vis-row {
    flex-direction: column;
    align-items: center;
    gap: 1.15rem;
  }
}

.loan-ring-wrapper {
  position: relative;
  width: 86px;
  height: 86px;
  flex-shrink: 0;
}

.loan-progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.loan-progress-ring .ring-bg {
  fill: none;
  stroke: var(--bg-hover);
  stroke-width: 9;
}

.loan-progress-ring .ring-fill {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.65s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.3s ease;
  will-change: stroke-dashoffset;
}

.loan-ring-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loan-ring-pct {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.loan-ring-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.loan-numbers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem 1.25rem;
  flex: 1;
}

@media (max-width: 768px) {
  .loan-numbers-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem 0.85rem;
  }
}

.loan-num-item {
  display: flex;
  flex-direction: column;
}

.loan-num-item .num-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.loan-num-item .num-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.loan-num-item .remaining-val {
  color: #ef4444;
}

.loan-num-item .progress-val small {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Stepper Timeline */
.loan-stepper-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stepper-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stepper-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stepper-count-tag {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.loan-stepper-track {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.45rem 0.2rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  -webkit-overflow-scrolling: touch; /* iOS momentum touch drag */
  cursor: grab;
  user-select: none;
  touch-action: pan-x;
}

.loan-stepper-track::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.loan-stepper-track.is-dragging {
  cursor: grabbing !important;
  scroll-behavior: auto !important;
}

.loan-stepper-track.is-dragging .loan-step-pill {
  pointer-events: none;
}

.loan-step-pill {
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  flex-shrink: 0;
}

/* Paid Step */
.loan-step-pill.step-paid {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
}

.loan-step-pill.step-paid:hover {
  background: rgba(16, 185, 129, 0.28);
  transform: scale(1.06);
}

.loan-step-pill.step-just-paid {
  animation: stepCheckmarkPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes stepCheckmarkPop {
  0% {
    transform: scale(0.82);
  }
  50% {
    transform: scale(1.26);
  }
  100% {
    transform: scale(1);
  }
}

/* Current Due Step - Animated Pulse Glow */
.loan-step-pill.step-current {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.6);
  animation: pulse-due 2s infinite;
  transform: scale(1.05);
}

.loan-step-pill.step-current:hover {
  transform: scale(1.12);
}

@keyframes pulse-due {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

/* Future Step */
.loan-step-pill.step-future {
  background: var(--bg-hover);
  color: var(--text-muted);
  border-color: var(--border-subtle);
  opacity: 0.7;
}

.loan-step-pill.step-future:hover {
  opacity: 1;
  border-color: var(--text-muted);
}

/* Card Footer & Pay Action */
.loan-card-footer {
  margin-top: auto;
}

.loan-action-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.loan-pay-btn {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 640px) {
  .loan-pay-btn {
    max-width: none;
    width: 100%;
  }
}

.loan-pay-btn:hover {
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-pop-anim {
  animation: pop-bounce 0.35s ease-out;
}

@keyframes pop-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}

.loan-complete-banner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  font-size: 0.85rem;
  font-weight: 700;
}

.btn-link-subtle {
  background: none;
  border: none;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.78rem;
  padding: 0.2rem 0.4rem;
}

.btn-link-subtle:hover {
  color: var(--text-main);
}

/* Light mode adjustments */
[data-theme="light"] .loans-overview-banner {
  background: #ffffff;
}

[data-theme="light"] .loan-card {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .loan-vis-row {
  background: #f8fafc;
}

/* ==========================================================================
   MOBILE & TOUCH REFINEMENTS
   ========================================================================== */
@media (max-width: 480px) {
  .tx-card {
    padding: 0.75rem 0.85rem;
    gap: 0.65rem;
  }
  .tx-category-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }
  .tx-left {
    gap: 0.65rem;
  }
  .tx-right {
    gap: 0.5rem;
  }
  .tx-amount {
    font-size: 0.95rem;
  }
  .loan-numbers-grid {
    gap: 0.5rem 0.6rem;
  }
  .loan-num-item .num-value {
    font-size: 0.88rem;
  }
}

/* ==========================================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ========================================================================== */
@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;
  }
  .streak-flame,
  .loan-step-pill.step-current,
  .loan-step-pill.step-just-paid,
  .loan-card.just-completed-celebrate,
  .transactions-list.slide-forward,
  .transactions-list.slide-backward,
  .month-label-forward,
  .month-label-backward,
  .privacy-dissolving,
  .privacy-btn-spin,
  .touch-ripple-effect,
  .counter-pulse-active,
  .btn-pop-anim,
  .tx-card {
    animation: none !important;
  }
  .loan-progress-ring .ring-fill {
    transition: none !important;
  }
}

/* ==========================================================================
   ADMIN MANAGEMENT & USER APPROVAL SYSTEM
   ========================================================================== */

/* Role Badges */
/* Minimalist Role Badges */
.badge-role-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-role-pill.role-admin {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: none;
}

.badge-admin-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Pending Gate Screen */
.auth-pending-icon-wrapper {
  margin: 0.5rem auto 1rem;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.12);
  border: 2px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.2);
}

.auth-pending-icon {
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-due 2s infinite ease-in-out;
}

.badge-pill {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Admin Panel in Settings */
.admin-settings-panel {
  background: var(--bg-surface);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.35), 0 0 15px rgba(99, 102, 241, 0.08);
  transition: padding 0.25s ease, border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease;
}

.admin-panel-header:hover {
  opacity: 0.95;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Collapsed / Minimized Admin Panel State (default) */
.admin-settings-panel.is-collapsed {
  padding: 1.1rem 1.4rem;
  border-color: rgba(99, 102, 241, 0.2);
  background: linear-gradient(135deg, var(--bg-surface), rgba(99, 102, 241, 0.03));
}

.admin-settings-panel.is-collapsed:hover {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 6px 24px -6px rgba(0, 0, 0, 0.35), 0 0 16px rgba(99, 102, 241, 0.12);
}

.admin-settings-panel.is-collapsed .admin-panel-header {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.admin-settings-panel.is-collapsed .admin-collapsible-body {
  display: none !important;
}

.admin-settings-panel.is-collapsed .admin-action-btn {
  display: none !important;
}

.admin-settings-panel:not(.is-collapsed) .badge-admin-summary {
  display: none;
}

.badge-admin-summary {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.25);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-admin-summary.has-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.admin-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-toggle-btn:hover {
  background: rgba(99, 102, 241, 0.22);
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.45);
}

.admin-toggle-icon {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  vertical-align: middle;
}

.admin-settings-panel:not(.is-collapsed) .admin-toggle-icon,
.admin-settings-panel.is-expanded .admin-toggle-icon {
  transform: rotate(180deg);
}

.admin-collapsible-body {
  animation: adminExpandFade 0.25s ease-in-out;
}

@keyframes adminExpandFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.admin-shield-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Admin Stats Overview Cards */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}

.admin-stat-card.card-highlight-warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), transparent);
}

.admin-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.admin-stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
  line-height: 1;
}

/* Subsection & Pending List */
.admin-subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.admin-subsection-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.admin-pending-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-pending-card {
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  transition: all var(--transition-fast);
}

.admin-pending-card:hover {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
}

.pending-card-user {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pending-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-empty-state {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
}

/* Users Directory Table */
.admin-table-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.admin-users-table th {
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
}

.admin-users-table td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.admin-users-table tr:last-child td {
  border-bottom: none;
}

.admin-users-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.user-td-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-td-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.admin-action-btn-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

/* Light Mode Refinements for Admin Panel & Table */
[data-theme="light"] .admin-settings-panel.is-collapsed {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .admin-title-heading {
  color: #4338ca !important;
}

[data-theme="light"] .admin-shield-icon {
  background: #e0e7ff;
  color: #4338ca;
}

[data-theme="light"] .badge-admin-summary {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

[data-theme="light"] .admin-toggle-btn {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

[data-theme="light"] .admin-toggle-btn:hover {
  background: #c7d2fe;
  color: #312e81;
}

[data-theme="light"] .admin-stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .admin-stat-card.card-highlight-warning {
  background: #fffbeb;
  border-color: #fde68a;
}

[data-theme="light"] .admin-pending-card {
  background: #ffffff;
  border-color: #fcd34d;
}

[data-theme="light"] .admin-empty-state {
  background: #f8fafc;
  color: #64748b;
  border-color: #cbd5e1;
}

[data-theme="light"] .admin-table-responsive {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .admin-users-table th {
  background: #f8fafc;
  color: #475569;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .admin-users-table td {
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .admin-users-table tr:hover td {
  background: #f1f5f9;
}

/* ==========================================================================
   PRINT MEDIA STYLESHEET
   ========================================================================== */
@media print {
  .top-header,
  .mobile-nav,
  .sidebar,
  .fab-btn,
  .modal-backdrop,
  .modal-dialog,
  .btn-icon,
  .btn-icon-subtle,
  .btn-icon-only,
  .categories-header-actions,
  .loans-header-actions,
  .loan-card-footer,
  .month-step-btn,
  .rotating-chevron-icon,
  .filter-selects-group,
  .btn-toggle-include,
  #btn-view-badges {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 11pt !important;
  }

  .main-content,
  .app-layout,
  .app-view,
  .dashboard-content-grid {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
  }

  .card,
  .stat-card,
  .wallet-card,
  .loan-card,
  .category-card,
  .tx-card {
    background: #ffffff !important;
    border: 1px solid #d1d5db !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
    color: #111827 !important;
    margin-bottom: 0.75rem !important;
  }

  .stat-amount,
  .wallet-balance-amount,
  .num-value,
  .tx-amount {
    color: #111827 !important;
  }
}


