/* Import Modern Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* CSS VARIABLES FOR THEME */
:root {
    --bg-primary: #F8F6F4;          /* Monarch-inspired warm light gray background */
    --card-bg: #FFFFFF;             /* Pure white card backgrounds */
    --text-primary: #1E1F21;        /* Muted black for primary headers and text */
    --text-secondary: #71767B;      /* Gray for secondary/sub text */
    --brand-primary: #FF5A1F;       /* Monarch Signature Orange */
    --brand-primary-hover: #E04810; /* Darker orange for hover states */
    --brand-light: #FFF2EB;         /* Very light orange tint for subtle highlights */
    --success: #1E8556;             /* Monarch Green for positive status/remaining */
    --success-light: #EBF7F0;       /* Light green background */
    --warning: #D9381E;             /* Red/Orange for warning/over budget */
    --warning-light: #FDF2F0;       /* Light red background */
    --border-color: #EDEDEB;        /* Warm light gray for borders */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.06), 0 4px 6px rgba(0, 0, 0, 0.03);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* PASSWORD PROTECT SCREEN */
#password-protect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(248, 246, 244, 0.96); /* Matching primary background color */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.password-card {
    width: 90%;
    max-width: 380px;
    padding: 40px 28px;
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.password-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    outline: none;
    margin-bottom: 8px;
    margin-top: 24px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: var(--transition-smooth);
}

.password-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.15);
    background-color: #FFFFFF;
}

.password-error {
    color: var(--warning);
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 16px;
    display: none;
}

/* GENERAL STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    font-weight: 600;
}

/* LAYOUT STRUCTURE */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR STYLES */
.sidebar {
    width: 260px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 28px 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 32px;
    height: 32px;
    fill: var(--brand-primary);
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--brand-primary), #FF7A45);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}

.menu-item a svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    fill: none;
    stroke-width: 2;
    transition: var(--transition-smooth);
}

.menu-item.active a {
    background-color: var(--brand-light);
    color: var(--brand-primary);
}

.menu-item.active a svg {
    stroke: var(--brand-primary);
}

.menu-item a:hover:not(.active a) {
    background-color: #F3F4F6;
    color: var(--text-primary);
}

.menu-item a:hover svg {
    stroke: var(--text-primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background-color: var(--brand-light);
    color: var(--brand-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid var(--brand-primary);
}

.user-info .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-info .user-status {
    font-size: 11px;
    color: var(--text-secondary);
}

/* MAIN CONTENT AREA */
.main-content {
    flex: 1;
    margin: 0 auto;
    max-width: 1200px;
    width: 100%;
    padding: 32px 24px;
    min-height: 100vh;
}

/* HEADER SECTION */
.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.header-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-title-area h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.month-badge {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.month-badge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--brand-primary);
    border-radius: 50%;
}

/* OVERVIEW STATS ROW */
.overview-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--brand-primary);
    opacity: 0.8;
}

.stat-card.remaining-positive::after {
    background-color: var(--success);
}

.stat-card.remaining-negative::after {
    background-color: var(--warning);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-subtext {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-subtext strong {
    color: var(--text-primary);
}

/* CONTENT GRID */
.content-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

/* TOP BUDGET SECTION LAYOUT */
.top-budget-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 32px;
    margin-bottom: 32px;
    align-items: stretch;
}

.top-budget-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: space-between;
}

.top-budget-stats .stat-card {
    margin-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.top-budget-chart-card {
    margin-bottom: 0;
    height: 100%;
}

/* CARD CONTAINER STYLE */
.dashboard-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 28px;
    margin-bottom: 32px;
    transition: var(--transition-smooth);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-lg);
}

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

.card-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    width: 24px;
    height: 24px;
    color: var(--brand-primary);
}

.card-title-group h2 {
    font-size: 20px;
    font-weight: 700;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* INCOME BREAKDOWN CUSTOM FORMAT */
.tax-breakdown-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    align-items: center;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-center-label {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.chart-center-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--success);
    font-family: 'Outfit', sans-serif;
}

.chart-center-sub {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.tax-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tax-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-primary);
    font-size: 13px;
}

.tax-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.tax-name {
    font-weight: 500;
}

.tax-val {
    font-weight: 600;
    color: var(--text-primary);
}

/* 3-COLUMN BUDGET CATEGORIES GRID */
.budget-table {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 1100px) {
    .budget-table {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .budget-table {
        grid-template-columns: 1fr;
    }
}

.budget-row {
    padding: 12px 14px; /* Reduced padding from 16px */
    background-color: #FFFFFF; /* Crisp white cards */
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px; /* Reduced gap from 12px */
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.budget-row:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.category-name-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-emoji {
    font-size: 18px;
}

.category-title {
    font-size: 13px;
    font-weight: 600;
}

.category-suggested {
    font-size: 9.5px;
    background-color: var(--brand-light);
    color: var(--brand-primary);
    padding: 1px 6px;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 4px;
}

.budget-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.currency-symbol {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.budget-input {
    width: 75px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    color: var(--text-primary);
    background-color: var(--card-bg);
    outline: none;
    transition: var(--transition-smooth);
}

.budget-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.15);
}

/* Custom visual progress bars */
.progress-bar-container {
    width: 100%;
    height: 6px; /* Reduced from 8px */
    background-color: #E5E7EB;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--brand-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.4s ease-out;
}

.progress-bar-info {
    display: flex;
    justify-content: space-between;
    font-size: 10px; /* Reduced from 11px */
    color: var(--text-secondary);
}

.progress-bar-info span strong {
    color: var(--text-primary);
}

/* Actions buttons styling */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--brand-primary);
    color: #FFFFFF;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background-color: var(--bg-primary);
    border-color: #C1C1C1;
}

.add-category-btn {
    width: 100%;
    margin-top: 10px;
    border-style: dashed;
    border-width: 1.5px;
    background-color: transparent;
    color: var(--text-secondary);
}

.add-category-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background-color: var(--brand-light);
}

/* SAVINGS ALLOCATOR STYLES */
.savings-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}

.savings-total-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.savings-total-val {
    font-size: 26px;
    font-weight: 800;
    color: var(--brand-primary);
    font-family: 'Outfit', sans-serif;
}

.savings-split-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.slider-group {
    background-color: var(--bg-primary);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.slider-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-label {
    font-size: 14px;
    font-weight: 600;
}

.slider-value-display {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-primary);
}

.slider-value-display.fixed-val {
    color: var(--text-secondary);
}

.slider-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #E5E7EB;
    outline: none;
    transition: background 0.3s;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-primary);
    cursor: pointer;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background-color: var(--brand-primary-hover);
}

.slider-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand-primary);
    cursor: pointer;
    border: 2px solid #FFFFFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

.slider-input::-moz-range-thumb:hover {
    transform: scale(1.15);
    background-color: var(--brand-primary-hover);
}

.slider-note {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: -4px;
}

/* INVESTMENT CARDS STYLES */
.investment-tabs-headers {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    gap: 8px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    color: var(--brand-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--brand-primary);
}

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

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-pane.active {
    display: block;
}

.investment-pane-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pane-badge {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 12px;
}

.pane-badge.roth {
    background-color: #ECFDF5;
    color: var(--success);
}

.pane-badge.robinhood {
    background-color: #EFF6FF;
    color: #3B82F6;
}

.pane-badge.hysa {
    background-color: #FEF3C7;
    color: #D97706;
}

.pane-title {
    font-size: 20px;
    font-weight: 700;
}

.pane-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.pane-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
}

.detail-card {
    background-color: var(--bg-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.detail-card-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.detail-card-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-card-val.yes {
    color: var(--success);
}

.detail-card-val.conditional {
    color: #D97706;
}

/* ANIMATIONS & KEYFRAMES */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVENESS */
@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .main-content {
        padding: 24px 16px;
    }
    .overview-row, .top-budget-grid, .expense-columns-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .tax-breakdown-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .main-content {
        padding: 16px;
    }
    .pane-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Category Delete Button styling */
.delete-cat-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    margin-left: 10px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    opacity: 0.4;
    transition: var(--transition-smooth);
}

.delete-cat-btn:hover {
    opacity: 1 !important;
    background-color: var(--warning-light);
    color: var(--warning) !important;
}

/* PRETAX 401K SELECTOR STYLE */
.pretax-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.pretax-selector-wrapper label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0;
}

.pretax-selector-wrapper select {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 700;
    border: none;
    background: transparent;
    outline: none;
    color: var(--brand-primary);
    cursor: pointer;
}

/* GLOBAL TOP-LEVEL TAB NAV STYLING */
.global-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 28px;
}

.global-tab-btn {
    padding: 12px 28px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.global-tab-btn:hover {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    transform: translateY(-1px);
}

.global-tab-btn.active {
    color: white;
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}

.global-tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.global-tab-pane.active {
    display: block;
}

