/* ─── HEADER & NAVIGATION ────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.left-bar {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  line-height: 1;
}

.view-segmented {
  display: flex;
  background: var(--bg);
  border: 1.5px solid var(--divider);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}
.view-seg-btn {
  padding: 6px 14px;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s ease, color 0.15s ease;
}
.view-seg-btn.active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  padding-left: 2px;
  padding-right: 4px;
  mask-image: linear-gradient(to right, transparent 0%, black 4%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 88%, transparent 100%);
}
.top-actions::-webkit-scrollbar { display: none; }

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  transition:
    opacity var(--dur-normal, 0.2s) var(--ease-out, ease),
    transform var(--dur-fast, 0.15s) var(--ease-out, ease),
    box-shadow var(--dur-normal, 0.2s) var(--ease-out, ease),
    background var(--dur-normal, 0.2s) var(--ease-out, ease);
  box-shadow: var(--shadow-xs);
  position: relative;
  padding: 4px;
}
.icon-btn:hover { opacity: 0.85; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.icon-btn:active { transform: translateY(0); }
.icon-btn.active { background: var(--accent-soft) !important; color: var(--accent) !important; }
.icon-btn svg { flex-shrink: 0; color: currentColor; }

.icon-btn-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.icon-btn-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #4A4A44;
  line-height: 1;
}

.icon-btn.light { background: var(--accent-soft); color: var(--accent); }
.icon-btn.purple { background: var(--accent); color: #fff; }
.icon-btn.dark { background: var(--text-primary); color: #fff; }

#shareLinkBox {
  display: none;
  background: var(--accent-soft);
  border-radius: var(--r-md);
  padding: 12px 14px;
  border: 1px solid var(--accent-mid);
  margin-top: 8px;
}

/* ─── SETTINGS MENU ──────────────────────────────────────── */
.settings-wrapper { position: relative; }

.settings-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  z-index: var(--z-dropdown);
  padding: 6px;
  animation: menuFadeIn 0.15s ease;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.settings-item {
  padding: 10px 14px;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  transition: background 0.15s ease, color 0.15s ease;
  font-weight: 400;
  gap: 8px;
}
.settings-item:hover { background: var(--bg); color: var(--text-primary); }
.settings-item.muted { color: var(--text-muted); cursor: not-allowed; }
.settings-item.muted:hover { background: transparent; color: var(--text-muted); }

.crown { font-size: 12px; color: #D4A600; }

.settings-divider { height: 1px; background: var(--divider); margin: 5px 0; }

.theme-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  flex-shrink: 0;
}

/* ─── RECURRING TRANSACTION VISUAL MARKERS ────────────────────── */
.txn-fixed {
  position: relative;
  border-left: 3px solid var(--accent);
}

/* Optional: Add a recurring icon indicator on the right side */
.txn-fixed::after {
  content: '↻';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--accent-mid);
  opacity: 0.7;
  pointer-events: none;
}

/* Dark theme adjustment */
body[data-theme="dark"] .txn-fixed::after {
  color: var(--accent-mid);
  opacity: 0.8;
}

/* Ocean theme adjustment */
body[data-theme="ocean"] .txn-fixed::after {
  color: var(--accent);
  opacity: 0.75;
}

/* Forest theme adjustment */
body[data-theme="forest"] .txn-fixed::after {
  color: var(--accent);
  opacity: 0.75;
}

/* Ensure the recurring badge in chip content and the pseudo-element don't conflict */
.txn-fixed .recurring-badge {
  margin-right: 4px;
}

/* Add a subtle background pattern for recurring chips on hover */
.txn-fixed:hover::after {
  opacity: 1;
  animation: spin 0.3s ease;
}

@keyframes spin {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

/* ─── USAGE BAR ──────────────────────────────────────────── */
.usage-bar-wrapper {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.usage-track {
  flex: 1;
  max-width: 200px;
  height: 4px;
  background: var(--divider);
  border-radius: 10px;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  border-radius: 10px;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1), background 0.3s ease;
  width: 0%;
}
.usage-fill.warn { background: #F59E0B; }
.usage-fill.full { background: var(--error); } 

.usage-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; font-weight: 400; letter-spacing: 0.2px; }
.usage-warn { font-size: 11px; color: #D97706; font-weight: 500; }

