/* ============================================================
   PLANNER FINANCEIRO — Component Styles
   ============================================================ */

/* ---------- Sidebar / Navbar ---------- */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
}

.sidebar:hover {
  width: var(--sidebar-w);
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

/* Brand */
.sidebar-brand {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  overflow: hidden;
}

.sidebar-brand .brand-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.brand-app-name {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: flex;
}

.brand-rest {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.25s ease, opacity 0.2s ease;
}

.sidebar:hover .brand-rest {
  max-width: 120px;
  opacity: 1;
}

.sidebar-brand .brand-house {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.2s, max-width 0.25s;
}

.sidebar:hover .sidebar-brand .brand-house {
  opacity: 1;
  max-width: 160px;
}

/* Nav */
.sidebar-nav {
  padding: var(--space-2) 0;
  flex: 1;
  overflow: hidden;
}

.sidebar:hover .sidebar-nav {
  padding: var(--space-2);
}

.sidebar-section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-4);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.sidebar:hover .sidebar-section-label {
  opacity: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 0;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  margin-bottom: 2px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: center;
  justify-content: center;
  box-sizing: border-box;
}

.sidebar:hover .nav-item {
  justify-content: flex-start;
  text-align: left;
  padding: 10px var(--space-3);
  gap: var(--space-3);
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-subtle);
  color: var(--accent);
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 22px;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.nav-item .nav-label {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s, max-width 0.25s;
}

.sidebar:hover .nav-item .nav-label {
  opacity: 1;
  max-width: 160px;
}

/* Footer */
.sidebar-footer {
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border);
}

.sidebar-footer .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 0;
  overflow: hidden;
  white-space: nowrap;
  border-radius: var(--radius-md);
  gap: 0;
}

.sidebar:hover .sidebar-footer .btn {
  justify-content: flex-start;
  padding: 10px var(--space-3);
  gap: var(--space-3);
}

.sidebar-footer .btn .btn-label {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.2s, max-width 0.25s;
}

.sidebar:hover .sidebar-footer .btn .btn-label {
  opacity: 1;
  max-width: 160px;
}

/* User bar */
.sidebar-user-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  gap: 0;
}

.sidebar:hover .sidebar-user-bar {
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  gap: var(--space-3);
}

.sidebar-user-left {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  flex-shrink: 0;
}

.sidebar:hover .sidebar-user-left {
  gap: var(--space-3);
}

.sidebar-user-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.2s 0.05s, max-width 0.25s;
}

.sidebar:hover .sidebar-user-actions {
  opacity: 1;
  max-width: 100px;
}

.user-details {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s, max-width 0.25s;
}

.sidebar:hover .user-details {
  opacity: 1;
  max-width: 120px;
}

.theme-toggle-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  font-size: 15px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  line-height: 1;
}

.theme-toggle-btn:hover {
  background: var(--border);
  border-color: var(--border-light);
  transform: rotate(20deg);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}

.user-info:hover { background: var(--bg-tertiary); }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.user-details {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---------- Insights Accordion ---------- */
.insights-header {
  cursor: pointer;
  user-select: none;
  margin-bottom: 0 !important;
}

.insights-header:hover .card-title {
  color: var(--accent);
}

.insights-chevron {
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  line-height: 1;
}

.insights-collapsible {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease;
}

.insights-collapsible.open {
  max-height: 2000px;
  padding-top: var(--space-5);
}

/* ---------- Insight Cards ---------- */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.insight-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  transition: border-color var(--transition), transform var(--transition);
}

.insight-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.insight-card.positive .insight-body { border-left: 3px solid var(--success); padding-left: var(--space-3); }
.insight-card.negative .insight-body { border-left: 3px solid var(--danger);  padding-left: var(--space-3); }
.insight-card.neutral  .insight-body { border-left: 3px solid var(--accent);  padding-left: var(--space-3); }
.insight-card.warning  .insight-body { border-left: 3px solid var(--warning); padding-left: var(--space-3); }

.insight-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.insight-card.positive .insight-icon { background: var(--success-subtle); }
.insight-card.negative .insight-icon { background: var(--danger-subtle); }
.insight-card.neutral  .insight-icon { background: var(--accent-subtle); }
.insight-card.warning  .insight-icon { background: var(--warning-subtle); }

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

.insight-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.insight-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- Transaction List ---------- */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  transition: background var(--transition);
  cursor: default;
}

.transaction-item:hover { background: var(--bg-tertiary); }

.transaction-category-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

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

.transaction-desc {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.transaction-amount {
  font-size: var(--text-base);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.transaction-amount.income  { color: var(--success); }
.transaction-amount.expense { color: var(--danger); }

.transaction-actions {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition);
}

.transaction-item:hover .transaction-actions { opacity: 1; }

/* Transaction date group header */
.transaction-date-header {
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: var(--space-3);
}

/* ---------- Category Bar ---------- */
.category-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.category-bar-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.category-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
}

.category-bar-name {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-weight: 500;
}

.category-bar-amount { color: var(--text-muted); }

.cat-limit-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.cat-limit-edit-btn {
  opacity: 0;
  transition: opacity var(--transition);
  font-size: 12px;
  padding: 2px 4px;
}

.category-bar-item:hover .cat-limit-edit-btn { opacity: 1; }

.cat-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.cat-bar-row .progress-bar {
  flex: 1;
}

.cat-bar-pct {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.cat-limit-status.ok   { color: var(--text-muted); }
.cat-limit-status.near { color: var(--warning); }
.cat-limit-status.over { color: var(--danger); font-weight: 600; }

.progress-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* ---------- Upload Zone ---------- */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-secondary);
  margin-bottom: var(--space-6);
  cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.upload-zone-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

.upload-zone h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.upload-zone p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.upload-zone input[type="file"] {
  display: none;
}

/* ---------- Processing Steps ---------- */
.processing-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.step-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.step-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.step-item.pending  .step-icon { background: var(--bg-tertiary); color: var(--text-muted); }
.step-item.running  .step-icon { background: var(--info-subtle); color: var(--info); }
.step-item.done     .step-icon { background: var(--success-subtle); color: var(--success); }
.step-item.error    .step-icon { background: var(--danger-subtle); color: var(--danger); }

.step-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  flex: 1;
}

.step-item.running .step-label { color: var(--text-primary); }
.step-item.done .step-label    { color: var(--success); }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---------- Tab Navigation ---------- */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
}

.tab-btn {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
}

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

/* ---------- Login Page ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  padding: var(--space-4);
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-8);
}

.auth-logo .logo-icon {
  font-size: 40px;
  margin-bottom: var(--space-3);
}

.auth-logo h1 {
  font-size: var(--text-2xl);
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-1);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--space-6);
}

.auth-tab-btn {
  padding: 8px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.auth-tab-btn.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ---------- Household Invite ---------- */
.invite-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-4);
}

.invite-code {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  text-align: center;
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin: var(--space-2) 0;
  cursor: pointer;
  transition: background var(--transition);
}

.invite-code:hover { background: var(--bg-primary); }

/* ---------- Custom Select ---------- */
.custom-select {
  position: relative;
  user-select: none;
}

.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  min-height: 42px;
  text-align: left;
}

.custom-select-trigger:hover {
  border-color: var(--border-light);
}

.custom-select.open .custom-select-trigger {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.cs-placeholder { color: var(--text-muted); flex: 1; }
.cs-label       { color: var(--text-primary); flex: 1; font-weight: 500; }
.cs-icon        { font-size: 17px; flex-shrink: 0; width: 22px; text-align: center; }

.cs-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.custom-select.open .cs-chevron {
  transform: rotate(180deg);
}

/* Dropdown list */
.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: dropdown-in 0.12s ease;
  overflow: hidden;
}

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

.csd-inner {
  max-height: 230px;
  overflow-y: auto;
  padding: var(--space-1);
}

.csd-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-align: left;
}

.csd-option:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.csd-option.selected {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

.csd-check {
  width: 13px;
  height: 13px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--accent);
}

.csd-empty {
  padding: var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Compact variant for filter bar (doesn't stretch) */
.custom-select-trigger:has(.cs-placeholder) {
  color: var(--text-muted);
}

/* ---------- View Switcher (page) ---------- */
.view-switcher-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.view-switcher-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.view-switcher {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.view-btn {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.view-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.view-btn.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.view-you {
  font-size: 10px;
  font-weight: 600;
  background: var(--accent-subtle);
  color: var(--accent);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.3px;
}

/* Couple view accent */
.view-btn[data-view="couple"].active {
  background: var(--bg-secondary);
}

/* ---------- Goal Cards ---------- */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-5);
}

.goal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: relative;
  transition: border-color var(--transition), transform var(--transition);
}

.goal-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.goal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.goal-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.goal-card-actions {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition);
  flex-shrink: 0;
}

.goal-card:hover .goal-card-actions {
  opacity: 1;
}

.goal-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}

.goal-badge.complete  { background: var(--success-subtle); color: var(--success); }
.goal-badge.on-track  { background: var(--success-subtle); color: var(--success); }
.goal-badge.behind    { background: var(--warning-subtle); color: var(--warning); }
.goal-badge.expired   { background: var(--danger-subtle);  color: var(--danger); }

.goal-progress-bar {
  height: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.goal-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.goal-progress-fill.complete { background: var(--success); }
.goal-progress-fill.on-track { background: var(--saving); }
.goal-progress-fill.behind   { background: var(--warning); }
.goal-progress-fill.expired  { background: var(--danger); }

.goal-amounts {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.goal-amount-saved {
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.goal-amount-target {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.goal-pct {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  margin-left: auto;
}

.goal-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.goal-meta span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ---------- Month Picker ---------- */
.month-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.month-nav span {
  font-size: var(--text-sm);
  font-weight: 600;
  min-width: 120px;
  text-align: center;
  color: var(--text-primary);
}

/* ---------- Recurring Expenses ---------- */
.recurring-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.recurring-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-color 0.2s;
}

.recurring-item:hover {
  border-color: var(--border-hover, var(--accent));
}

.recurring-item.inactive {
  opacity: 0.5;
}

.recurring-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.recurring-item-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}

.recurring-item-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recurring-item-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.recurring-category {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.due-day-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.recurring-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
}

.recurring-item-amount {
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.recurring-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  white-space: nowrap;
}

.recurring-badge.launched {
  background: var(--success-subtle);
  color: var(--success);
}

.recurring-badge.pending {
  background: var(--warning-subtle);
  color: var(--warning);
}

.recurring-item-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.recurring-item-actions .rec-launch-btn {
  margin-right: auto;
}

/* ============================================================
   Budget page
   ============================================================ */

/* Summary grid — 3 columns (reuses stat-card styles) */
.budget-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

/* Budget table */
.budget-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.budget-header {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-1);
}

.budget-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.8fr;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-1);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.budget-row:hover:not(.budget-header) {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

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

.budget-col-cat {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.budget-cat-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.budget-cat-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.budget-col-budgeted,
.budget-col-spent,
.budget-col-remaining {
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.budget-pct-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Clickable budgeted amount */
.budget-amount-display {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px dashed var(--border-light);
  transition: color var(--transition), border-color var(--transition);
  display: inline-block;
  align-self: flex-start;
  width: fit-content;
}

.budget-amount-display:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.budget-amount-empty {
  color: var(--text-muted);
  font-weight: 400;
}

/* Inline input */
.budget-inline-input {
  width: 100%;
  max-width: 110px;
  background: var(--bg-tertiary);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-subtle);
}

/* Progress bar */
.budget-progress {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.budget-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.budget-progress-fill.ok   { background: var(--success); }
.budget-progress-fill.warn { background: var(--warning); }
.budget-progress-fill.over { background: var(--danger); }

/* Section divider between budgeted and un-budgeted categories */
.budget-section-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.budget-section-divider::before,
.budget-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* 4-column stat grid (dashboard) */
.stat-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.stat-card.cumulative::before {
  background: var(--accent);
}

/* Responsive budget */
@media (max-width: 900px) {
  .budget-summary-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
  }

  .stat-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .budget-row {
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-2);
  }

  .budget-col-remaining,
  .budget-col-bar,
  .budget-header .budget-col-remaining,
  .budget-header .budget-col-bar {
    display: none;
  }
}

@media (max-width: 768px) {
  /* Budget page header: stack title centered, keep actions in one row */
  .budget-page-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
  }

  .budget-page-header-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    flex-wrap: nowrap;
  }

  /* Compact copy button on mobile */
  #copy-prev-btn {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-3);
    white-space: nowrap;
  }

  /* Summary: orçado + gasto side by side, saldo full width below */
  .budget-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
  }

  .budget-summary-grid .stat-card:last-child {
    grid-column: 1 / -1;
  }

  .budget-summary-grid .stat-card {
    padding: var(--space-3);
  }

  .budget-summary-grid .stat-value {
    font-size: var(--text-lg);
  }

  .budget-row {
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-2);
  }

  .budget-col-remaining,
  .budget-col-bar,
  .budget-header .budget-col-remaining,
  .budget-header .budget-col-bar {
    display: none;
  }
}

@media (max-width: 480px) {
  .budget-row {
    grid-template-columns: 2fr 1fr;
  }

  .budget-col-spent,
  .budget-header .budget-col-spent {
    display: none;
  }
}

/* ============================================================
   Reports page
   ============================================================ */

/* Period toggle (6M / 12M) */
.chart-toggle {
  display: flex;
  gap: var(--space-2);
}

.chart-toggle-btn {
  padding: 7px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

.chart-toggle-btn:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.chart-toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Chart container */
.chart-container {
  padding: var(--space-2) 0;
  position: relative;
  overflow: hidden;
}

/* Chart legend */
.chart-legend {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Tooltip */
.chart-tooltip {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
}

/* Report summary table */
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.report-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.report-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.report-table td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

.report-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.report-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.report-table tbody tr.current-month {
  background: var(--accent-subtle);
}

.report-table tbody tr.current-month td:first-child::after {
  content: ' ←';
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
}

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

@media (max-width: 600px) {
  .report-table th:nth-child(4),
  .report-table td:nth-child(4) {
    display: none;
  }
}

/* ---------- Notification Bell (Feature 1) ---------- */
.notif-bell-wrap {
  position: relative;
}

.notif-bell-btn {
  position: relative;
  border-radius: var(--radius-full);
  font-size: 18px;
  width: 36px;
  height: 36px;
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.notif-panel {
  position: fixed;
  width: 300px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 400px;
  overflow-y: auto;
}

.notif-panel-header {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
}

.notif-empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.notif-item-wrap {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}

.notif-item-wrap:last-child { border-bottom: none; }

.notif-item-wrap:hover { background: var(--bg-tertiary); }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  flex: 1;
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--transition);
  border-left: 3px solid transparent;
}

.notif-dismiss-one {
  opacity: 0;
  padding: 0 var(--space-3);
  color: var(--text-muted);
  font-size: 11px;
  transition: opacity var(--transition);
  border-left: 1px solid var(--border);
  border-radius: 0;
}

.notif-item-wrap:hover .notif-dismiss-one { opacity: 1; }

.notif-item.danger  { border-left-color: var(--danger); }
.notif-item.warning { border-left-color: var(--warning); }

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-severity-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

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

.notif-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.notif-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
  word-break: break-word;
}

/* ---------- Pending Recurring Alert Card (Feature 2) ---------- */
.alert-card-recurring {
  background: var(--warning-subtle);
  border: 1px solid var(--warning);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.alert-card-recurring .alert-text {
  color: var(--warning);
  font-weight: 500;
  font-size: var(--text-sm);
}

.alert-card-recurring a {
  color: var(--warning);
  font-weight: 600;
  text-decoration: underline;
  font-size: var(--text-sm);
  white-space: nowrap;
}

.alert-card-recurring a:hover {
  color: var(--text-primary);
}

/* ---------- Inline Edit Inputs (Feature 3) ---------- */
.tx-inline-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--accent);
  color: var(--text-primary);
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  outline: none;
  padding: 0;
  cursor: text;
}

.tx-inline-input-amount {
  text-align: right;
  width: 100px;
}

/* ---------- Bank Selector (Upload page) ---------- */
.bank-selector {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.bank-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: all var(--transition);
  min-width: 110px;
  position: relative;
}

.bank-btn:hover:not([disabled]) {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.bank-btn.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

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

.bank-btn-icon { font-size: 24px; }

.bank-btn-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.bank-btn-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--success-subtle);
  color: var(--success);
}

.bank-btn-badge.soon {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ---------- Installment Badge (Upload preview) ---------- */
.installment-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(99,102,241,0.2);
}

.installment-badge::before { content: '🔁 '; }

.future-dot { font-size: 11px; }

/* ---------- Categories Page ---------- */
.cat-tabs {
  display: flex;
  gap: var(--space-2);
}

.cat-tab {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.cat-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  transition: border-color var(--transition);
}

.cat-card:hover { border-color: var(--border-light); }

.cat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

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

.cat-card-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.cat-card-limit {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.cat-card-actions {
  display: flex;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition);
}

.cat-card:hover .cat-card-actions { opacity: 1; }

/* ---------- Installments List (Transactions page) ---------- */
.installments-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.installment-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}

.installment-row-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

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

.installment-row-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.installment-row-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.installment-row-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.installment-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.installment-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.installment-row-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

.installment-row-amount { text-align: right; flex-shrink: 0; }

/* ---------- Date Range Filter (Transactions page) ---------- */
.date-range-inputs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.date-range-inputs .form-control-sm {
  width: 140px;
  padding: 6px 10px;
  font-size: var(--text-xs);
}

/* ============================================================
   Dashboard Charts Row
   ============================================================ */
.dashboard-charts-row {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: var(--space-6);
}

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

/* ---------- Budget Donut ---------- */
.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-2) var(--space-2) var(--space-4);
}

.donut-stats {
  display: flex;
  justify-content: space-around;
  width: 100%;
  margin-top: var(--space-3);
}

.donut-stat {
  text-align: center;
}

.donut-stat-value {
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.donut-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Compact Insights ---------- */
.insights-compact .insights-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
}

.insights-compact .insight-card {
  padding: 8px 10px;
  gap: var(--space-2);
}

.insights-compact .insight-icon {
  font-size: 1rem;
  min-width: 24px;
}

.insights-compact .insight-title {
  font-size: var(--text-xs);
  font-weight: 600;
}

.insights-compact .insight-text {
  font-size: 0.7rem;
  line-height: 1.4;
}

.insights-compact .empty-state {
  padding: var(--space-4);
}

.insights-compact .empty-state h3 {
  font-size: var(--text-sm);
}

.insights-compact .empty-state p {
  font-size: var(--text-xs);
}

/* ============================================================
   Dashboard Hero
   ============================================================ */
.dashboard-hero {
  background: linear-gradient(135deg, var(--accent) 0%, #3a2aaa 60%, #26196e 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-8);
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  margin-bottom: var(--space-1);
}

.hero-subtitle {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.65);
}

.hero-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.month-nav-hero {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: rgba(255,255,255,0.85);
}

.month-nav-hero span {
  color: #ffffff;
}

.month-nav-hero .btn-ghost {
  color: rgba(255,255,255,0.7);
}

.month-nav-hero .btn-ghost:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.12);
}

.btn-hero-add {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.btn-hero-add:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.18;
  pointer-events: none;
}

.hero-blob-1 {
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.4);
  top: -60px;
  right: 80px;
}

.hero-blob-2 {
  width: 140px;
  height: 140px;
  background: rgba(255,255,255,0.3);
  bottom: -50px;
  right: 20px;
}

/* ============================================================
   Dashboard Hero — mobile
   ============================================================ */
@media (max-width: 768px) {
  .dashboard-hero {
    padding: var(--space-5) var(--space-5);
  }

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-right {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
  }

  .month-nav-hero {
    justify-content: center;
  }

  .btn-hero-add {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   Goal Cards — status accent
   ============================================================ */
.goal-card.complete { border-left: 3px solid var(--success); }
.goal-card.on-track { border-left: 3px solid var(--saving); }
.goal-card.behind   { border-left: 3px solid var(--warning); }
.goal-card.expired  { border-left: 3px solid var(--danger); }

/* Budget header columns — match font size/weight of category column */
.budget-header .budget-col-budgeted,
.budget-header .budget-col-spent,
.budget-header .budget-col-remaining {
  font-size: inherit;
  font-weight: inherit;
}

/* ============================================================
   Recurring page — mobile layout
   ============================================================ */
.recurring-page-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.recurring-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.recurring-btns {
  display: flex;
  gap: var(--space-2);
  flex-wrap: nowrap;
}

@media (max-width: 768px) {
  .recurring-page-header {
    align-items: center;
    text-align: center;
  }

  .recurring-header-actions {
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
  }

  .recurring-header-actions .month-nav {
    justify-content: center;
  }

  .recurring-btns {
    width: 100%;
    justify-content: center;
  }

  .recurring-btns .btn {
    justify-content: center;
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-5);
    white-space: nowrap;
    border-radius: var(--radius-md);
  }
}

/* ============================================================
   Recurring — pending accent
   ============================================================ */
.recurring-item.pending-launch { border-left: 3px solid var(--warning); }
.recurring-item.launched-item  { border-left: 3px solid var(--success); }

/* ============================================================
   Mobile Chrome — top bar, bottom nav, overlay, drawer
   ============================================================ */

/* Top bar */
.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 300;
  align-items: center;
  padding: 0 var(--space-3);
  gap: var(--space-2);
}

.mobile-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}

.mobile-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.2s;
}

.mobile-brand {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
  letter-spacing: 0.5px;
}

.mobile-topbar-btn {
  background: none;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  line-height: 1;
}

/* Bottom nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  z-index: 300;
  flex-direction: row;
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  padding: var(--space-1) 0;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item.active { color: var(--accent); }
.mobile-nav-item:active  { opacity: 0.7; }

.mobile-nav-icon  { font-size: 20px; line-height: 1; }
.mobile-nav-label { font-size: 10px; font-weight: 500; white-space: nowrap; }

/* Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 255;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mobile-overlay.active { display: block; }

/* Sidebar as drawer on mobile */
@media (max-width: 768px) {
  .mobile-topbar     { display: flex; }
  .mobile-bottom-nav { display: flex; }

  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh !important;
    width: var(--sidebar-w) !important;
    min-width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 260;
  }

  .sidebar .sidebar-brand { display: none; }

  /* Cancel hover expansion on touch devices */
  .sidebar:hover {
    width: var(--sidebar-w) !important;
    box-shadow: none;
    transform: translateX(-100%);
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 32px rgba(0,0,0,0.35);
    overflow: hidden !important;
    overflow-y: auto !important;
  }

  .sidebar.mobile-open .sidebar-nav {
    overflow: visible;
    flex: unset;
  }

  /* Show all labels when drawer is open */
  .sidebar.mobile-open .brand-rest                     { max-width: 120px; opacity: 1; }
  .sidebar.mobile-open .sidebar-brand .brand-house      { opacity: 1; max-width: 200px; }
  .sidebar.mobile-open .sidebar-section-label           { opacity: 1; }
  .sidebar.mobile-open .sidebar-nav                     { padding: var(--space-2); }
  .sidebar.mobile-open .nav-item                        { justify-content: flex-start; text-align: left; padding: 10px var(--space-3); gap: var(--space-3); }
  .sidebar.mobile-open .nav-item .nav-label             { opacity: 1; max-width: 180px; }
  .sidebar.mobile-open .sidebar-footer .btn             { justify-content: flex-start; padding: 10px var(--space-3); gap: var(--space-3); }
  .sidebar.mobile-open .sidebar-footer .btn .btn-label  { opacity: 1; max-width: 180px; }
  .sidebar.mobile-open .sidebar-user-bar                { justify-content: space-between; padding: var(--space-3) var(--space-4); gap: var(--space-3); }
  .sidebar.mobile-open .user-details                    { opacity: 1; max-width: 140px; }
  .sidebar.mobile-open .sidebar-user-left               { gap: var(--space-3); }
  .sidebar.mobile-open .sidebar-user-actions            { opacity: 1; max-width: 100px; }
}
