/* ===== CSS VARIABLES ===== */
:root {
    /* Clean, user-friendly theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --accent-primary: #3182ce;
    --accent-hover: #2c5aa0;
    --accent-secondary: #38a169;
    --success-bg: #f0fff4;
    --success-border: #9ae6b4;
    --success-text: #22543d;
    --error-bg: #fed7d7;
    --error-border: #feb2b2;
    --error-text: #c53030;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --icon-filter: none;
}

[data-theme="dark"] {
    /* Dark theme variables */
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --border-hover: #4b5563;
    --accent-primary: #f97316;
    --accent-hover: #ea580c;
    --accent-secondary: #10b981;
    --success-bg: #064e3b;
    --success-border: #065f46;
    --success-text: #6ee7b7;
    --error-bg: #7f1d1d;
    --error-border: #991b1b;
    --error-text: #fca5a5;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --card-bg: #1f2937;
    --card-border: #374151;
    --icon-filter: brightness(0) invert(1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 1rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

.main-container {
    display: flex;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: stretch;
    min-height: 80vh;
}

.main-container.wizard-only {
    justify-content: center;
    min-height: auto;
    align-items: flex-start;
}

.container {
    flex: 1;
    max-width: 800px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-container.wizard-only .container {
    flex: none;
    width: 100%;
    max-width: 800px;
}

.bills-dashboard {
    flex: 1;
    max-width: 500px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    text-align: center;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.app-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.content {
    padding: 1rem 2rem 1.5rem 2rem;
    background: var(--card-bg);
    flex: 1;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
}

.step {
    display: none;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
    animation: slideInFromRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInFromRight {
    from { 
        opacity: 0;
        transform: translateX(30px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.type-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.type-option {
    padding: 1.5rem;
    border: none;
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.type-option:hover {
    background: var(--bg-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.type-option:active {
    transform: translateY(0);
}

.type-option.selected {
    background: #ebf8ff;
    box-shadow: 0 4px 16px rgba(49, 130, 206, 0.15);
    transform: translateY(-1px);
}

.type-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.type-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.type-option:hover .type-icon {
    transform: scale(1.05);
}

.type-option.selected .type-icon {
    /* No background or border for selected state */
}

.type-option-content {
    flex: 1;
}

.type-option h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.type-option p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

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

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* Date input specific styling */
input[type="date"] {
    position: relative;
    font-family: inherit;
    color: var(--text-primary);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23374151'%3e%3cpath fill-rule='evenodd' d='M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

input[type="date"]::-webkit-datetime-edit-text {
    color: var(--text-primary);
    padding: 0;
}

input[type="date"]::-webkit-datetime-edit-month-field {
    color: var(--text-primary);
}

input[type="date"]::-webkit-datetime-edit-day-field {
    color: var(--text-primary);
}

input[type="date"]::-webkit-datetime-edit-year-field {
    color: var(--text-primary);
}

/* Firefox date input styling */
input[type="date"]::-moz-placeholder {
    color: var(--text-muted);
}

/* Dark mode date input */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23d1d5db'%3e%3cpath fill-rule='evenodd' d='M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z' clip-rule='evenodd'/%3e%3c/svg%3e");
}

.form-input:focus {
    outline: none;
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.form-input::placeholder {
    color: var(--text-muted);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

select.form-input {
    cursor: pointer;
    padding-right: 1rem;
}

/* Mobile-specific fixes */
@media (max-width: 768px) {
    .type-icon {
        width: 56px;
        height: 56px;
        margin: 0 auto 1.5rem auto;
    }
    
    .type-icon img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        max-width: 100%;
        max-height: 100%;
    }
    
    .type-option {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .type-option h3 {
        font-size: 1.2em;
    }
    
    .type-option p {
        font-size: 0.85em;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .type-icon img {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--bg-primary);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: var(--card-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.upload-area.dragover {
    border-color: var(--accent-primary);
    background: #ebf8ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(49, 130, 206, 0.15);
}

.upload-icon {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-icon img {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-area:hover .upload-icon img {
    transform: scale(1.1);
}

.upload-text {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.upload-subtext {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.btn {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
    display: flex;
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.2);
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
}

.btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
    transform: translateY(-1px);
}

.btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.loading-content {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.loading-content p {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: var(--error-bg);
    color: var(--error-text);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid var(--error-border);
}

.step-error {
    animation: slideInFromTop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    overflow: hidden;
}

.success-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.success h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.success p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.event-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.event-item:hover {
    background: var(--card-bg);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.event-item.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.event-date {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.event-summary {
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.event-item.selected .event-date,
.event-item.selected .event-summary {
    color: white;
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0 0.5rem 0;
    padding-top: 0.5rem;
}

.step-navigation .btn {
    flex: 1;
    max-width: 200px;
    margin: 0;
}

.step-navigation .btn:first-child {
    margin-right: auto;
}

.step-navigation .btn:last-child {
    margin-left: auto;
}

.back-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    box-shadow: var(--shadow);
}

.back-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.file-info:hover {
    background: var(--card-bg);
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.confirmation-summary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.summary-section {
    margin-bottom: 1.5rem;
}

.summary-section:last-child {
    margin-bottom: 0;
}

.summary-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.summary-item {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

.summary-item span {
    color: var(--text-secondary);
}

.summary-item em {
    color: var(--text-muted);
    font-style: italic;
}

/* Calendar Styles - Dual Month View */
.calendar-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 100%;
}

.calendar-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.calendar-month {
    display: flex;
    flex-direction: column;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.calendar-nav-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.calendar-nav-btn:hover {
    background: var(--bg-secondary);
    color: var(--accent-primary);
}

.calendar-month-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    margin-bottom: 0.5rem;
}

.day-header {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    position: relative;
    min-height: 36px;
    border-radius: 8px;
    font-weight: 400;
    padding: 0;
    margin: 2px;
}

.calendar-day:hover {
    background: var(--bg-secondary);
}

.calendar-day.other-month {
    color: var(--text-muted);
    opacity: 0.3;
}

.calendar-day.selected {
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
}

.calendar-day.today {
    font-weight: 600;
    background: var(--accent-secondary);
    color: white;
}

.calendar-day.today:not(.selected) {
    background: var(--accent-secondary);
    color: white;
}

/* Additional dark mode enhancements */
[data-theme="dark"] .loading p {
    color: var(--text-secondary);
}

[data-theme="dark"] .error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

[data-theme="dark"] .success {
    background: var(--success-bg);
    color: var(--success-text);
}

[data-theme="dark"] .back-btn {
    color: var(--accent-primary);
}

[data-theme="dark"] .back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.remove-file {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 2px;
    font-size: 1rem;
    margin-left: 0.5rem;
    transition: background-color 0.2s ease;
}

.remove-file:hover {
    background: #fed7d7;
}

[data-theme="dark"] .remove-file:hover {
    background: #742a2a;
}

/* Bills Dashboard Styles */
.bills-content h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bill-health {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.bill-health-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.bill-health-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.bill-health-status.healthy {
    color: #22543d;
}

.bill-health-status.alert {
    color: #c05621;
}

.bill-health-status.emergency {
    color: #c53030;
}

.next-payday {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.next-payday-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.next-payday-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.bills-content {
    padding: 1rem 2rem 1.5rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bills-section {
    margin-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.bills-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.bills-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    overflow-y: auto;
    max-height: 200px;
}

.bills-list.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: none;
    overflow: visible;
}

.date-group {
    margin-bottom: 0.75rem;
}

.date-group:last-child {
    margin-bottom: 0;
}

.date-group-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.bill-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    position: relative;
}

.bill-list-item .bill-summary {
    color: var(--text-primary);
}

.bill-list-item .bill-amount {
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 1rem;
}

.bill-summary-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.bill-info-icon {
    width: 16px;
    height: 16px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.bill-info-icon:hover {
    opacity: 1;
}

.bill-tooltip {
    position: absolute;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 300px;
    word-wrap: break-word;
    display: none;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    white-space: normal;
    pointer-events: none;
    opacity: 0.95;
}

.bill-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #4a5568;
}

.bill-tooltip::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 21px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #2d3748;
}

.bill-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.bills-list.upcoming-grid .bill-item {
    padding: 0.75rem;
    gap: 0.25rem;
}

.bill-item.overdue {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    cursor: default;
}

.bill-item.overdue .bill-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bill-item:hover {
    background: var(--card-bg);
    border-color: var(--border-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bill-item.overdue {
    border-color: #e53e3e;
    background: transparent;
}

.bill-item.overdue:hover {
    background: #fef5f5;
    border-color: #e53e3e;
}

.bill-item.overdue .pay-button {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

.bill-item.overdue .pay-button:hover {
    background: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bill-date {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.bills-list.upcoming-grid .bill-date {
    font-size: 0.75rem;
    margin-bottom: 0.125rem;
}

.bill-item.overdue .bill-date {
    color: #c53030;
}

.bill-summary {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.bills-list.upcoming-grid .bill-summary {
    font-size: 0.7rem;
    line-height: 1.3;
}

.bill-item.overdue .bill-summary {
    color: #742a2a;
}

.bills-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.bills-error {
    text-align: center;
    padding: 2rem;
    color: var(--error-text);
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 8px;
    margin: 1rem 0;
}

.no-bills {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        gap: 1rem;
        min-height: auto;
    }
    
    .bills-dashboard {
        max-width: none;
    }
    
    .bills-list {
        max-height: 150px;
    }
    
    .bills-list.upcoming-list {
        gap: 0;
    }
    
    .calendar-dual {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .calendar-container {
        padding: 1rem;
    }
    
    .calendar-day {
        min-height: 32px;
        font-size: 0.8rem;
    }
    
    body {
        padding: 0.5rem;
    }
    
    .header {
        padding: 1rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .type-option {
        padding: 1rem;
    }

    
    .bills-content {
        padding: 1rem;
    }

    .step-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }

    .step-navigation .btn {
        max-width: none;
        width: 100%;
        min-height: 52px;
        padding: 1rem;
        font-size: 1rem;
    }

    .btn {
        min-height: 52px;
        padding: 1rem;
        font-size: 1rem;
    }

    .btn-secondary {
        min-height: 52px;
        padding: 1rem;
        font-size: 1rem;
    }

    .form-input {
        min-height: 48px;
        padding: 1rem;
        font-size: 1rem;
    }

    .upload-area {
        padding: 2.5rem 1.5rem;
        min-height: 140px;
    }

    /* Mobile calendar optimizations */
    .calendar-container {
        padding: 0.125rem;
        margin-top: 0.125rem;
    }

    .calendar-nav {
        padding: 0.0625rem 0;
        margin-bottom: 0.125rem;
    }

    .calendar-nav-btn {
        width: 16px;
        height: 16px;
        font-size: 0.875rem;
        padding: 0.0625rem;
    }

    .calendar-day {
        min-height: 14px;
        font-size: 0.6rem;
        padding: 0;
        margin: 0;
    }

    .day-header {
        font-size: 0.6rem;
        padding: 0.0625rem 0;
    }

    #currentMonthLabel {
        font-size: 0.7rem;
    }
}
