/* Bootstrap Theme Customization */
:root {
    --bs-primary: #667eea;
    --bs-primary-rgb: 102, 126, 234;
    --bs-secondary: #764ba2;
    --bs-secondary-rgb: 118, 75, 162;
    --bs-success: #10b981;
    --bs-success-rgb: 16, 185, 129;
    --bs-danger: #ef4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-warning: #f59e0b;
    --bs-warning-rgb: 245, 158, 11;
    --bs-info: #3b82f6;
    --bs-info-rgb: 59, 130, 246;
    --bs-light: #f8f9fa;
    --bs-light-rgb: 248, 249, 250;
    --bs-dark: #2c3e50;
    --bs-dark-rgb: 44, 62, 80;
    --bs-body-bg: #f5f5f5;
    --bs-body-color: #333;
    --bs-border-radius: 8px;
    --bs-border-radius-sm: 6px;
    --bs-border-radius-lg: 12px;
    --bs-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --bs-box-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --bs-box-shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
    --bs-font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Bootstrap Component Overrides */
.btn {
    border-radius: var(--bs-border-radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #5568d3;
    border-color: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
    color: white;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #653d8f;
    border-color: #653d8f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}

.btn-success {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}

.btn-danger {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
}

.card {
    border-radius: var(--bs-border-radius-lg);
    box-shadow: var(--bs-box-shadow);
    border: none;
}

.alert {
    border-radius: var(--bs-border-radius);
    border: none;
}

.form-control,
.form-select {
    border-radius: var(--bs-border-radius);
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.table {
    border-radius: var(--bs-border-radius);
    overflow: hidden;
}

.badge {
    border-radius: var(--bs-border-radius-sm);
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    scroll-behavior: smooth;
}

/* Bootstrap Button Overrides */
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-primary:hover {
    background-color: #5568d3;
    border-color: #5568d3;
}

.btn-secondary {
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}

.btn-secondary:hover {
    background-color: #653d8f;
    border-color: #653d8f;
}

/* Container - Bootstrap compatible */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Full width container for bills page */
.bills-page .container {
    max-width: 100%;
    padding: 20px;
}

/* Ensure Bootstrap container works with our custom styles */
.container-fluid {
    padding: 20px;
}

/* Navigation */
.main-nav {
    background-color: #667eea;
    color: white;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    color: #ecf0f1;
}

/* Auth Forms */
.auth-form {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.auth-form h1 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #777;
    font-size: 0.875rem;
}

.error-text {
    display: block;
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s;
    text-align: center;
}

.btn-primary {
    background-color: #3498db;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-link {
    background: none;
    color: white;
    padding: 0.5rem 1rem;
}

.btn-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background-color: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

/* Dashboard */
.dashboard {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard h1 {
    margin-bottom: 2rem;
    color: #2c3e50;
}

.next-payday-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.next-payday-section h2 {
    color: white;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.payday-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.payday-pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.payday-page-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    white-space: nowrap;
}

.payday-pagination .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.next-payday-section h3 {
    color: white;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.payday-summary {
    display: block;
    margin-top: 1rem;
}

.payday-summary .row {
    margin: 0;
}

.payday-amount {
    font-size: 1.1rem;
    line-height: 1.8;
}

.payday-summary-cards {
    margin-bottom: 1.5rem;
}

.summary-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.summary-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.summary-amount {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
}

.summary-card.positive .summary-amount {
    color: #4caf50;
}

.summary-card.negative .summary-amount {
    color: #f44336;
}

.income-card {
    border-left: 4px solid #2196f3;
}

.outgoing-card {
    border-left: 4px solid #ff9800;
}

.remaining-card {
    border-left: 4px solid #4caf50;
}

.remaining-card.negative {
    border-left-color: #f44336;
}

.bills-summary {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    width: 100%;
}

.bills-summary.col-12 {
    width: 100%;
    max-width: 100%;
}

.bills-list-mini {
    margin-top: 1rem;
}

.bills-list-mini .data-table {
    background: white;
    color: #333;
}

.bills-list-mini .data-table tr.overdue-bill {
    background-color: #ffebee !important;
    border-left: 4px solid #f44336 !important;
}

.bills-list-mini .data-table tr.overdue-bill td {
    color: #c62828 !important;
    font-weight: 500 !important;
    background-color: #ffebee !important;
}

/* Ensure overdue styling works even with table backgrounds */
.next-payday-section .bills-list-mini .data-table tr.overdue-bill {
    background-color: #ffebee !important;
    border-left: 4px solid #f44336 !important;
}

.next-payday-section .bills-list-mini .data-table tr.overdue-bill td {
    background-color: #ffebee !important;
    color: #c62828 !important;
    font-weight: 500 !important;
}

/* Even more specific selector to ensure it works */
.next-payday-section .bills-summary .bills-list-mini .data-table tbody tr.overdue-bill {
    background-color: #ffebee !important;
}

.next-payday-section .bills-summary .bills-list-mini .data-table tbody tr.overdue-bill td {
    background-color: #ffebee !important;
    color: #c62828 !important;
}

.bills-list-mini .data-table th {
    background: #f8f9fa;
    color: #2c3e50;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.bills-list-mini .data-table td {
    padding: 0.5rem;
    font-size: 0.875rem;
}

.bills-list-mini .data-table tfoot {
    background: #f8f9fa;
    font-weight: 600;
}

.bills-list-mini .data-table tfoot td {
    padding: 0.75rem 0.5rem;
    border-top: 2px solid #dee2e6;
}

.remaining-row td {
    background: #e3f2fd;
    font-size: 1rem;
}

.next-payday-section .text-muted {
    color: rgba(255, 255, 255, 0.9);
}

.next-payday-section a {
    color: #fff;
    text-decoration: underline;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.dashboard-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-card h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.dashboard-card p {
    color: #666;
    margin-bottom: 1rem;
}

.dashboard-card .btn {
    width: auto;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin: 0;
    color: #2c3e50;
}

/* Accounts Page */
.accounts-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.accounts-list-section,
.accounts-form-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.accounts-list-section h2,
.accounts-form-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: #666;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table thead {
    background-color: #f8f9fa;
}

.data-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

.data-table .amount {
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.data-table .actions {
    white-space: nowrap;
}

.data-table .actions .btn {
    min-width: auto;
    padding: 0.25rem 0.5rem;
    font-size: 1.2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.badge-checking {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-savings {
    background-color: #e8f5e9;
    color: #388e3c;
}

.badge-cash {
    background-color: #fff3e0;
    color: #f57c00;
}

.badge-other {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.badge-primary {
    background-color: #2c3e50;
    color: white;
}

/* Buttons */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-edit {
    background-color: #3498db;
    color: white;
    border: none;
    margin-right: 0.5rem;
}

.btn-edit:hover {
    background-color: #2980b9;
}

.btn-delete {
    background-color: #e74c3c;
    color: white;
    border: none;
}

.btn-delete:hover {
    background-color: #c0392b;
}

.inline-form {
    display: inline;
}

/* Form Styles */
.account-form {
    margin-top: 1rem;
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.3s;
}

.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    cursor: pointer;
}

.checkbox-label span {
    color: #555;
    font-weight: 500;
}

.text-muted {
    color: #999;
}

/* Bills, Income Sources, Paydays Layout */
.bills-layout {
    display: block;
    margin-top: 2rem;
}

.income-sources-layout {
    display: block;
    margin-top: 2rem;
}

.bills-list-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.income-sources-list-section,
.paydays-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bills-form-section,
.income-sources-form-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bills-list-section h2,
.income-sources-list-section h2,
.bills-form-section h2,
.income-sources-form-section h2,
.paydays-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin-bottom: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.data-table tr.inactive {
    opacity: 0.6;
}

.data-table tr.editing {
    background-color: #f0f8ff;
}

.badge-success {
    background-color: #27ae60;
    color: white;
}

.badge-warning {
    background-color: #f39c12;
    color: white;
}

.badge-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-success {
    background-color: #27ae60;
    color: white;
    border: none;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Form Styles */
.bill-form,
.income-source-form {
    margin-top: 1rem;
}

.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.frequency-field {
    margin-top: 1rem;
}

/* Inline Edit Form */
.inline-edit-form {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
}

.form-group-inline label {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: #555;
    font-weight: 500;
}

.form-group-inline input,
.form-group-inline select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.form-group-inline span {
    padding: 0.5rem;
    color: #333;
}

.mark-received-form {
    margin-left: 0.5rem;
}

/* Today / Where do I stand? Page */
.today-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.today-section h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-size: 1.5rem;
}

.pay-period-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pay-period-section h2 {
    color: white;
}

.pay-period-info {
    font-size: 1.1rem;
    line-height: 1.8;
}

.pay-period-info strong {
    font-weight: 600;
}

.balances-form {
    margin-top: 1rem;
}

.balance-input {
    width: 120px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.account-select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.calculation-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.calculation-box h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-size: 1.1rem;
}

.large-amount {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
    font-family: 'Courier New', monospace;
}

.large-amount.positive {
    color: #27ae60;
}

.large-amount.negative {
    color: #e74c3c;
}

.summary-section {
    background: #f8f9fa;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.summary-box {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-box.highlight {
    border-color: #3498db;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.summary-box h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
}

.summary-box .large-amount {
    font-size: 1.75rem;
    margin: 0.5rem 0;
}

.summary-box small {
    display: block;
    margin-top: 0.5rem;
    color: #666;
}

.data-table tr.overdue-bill,
.bills-list-mini .data-table tr.overdue-bill {
    background-color: #ffebee !important;
    border-left: 4px solid #f44336;
}

.data-table tr.overdue-bill td,
.bills-list-mini .data-table tr.overdue-bill td {
    color: #c62828 !important;
    font-weight: 500;
    background-color: #ffebee !important;
}

.data-table tr.paid-bill {
    opacity: 0.7;
    background-color: #f0f9f0;
}

/* Bills Header Modern Styles */
.bills-header-modern {
    margin-bottom: 2rem;
}

.bills-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.bills-header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bills-header-title h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.bills-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.bills-header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.bills-header-actions .btn,
.bills-header-actions .inline-form {
    width: auto;
    flex-shrink: 0;
}

.bills-header-actions .inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bills-header-actions #addBillBtn {
    width: auto;
    white-space: nowrap;
}

.checkbox-label-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    white-space: nowrap;
}

.checkbox-label-modern input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-form {
        margin: 20px;
        padding: 1.5rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .accounts-layout,
    .bills-layout {
        display: block;
    }
    
    .income-sources-layout {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .bills-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .bills-header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .bills-header-actions .btn,
    .bills-header-actions .inline-form {
        width: 100%;
    }
    
    .bills-header-actions .inline-form {
        flex-direction: column;
    }
    
    .checkbox-label-modern {
        width: 100%;
        justify-content: center;
    }
    
    .bills-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .bills-header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .bills-header-actions .btn,
    .bills-header-actions .inline-form {
        width: 100%;
    }
    
    .bills-header-actions .inline-form {
        flex-direction: column;
    }
    
    .checkbox-label-modern {
        width: 100%;
        justify-content: center;
    }
    
    .table-container {
        overflow-x: scroll;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group-inline {
        min-width: 100%;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .large-amount {
        font-size: 1.5rem;
    }
    
    .payday-summary {
        grid-template-columns: 1fr;
    }
    
    .bills-list-mini .data-table {
        font-size: 0.8rem;
    }
    
    .payday-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .payday-pagination {
        width: 100%;
        justify-content: space-between;
    }
    
    .income-sources-columns {
        grid-template-columns: 1fr !important;
    }
}

/* Month Navigation */
.month-navigation {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.month-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
}

.month-link:not(.selected):not(.current):hover {
    background-color: #e9ecef !important;
    border-color: #adb5bd !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.month-link.current:hover {
    background-color: #bbdefb !important;
    border-color: #2196f3 !important;
}

.month-link.selected {
    cursor: default;
}

.month-link span {
    display: block;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-page {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    min-width: 2.5rem;
    text-align: center;
    transition: all 0.2s;
}

.pagination-page:hover {
    background-color: #f0f0f0;
    border-color: #999;
}

.pagination-page.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: bold;
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: #999;
}

.pagination-link {
    text-decoration: none;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
    margin-left: auto;
}

.pagination .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.payday-info {
    display: block;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .pagination-info {
        margin-left: 0;
        order: -1;
    }
    
    .pagination-pages {
        order: 2;
    }
    
    .pagination-link {
        order: 3;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: 1px solid #888;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #000;
}

/* Large Modal Styles */
.modal-large {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.modal-large-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 2% auto;
}

.modal-large-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    flex-shrink: 0;
}

.modal-large-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.modal-large-close {
    font-size: 2rem;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
}

.modal-large-close:hover {
    color: #333;
}

.modal-large-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-large-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background-color: #f8f9fa;
    flex-shrink: 0;
}