/* --- 1. GLOBAL THEME VARIABLES --- */
:root {
    --primary-color: #1ABC9C;       /* Main Teal */
    --primary-dark: #16a085;        /* Darker Teal for hover */
    --nav-color: #2c3e50;           /* Navy */
    --bg-color: #ecf0f1;            /* Light Grey Background */
    --text-color: #2c3e50;          /* Dark Text */
    --muted-color: #7f8c8d;         /* Grey Text */
    --success-color: #27ae60;       /* Green */
    --danger-color: #e74c3c;        /* Red */
    --card-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* --- 2. BASE STYLES --- */
/* --- 2. BASE STYLES --- */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* --- STICKY FOOTER MAGIC --- */
    display: flex;             /* Turn body into a flex container */
    flex-direction: column;    /* Stack children vertically */
    min-height: 100vh;         /* Force body to be at least as tall as the screen */
}

h1, h2, h3, h4, h5, h6 {
    color: var(--nav-color);
    font-weight: 600;
}

/* --- 3. NAVIGATION (Fixed) --- */
.navbar {
    padding: 15px 0;
    background-color: #fff; /* Ensure bg is white */
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5em;
    color: var(--nav-color) !important;
}

.nav-link {
    color: #bdc3c7 !important; /* Light Grey default */
    margin-left: 15px;
    font-weight: 500;
    transition: color 0.2s;
}

/* FIX: Change hover/active to Primary Color instead of White */
.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: bold;
}

/* --- 4. CARDS & CONTAINERS --- */
.card {
    border: none;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease-in-out;
    margin-bottom: 24px;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    font-weight: bold;
    color: var(--nav-color);
    padding: 15px 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 12px 12px 0 0 !important;
}

/* --- 5. BUTTONS --- */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

/* --- 6. DASHBOARD WIDGETS --- */
.dash-widget {
    display: flex;
    align-items: center;
    padding: 24px;
}

.widget-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-right: 20px;
    flex-shrink: 0;
}

/* Widget Variants */
.widget-icon.income { background-color: rgba(39, 174, 96, 0.1); color: var(--success-color); }
.widget-icon.expense { background-color: rgba(231, 76, 60, 0.1); color: var(--danger-color); }
.widget-icon.balance { background-color: rgba(26, 188, 156, 0.1); color: var(--primary-color); }

.widget-content .label {
    font-size: 0.85rem;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 4px;
}

.widget-content .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--nav-color);
    line-height: 1;
}

/* --- 7. TRANSACTION TABLES & DATA --- */
.filter-bar {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.table-hover tbody tr:hover {
    background-color: rgba(26, 188, 156, 0.05); /* Light teal hover */
}

.transaction-amount {
    font-weight: 600;
    font-family: 'Consolas', monospace;
}

.transaction-name {
    cursor: pointer;
    border-bottom: 1px dashed #ccc;
    font-weight: 600;
}
.transaction-name:hover {
    color: var(--primary-color); /* Updated to match theme */
    border-bottom-color: var(--primary-color);
}

/* Badges & Pills */
.cat-badge {
    font-size: 0.75em;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    color: #777;
    text-transform: uppercase;
}

.tag-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    margin-right: 4px;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
    font-weight: 600;
}

.add-tag-btn { cursor: pointer; color: #bdc3c7; font-size: 0.9em; }
.add-tag-btn:hover { color: var(--nav-color); }

/* Type Selectors (Consolidated Style) */
.type-select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 0.85em;
    cursor: pointer;
    font-weight: 600;
}
/* Style: Light Background + Dark Text + Border */
.type-business { background-color: #e8f6f3; color: #16a085; border-color: #1abc9c; }
.type-personal { background-color: #ebf5fb; color: #2980b9; border-color: #3498db; }
.type-ignore   { background-color: #f2f3f4; color: #7f8c8d; border-color: #bdc3c7; }

/* --- 8. UTILITIES --- */
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }

.color-option {
    width: 25px; height: 25px;
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    border: 2px solid transparent;
    margin-right: 5px;
}
.color-option.selected {
    border-color: #333;
    transform: scale(1.1);
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* --- 9. FOOTER --- */
.main-footer {
    margin-top: auto; /* This pushes the footer to the bottom of the flex container */
    background-color: #fff;
    border-top: 1px solid #eee;
    padding: 30px 0;
    color: #7f8c8d;
    font-size: 0.9em;
}
.main-footer a {
    color: #7f8c8d;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.2s;
}
.main-footer a:hover {
    color: var(--nav-color);
    text-decoration: underline;
}

/* --- 10. PRINT STYLES --- */
@media print {
    body { background-color: #fff !important; }
    .navbar, .filter-bar, footer, .no-print, .btn { display: none !important; }
    .container { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }

    /* Ensure colors print correctly */
    .r-header-business { background-color: #e8f6f3 !important; color: #16a085 !important; -webkit-print-color-adjust: exact; }
    .r-header-personal { background-color: #ebf5fb !important; color: #2980b9 !important; -webkit-print-color-adjust: exact; }
}

/* --- 11. DASHBOARD LISTS (Recent Activity) --- */
.transaction-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.transaction-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item .text-muted {
    font-size: 0.85em;
    display: block;
    margin-top: 2px;
}

.amount {
    font-weight: 600;
    font-family: 'Consolas', monospace;
    text-align: right;
}

.total-row {
    background: #f9f9f9;
    padding: 15px 20px;
    font-weight: bold;
    text-align: right;
    border-top: 1px solid #eee;
    font-size: 1.1em;
}

.month-title {
    color: var(--muted-color);
    margin-bottom: 15px;
    font-weight: 400;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}