:root {
  /* Colors from colors.ts */
  --text: #0F172A;
  --tint: #1D4ED8;
  --background: #F0F4FF;
  --foreground: #0F172A;
  --card: #FFFFFF;
  --card-foreground: #0F172A;
  --primary: #1D4ED8;
  --primary-foreground: #FFFFFF;
  --secondary: #EEF2FF;
  --secondary-foreground: #1D4ED8;
  --muted: #F1F5F9;
  --muted-foreground: #64748B;
  --accent: #059669;
  --accent-foreground: #FFFFFF;
  --destructive: #DC2626;
  --destructive-foreground: #FFFFFF;
  --border: #E2E8F0;
  --input: #E2E8F0;
  
  --income: #059669;
  --expense: #DC2626;
  --transfer: #D97706;

  --hero: #1E3A8A;
  --hero-foreground: #FFFFFF;
  
  --radius: 12px;
}

/* Global Reset & Base Layout based on index.html reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--background);
  color: var(--text);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden; /* Prevent body bounce scrolling */
}

/* Budgets View Interface Layout Grid adjustments */
.budgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.budget-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

.budget-card.over-spent {
    border-color: rgba(220, 38, 38, 0.4);
    background: linear-gradient(180deg, var(--card), rgba(220, 38, 38, 0.02));
}

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

.category-indicator-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.budget-title {
    font-size: 1.1rem;
    color: var(--text);
}

.btn-delete-budget {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: color 0.15s ease;
}

.btn-delete-budget:hover {
    color: var(--destructive);
}

.budget-pricing-summary {
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.pricing-spent {
    font-weight: 600;
}

.pricing-limit {
    color: var(--muted-foreground);
}

/* Progress Indicator Track Framework components */
.progress-track {
    background-color: var(--muted);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.35s linear;
}

.budget-card.over-spent .progress-bar-fill {
    background-color: var(--destructive) !important;
}

.budget-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.period-pill {
    text-transform: capitalize;
    background: var(--secondary);
    color: var(--secondary-foreground);
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 500;
}

.remaining-calc {
    font-weight: 500;
}

.over-spent .remaining-calc {
    color: var(--destructive);
}

/* Modals Overlay Configurations */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 27, 42, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--card);
    padding: 24px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-x {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted-foreground);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group select, .form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--text);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}
/* Metrics Summary Block Customization rules */
.metrics-summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.nested-card-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted-foreground);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.inline-metric-input {
    width: 100%;
    padding: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: monospace;
}

/* Strategy Modifier Selection Deck bar settings */
.strategy-selector-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    background: var(--muted);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 28px;
    border: 1px solid var(--border);
}

.strategy-info h3 {
    margin: 0;
    font-size: 1.1rem;
}

.strategy-info .muted-text {
    font-size: 0.85rem;
    margin-top: 4px;
}

.toggle-switch-container {
    display: flex;
    background: var(--background);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.strategy-toggle-btn {
    background: transparent;
    border: none;
    color: var(--muted-foreground);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.strategy-toggle-btn.active {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Priority Queue Stack Row items */
.debt-priority-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.debt-item-row {
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0,0,0,0.01);
}

.rank-badge {
    background: var(--secondary);
    color: var(--secondary-foreground);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 20px;
    border: 1px solid var(--border);
}

.debt-identity-details {
    flex: 2;
    min-width: 200px;
}

.debt-name-title {
    font-size: 1.1rem;
    color: var(--text);
    display: block;
}

.debt-specs-sub {
    font-size: 0.85rem;
    color: var(--muted-foreground);
    margin-top: 4px;
}

.debt-specs-sub .divider {
    margin: 0 6px;
    color: var(--border);
}

.highlight-text {
    color: var(--text);
    font-weight: 600;
}

.debt-velocity-focus {
    flex: 1;
    min-width: 150px;
    padding-right: 24px;
}

.allocated-payment-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--muted-foreground);
    letter-spacing: 0.02em;
}

.allocated-payment-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #059669; /* Emerald allocation highlights */
}

.debt-balance-focus {
    flex: 1;
    min-width: 140px;
}

.debt-balance-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.payoff-estimate-badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.08);
    color: #2563EB;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
}

.debt-action-cell {
    margin-left: 20px;
}

.btn-delete-debt {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: color 0.15s ease;
    line-height: 1;
}

.btn-delete-debt:hover {
    color: var(--destructive);
}