* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    color: #212529;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar */
.navbar {
    background: #ffffff;
    color: #212529;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    border-bottom: 1px solid #e9ecef;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.navbar h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
    color: #212529;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: #495057;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 400;
    font-size: 0.95rem;
}

.nav-links a:hover {
    background: #f8f9fa;
    color: #212529;
}

.nav-links a.active {
    background: #212529;
    color: white;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: #212529;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Login */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.login-hint {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: #212529;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #000000;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Cards */
.card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.card-primary {
    border-left: 3px solid #212529;
}

.card-success {
    border-left: 3px solid #28a745;
}

.card-danger {
    border-left: 3px solid #dc3545;
}

.card-info {
    border-left: 3px solid #17a2b8;
}

.form-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.form-card h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-cards .card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.summary-cards .card .amount {
    font-size: 2rem;
    font-weight: bold;
}

.amount.positive {
    color: #28a745;
}

.amount.negative {
    color: #dc3545;
}

/* Period Selector */
.period-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.period-selector a {
    padding: 0.75rem 1.5rem;
    background: #ffffff;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    font-weight: 400;
    border: 1px solid #e9ecef;
}

.period-selector a:hover {
    background: #f8f9fa;
}

.period-selector a.active {
    background: #212529;
    color: white;
    border-color: #212529;
}

/* Section */
.section {
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.section h3 {
    margin: 2rem 0 1rem 0;
    color: #34495e;
}

/* Tables */
.table-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.table-container table {
    min-width: 800px;
    width: 100%;
}

/* Action buttons styling for all screen sizes */
.action-buttons-cell {
    white-space: nowrap;
    min-width: 140px;
}

.action-buttons-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: nowrap;
}

.action-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table thead {
    background: #f8f9fa;
}

table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

table tbody tr:hover {
    background: #f8f9fa;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.badge.income {
    background: #d4edda;
    color: #155724;
}

.badge.expense {
    background: #f8d7da;
    color: #721c24;
}

.badge.transfer {
    background: #d1ecf1;
    color: #0c5460;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert a {
    color: #856404;
    text-decoration: underline;
}

/* Error */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Utility */
.text-center {
    text-align: center;
}

.text-muted {
    color: #999;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        border-top: 1px solid #e9ecef;
        z-index: 1000;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links a {
        width: 100%;
        padding: 0.75rem 1rem;
        border-radius: 4px;
        margin-bottom: 0.25rem;
    }
    
    .container {
        padding: 10px;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .period-selector {
        justify-content: center;
    }
    
    .period-selector a {
        flex: 1;
        text-align: center;
        min-width: 80px;
    }
    
    .section {
        padding: 1rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
    
    .form-card {
        padding: 1.5rem;
    }
    
    .login-container {
        margin: 50px auto;
        padding: 1.5rem;
    }
    
    /* Transaction table mobile improvements */
    .transaction-timestamp {
        display: block;
        font-size: 0.75rem;
        margin-top: 2px;
        white-space: nowrap;
    }
    
    /* Action buttons already styled above, just adjust gap for mobile */
    .action-buttons-wrapper {
        gap: 0.5rem;
    }
    
    .action-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    /* Make table cells more compact on mobile */
    table td {
        padding: 0.75rem 0.5rem;
        word-break: break-word;
    }
    
    /* Reduce font size for better fit */
    table {
        font-size: 0.9rem;
    }
    
    table th {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    /* Prevent type badge from breaking */
    table td .badge {
        white-space: nowrap;
        display: inline-block;
    }
}

@media (max-width: 480px) {
    .navbar h1 {
        font-size: 1.2rem;
    }
    
    .summary-cards .card .amount {
        font-size: 1.5rem;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    table th {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    table td {
        padding: 0.5rem 0.4rem;
    }
    
    /* Ensure type badge doesn't break on very small screens */
    table td .badge {
        white-space: nowrap;
        display: inline-block;
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
    
    .action-buttons-wrapper {
        gap: 0.4rem;
    }
    
    .action-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .transaction-timestamp {
        font-size: 0.7rem;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
}

/* Quick Add Section */
.quick-add-section {
    background: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.quick-add-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.quick-add-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-quick {
    flex: 1;
    min-width: 200px;
    padding: 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-quick .icon {
    font-size: 1.5rem;
    font-weight: bold;
}

.btn-income {
    background: #28a745;
    color: white;
}

.btn-income:hover {
    background: #218838;
}

.btn-expense {
    background: #dc3545;
    color: white;
}

.btn-expense:hover {
    background: #c82333;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #ffffff;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border: 1px solid #e9ecef;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #333;
}

.transaction-row,
.lending-row {
    cursor: pointer;
    transition: background 0.2s;
}

.transaction-row:hover,
.lending-row:hover {
    background: #f0f0f0 !important;
}

body.dark-mode .transaction-row:hover,
body.dark-mode .lending-row:hover {
    background: #2a2a2a !important;
}

.transaction-detail {
    margin-top: 1rem;
}

.detail-row {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row strong {
    color: #555;
    min-width: 120px;
}

/* Filter Form */
.filter-form {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background: #5a6268;
}

.summary-row {
    display: flex;
    gap: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.summary-item {
    font-size: 0.95rem;
}

.summary-item strong {
    color: #495057;
    margin-right: 0.5rem;
}

/* Balances Overview */
.balances-overview {
    margin-bottom: 2rem;
}

.balances-overview h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.balances-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.balance-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    border-left: 3px solid #212529;
}

.balance-card h3 {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.balance-card .balance-amount {
    font-size: 1.75rem;
    font-weight: bold;
    margin: 0;
}

.balance-card.empty {
    border-left-color: #e9ecef;
    text-align: center;
    padding: 2rem;
}

.balance-card.empty a {
    color: #212529;
    text-decoration: underline;
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    user-select: none;
}

/* Period Selector Wrapper */
.period-selector-wrapper {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.period-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.period-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid #e9ecef;
    background: #ffffff;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.period-btn:hover {
    background: #f8f9fa;
    border-color: #212529;
}

.period-btn.active {
    background: #212529;
    color: #ffffff;
    border-color: #212529;
}

.date-picker-wrapper {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    display: flex;
    align-items: center;
}

.date-picker-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 1rem;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s;
    text-align: center;
    height: 42px;
    box-sizing: border-box;
    line-height: 1.5;
}

.date-picker-input:hover {
    border-color: #212529;
}

.date-picker-input:focus {
    outline: none;
    border-color: #212529;
    box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.1);
}

.date-picker-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.date-select {
    flex: 1;
    padding: 0.75rem 0.5rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 0.95rem;
    background: #ffffff;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 0;
}

.date-select:hover {
    border-color: #212529;
}

.date-select:focus {
    outline: none;
    border-color: #212529;
    box-shadow: 0 0 0 3px rgba(33, 37, 41, 0.1);
}

.date-select option {
    padding: 0.5rem;
}

/* Dark Mode Styles */
body.dark-mode {
    background: #121212;
    color: #e0e0e0;
}

body.dark-mode .navbar {
    background: #1e1e1e;
    color: #e0e0e0;
    border-bottom: 1px solid #333;
}

body.dark-mode .navbar h1 {
    color: #e0e0e0;
}

body.dark-mode .nav-links a {
    color: #b0b0b0;
}

body.dark-mode .nav-links a:hover {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode .nav-links a.active {
    background: #333;
    color: #fff;
}

body.dark-mode .hamburger span {
    background: #e0e0e0;
}

body.dark-mode .container {
    background: #121212;
}

body.dark-mode .section {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-mode .section h2 {
    color: #e0e0e0;
}

body.dark-mode .form-card {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-mode .form-card h3 {
    color: #e0e0e0;
}

body.dark-mode .form-group label {
    color: #e0e0e0;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #e0e0e0;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group select:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #555;
    background: #333;
}

body.dark-mode .btn {
    background: #4a5568;
    color: #ffffff;
    border: 1px solid #5a6578;
}

body.dark-mode .btn:hover {
    background: #5a6578;
    border-color: #6a7588;
}

body.dark-mode .btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

body.dark-mode .btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

body.dark-mode .btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

body.dark-mode .btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

body.dark-mode .card {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-mode .card h3 {
    color: #e0e0e0;
}

body.dark-mode .table-container {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-mode table {
    color: #e0e0e0;
}

body.dark-mode table thead {
    background: #2a2a2a;
}

body.dark-mode table thead th {
    color: #e0e0e0;
    border-bottom: 2px solid #444;
}

body.dark-mode table tbody tr {
    border-bottom: 1px solid #333;
}

body.dark-mode table tbody tr:hover {
    background: #2a2a2a;
}

body.dark-mode .alert {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #e0e0e0;
}

body.dark-mode .alert-success {
    background: #1e3a1e;
    border-color: #28a745;
    color: #90ee90;
}

body.dark-mode .alert-danger {
    background: #3a1e1e;
    border-color: #dc3545;
    color: #ff6b6b;
}

body.dark-mode .badge {
    background: #333;
    color: #e0e0e0;
}

body.dark-mode .badge.income {
    background: #28a745;
    color: #fff;
}

body.dark-mode .badge.expense {
    background: #dc3545;
    color: #fff;
}

body.dark-mode .badge.transfer {
    background: #0d6efd;
    color: #fff;
}

body.dark-mode .text-muted {
    color: #888 !important;
}

body.dark-mode .login-container {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-mode .login-container h1 {
    color: #e0e0e0;
}

body.dark-mode .error {
    background: #3a1e1e;
    border-color: #dc3545;
    color: #ff6b6b;
}

body.dark-mode .checkbox-group {
    background: #2a2a2a;
    border: 1px solid #444;
}

body.dark-mode .checkbox-label {
    color: #e0e0e0;
}

body.dark-mode .checkbox-label:hover {
    background: #333;
}

body.dark-mode .date-picker-group {
    background: transparent;
}

body.dark-mode .date-select {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #e0e0e0;
}

body.dark-mode .date-select:hover {
    border-color: #555;
}

body.dark-mode .date-select:focus {
    border-color: #555;
    background: #333;
}

body.dark-mode .date-select option {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-mode code {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
}

body.dark-mode pre {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
}

body.dark-mode hr {
    border-color: #333;
}

body.dark-mode small {
    color: #b0b0b0;
}

body.dark-mode .transaction-row:hover {
    background: #2a2a2a;
}

body.dark-mode .card-gradient {
    border: 1px solid #444;
}

body.dark-mode .period-selector a {
    color: #b0b0b0;
    border: 1px solid #444;
}

body.dark-mode .period-selector a:hover {
    background: #2a2a2a;
    border-color: #555;
}

body.dark-mode .period-selector a.active {
    background: #333;
    color: #fff;
    border-color: #555;
}

body.dark-mode .quick-add-section {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-mode .quick-add-section h2 {
    color: #e0e0e0;
}

body.dark-mode .filter-form {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-mode .filter-grid {
    background: transparent;
}

body.dark-mode .modal-content {
    background: #1e1e1e;
    border: 1px solid #333;
    color: #e0e0e0;
}

body.dark-mode .modal-content h2 {
    color: #e0e0e0;
}

body.dark-mode .close {
    color: #b0b0b0;
}

body.dark-mode .close:hover,
body.dark-mode .close:focus {
    color: #fff;
}

body.dark-mode .summary-row {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-mode .summary-item strong {
    color: #e0e0e0;
}

body.dark-mode .balances-overview h2 {
    color: #e0e0e0;
}

body.dark-mode .transaction-row:hover {
    background: #2a2a2a !important;
}

body.dark-mode .detail-row {
    border-bottom: 1px solid #333;
}

body.dark-mode .detail-row strong {
    color: #e0e0e0;
}

body.dark-mode .transaction-detail div[style*="background: #f5f5f5"],
body.dark-mode .transaction-detail div[style*="background:#f5f5f5"] {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
}

body.dark-mode .transaction-detail div[style*="background: #f8f9fa"],
body.dark-mode .transaction-detail div[style*="background:#f8f9fa"] {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
}

body.dark-mode .transaction-detail div[style*="border-top"] {
    border-top-color: #444 !important;
}

body.dark-mode .nav-links {
    background: #1e1e1e;
    /*border-top: 1px solid #333;*/
}

body.dark-mode .btn-secondary {
    background: #555;
    color: #e0e0e0;
}

body.dark-mode .btn-secondary:hover {
    background: #666;
}

body.dark-mode .btn-quick {
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

body.dark-mode .btn-income {
    background: #2d5a3d;
    color: #a8e6c0;
}

body.dark-mode .btn-income:hover {
    background: #3a6b4d;
}

body.dark-mode .btn-expense {
    background: #5a2d2d;
    color: #ffb3b3;
}

body.dark-mode .btn-expense:hover {
    background: #6a3d3d;
}

body.dark-mode .balance-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-left: 3px solid #555;
}

body.dark-mode .balance-card h3 {
    color: #b0b0b0;
}

body.dark-mode .balance-card .balance-amount {
    color: #e0e0e0;
}

body.dark-mode .balance-card.empty {
    border-left-color: #444;
}

body.dark-mode .balance-card.empty a {
    color: #e0e0e0;
}

/* Month Navigation Buttons */
.btn-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #212529;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    font-weight: bold;
}

.btn-month-nav:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: scale(1.05);
}

body.dark-mode .btn-month-nav {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #e0e0e0;
}

body.dark-mode .btn-month-nav:hover {
    background: #3a3a3a;
    border-color: #555;
}

.month-navigation {
    background: #ffffff;
    border: 1px solid #e9ecef;
}

body.dark-mode .month-navigation {
    background: #1e1e1e;
    border: 1px solid #333;
}

body.dark-mode .month-navigation h3 {
    color: #e0e0e0 !important;
}

body.dark-mode .month-navigation {
    color: #e0e0e0;
}

body.dark-mode .month-navigation * {
    color: #e0e0e0;
}

/* Dark mode for inline-styled elements in Automated Backup section */
body.dark-mode .form-card div[style*="background: #f5f5f5"],
body.dark-mode .form-card div[style*="background:#f5f5f5"] {
    background: #1e1e1e !important;
    border: 1px solid #333 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .form-card div[style*="background: #fff3cd"],
body.dark-mode .form-card div[style*="background:#fff3cd"] {
    background: #3a2e1e !important;
    border-color: #6b5a3a !important;
    color: #e0e0e0 !important;
}

body.dark-mode .form-card div[style*="background: #d4edda"],
body.dark-mode .form-card div[style*="background:#d4edda"] {
    background: #1e3a1e !important;
    border-color: #28a745 !important;
    color: #90ee90 !important;
}

body.dark-mode .form-card div[style*="background: #f8d7da"],
body.dark-mode .form-card div[style*="background:#f8d7da"] {
    background: #3a1e1e !important;
    border-color: #dc3545 !important;
    color: #ff6b6b !important;
}

body.dark-mode .form-card pre[style*="background: #fff"],
body.dark-mode .form-card pre[style*="background:#fff"] {
    background: #2a2a2a !important;
    border: 1px solid #444 !important;
    color: #e0e0e0 !important;
}

body.dark-mode .form-card code {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
}

body.dark-mode .form-card h4 {
    color: #e0e0e0 !important;
}

body.dark-mode .form-card p {
    color: #e0e0e0;
}

body.dark-mode .form-card ul li {
    color: #e0e0e0;
}

body.dark-mode .form-card strong {
    color: #e0e0e0;
}

body.dark-mode .form-card label {
    color: #e0e0e0;
}

/* More specific dark mode overrides for Automated Backup section */
body.dark-mode .form-card > div[style] {
    color: #e0e0e0 !important;
}

body.dark-mode .form-card > div[style] h4 {
    color: #e0e0e0 !important;
}

body.dark-mode .form-card > div[style] ul {
    color: #e0e0e0 !important;
}

body.dark-mode .form-card > div[style] ul li {
    color: #e0e0e0 !important;
}

body.dark-mode .form-card > div[style] code {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
    padding: 2px 6px !important;
}

body.dark-mode .form-card > div[style] pre {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
}

body.dark-mode .form-card > div[style] pre code {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

/* Comprehensive dark mode for all form-card content */
body.dark-mode .form-card div[style*="background"] {
    color: #e0e0e0 !important;
}

body.dark-mode .form-card div[style*="background"] * {
    color: inherit !important;
}

body.dark-mode .form-card div[style*="#f5f5f5"] {
    background: #1e1e1e !important;
    border-color: #333 !important;
}

body.dark-mode .form-card div[style*="#fff3cd"] {
    background: #3a2e1e !important;
    border-color: #6b5a3a !important;
}

body.dark-mode .form-card div[style*="#d4edda"] {
    background: #1e3a1e !important;
    border-color: #28a745 !important;
}

body.dark-mode .form-card div[style*="#f8d7da"] {
    background: #3a1e1e !important;
    border-color: #dc3545 !important;
}

body.dark-mode .form-card div[style*="#c3e6cb"] {
    border-color: #28a745 !important;
}

body.dark-mode .form-card div[style*="#f5c6cb"] {
    border-color: #dc3545 !important;
}

