/* ==========================================
   BillFlow — Design System (מאוחד עם מערכת גדוד 51)
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;500;600;700;800&display=swap');
@import url('design-system.css');

:root {
    /* Palette — מאוחד עם style.css הראשי */
    --primary-color: #1e3a5f;
    /* כחול כהה — אחיד עם שאר האתר */
    --primary-light: #2563eb;
    /* כחול בהיר */
    --secondary-color: #2563eb;
    /* כחול بدلاً מזהב */
    --secondary-light: #dbeafe;
    --gold: #c9a84c;
    --gold-light: #f0e0a0;
    --bg-base: #f7f9fc;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(30, 58, 95, 0.2);

    /* Functional Colors */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --success: #22c55e;
    --danger: #e74c3c;
    --warning: #e67e22;
    --whatsapp: #25d366;

    /* Spacing & Radius */
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(30, 58, 95, 0.06);
    --shadow-md: 0 8px 24px rgba(30, 58, 95, 0.1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Assistant', -apple-system, system-ui, sans-serif;
    background: #f7f9fc;
    color: var(--text-main);
    min-height: 100vh;
    direction: rtl;
    padding: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ---- Header (מאוחד עם כל שאר הדפים) ---- */
.header {
    background: linear-gradient(to bottom, #ffffff, #f0f7ff);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-bottom: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.header-text h1 {
    font-size: 22px;
    font-weight: 800;
    color: rgb(30, 58, 95);
    line-height: 1;
    margin-bottom: 0.2rem;
}

.header-text h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgb(71, 85, 105);
}

/* כפתור 'חזרה לראשי' — אחיד עם כל שאר הדפים */
.btn-back {
    background: #f1f5f9;
    border: 1.5px solid rgba(30, 58, 95, 0.25);
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-back:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.2);
}

/* ---- Glass Panels ---- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.glass-input {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: border-color 0.2s;
}

.glass-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* ---- Filter Bar ---- */
.filter-bar {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.compact-select {
    min-width: 150px;
    padding-left: 2rem;
    /* space for arrow if needed */
}

.compact-input {
    width: auto;
}

.actions-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: auto;
    /* Push to left */
}

/* View Toggles */
.view-toggles {
    display: flex;
    background: #e5e7eb;
    padding: 3px;
    border-radius: 8px;
}

.view-btn {
    border: none;
    background: transparent;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    font-size: 1rem;
}

.view-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-weight: 700;
    border-bottom: 2px solid var(--gold);
}

/* ---- Stats Row ---- */
.stats-row {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: white;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.success-text {
    color: var(--success);
}

.divider {
    width: 1px;
    height: 40px;
    background: #eee;
}

/* ---- Bills Section Layout ---- */
.bills-section {
    margin-bottom: 1.5rem;
}

.column-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.bill-count-badge {
    background: var(--danger);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    min-width: 22px;
    text-align: center;
}

.column-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Balance value colors */
.balance-value {
    color: var(--danger) !important;
}

.balance-value.zero {
    color: var(--success) !important;
}

/* Editable stat */
.stat-editable {
    cursor: pointer;
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    transition: background 0.2s;
}

.stat-editable:hover {
    background: rgba(212, 175, 55, 0.08);
}

/* Payment info in bill card */
.bill-paid-info {
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
    margin-top: 2px;
}

/* History button */
.history-btn-wrap {
    text-align: center;
    margin-top: 1rem;
    padding: 0.5rem;
}

.history-btn {
    gap: 0.5rem;
    font-size: 0.95rem;
    padding: 0.7rem 1.5rem;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.history-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Payment Modal Info */
.payment-bill-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    border: 1px solid #eee;
    margin-bottom: 0.5rem;
}

.payment-bill-info .bill-type {
    font-weight: 600;
    color: var(--primary-color);
}

.payment-bill-info .bill-total {
    font-weight: 800;
    font-size: 1.1rem;
}

.bills-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Bill Item (Card) */
.bill-item {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-right: 4px solid #ccc;
    /* Default border */
    border-radius: 10px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bill-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Status colors for border */
.badge-pending {
    border-color: var(--danger);
}

.badge-paid {
    border-color: var(--success);
}

.bill-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
}

.bill-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: #f0f7f4;
    color: var(--primary-color);
}

.bill-details h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
}

.bill-details p {
    font-size: 0.8rem;
    color: #777;
}

.bill-details .note-text {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}

.bill-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bill-amount-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bill-amount {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
}

.edit-amount-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 0.65rem;
    padding: 2px 3px;
    border-radius: 3px;
    transition: all 0.2s;
}

.edit-amount-btn:hover {
    color: var(--secondary-color, #c9a84c);
    background: rgba(201, 168, 76, 0.1);
}

.action-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.action-btn:hover {
    color: var(--danger);
}

/* ---- Buttons — מאוחדים עם שפת העיצוב הכללית ---- */
.primary-btn {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.4);
}

.secondary-btn {
    background: white;
    border: 1px solid #ddd;
    color: var(--text-main);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.secondary-btn:hover {
    background: #f4f4f4;
}

.whatsapp-btn {
    background: var(--whatsapp);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn-sm:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.delete-btn {
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.delete-btn:hover {
    color: var(--danger);
}

.badge {
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.badge-pending {
    background: #ffebeb;
    color: var(--danger);
}

.badge-paid {
    background: #e8f5e9;
    color: var(--success);
}

/* ---- Summary Table ---- */
.summary-container {
    padding: 1.5rem;
    background: white;
}

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

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.summary-table th {
    text-align: right;
    padding: 0.5rem 0.7rem;
    background: #f8f9fa;
    color: var(--primary-color);
    font-weight: 700;
    border-bottom: 2px solid #eee;
    font-size: 0.8rem;
    white-space: nowrap;
}

.summary-table td {
    padding: 0.45rem 0.7rem;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    vertical-align: middle;
}

.summary-table .amount-col {
    font-weight: 700;
    white-space: nowrap;
}

.summary-table .period-col {
    font-size: 0.82rem;
    color: #666;
    white-space: nowrap;
}

.summary-table .notes-col {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: #888;
}

.summary-table .notes-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.type-badge-sm {
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
}

.type-badge-sm i {
    margin-left: 3px;
}

.edit-notes-btn {
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.75rem;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.edit-notes-btn:hover {
    color: var(--secondary-color, #c9a84c);
    background: rgba(201, 168, 76, 0.1);
}

.summary-table .total-row {
    font-weight: 800;
    background: #fffdf5;
}

.summary-table .total-row td {
    border-top: 2px solid var(--secondary-color);
    color: var(--primary-color);
    font-size: 1rem;
    padding: 0.6rem 0.7rem;
}

.summary-table .category-subtotal-row td {
    border-top: 1px dashed #ddd;
    font-size: 0.82rem;
    padding: 0.35rem 0.7rem;
}

/* Summary Header */
.summary-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gold);
}

.summary-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    border-right: 3px solid var(--gold);
    padding-right: 8px;
}

.summary-period {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* File Indicator */
.file-indicator {
    color: #bbb;
    font-size: 0.85rem;
}

.view-file-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}

.view-file-btn:hover {
    color: var(--primary-color);
}

/* ---- Modals ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-color);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* File Drop Zone */
.file-drop-zone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.2s;
}

.file-drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(45, 109, 71, 0.05);
    /* primary-light alpha */
}

.file-drop-zone i {
    font-size: 1.5rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #aaa;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ---- Parse Loader ---- */
.parse-loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.parse-loader-content {
    text-align: center;
    padding: 2.5rem 3rem;
    background: white;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.parse-loader-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.parse-loader-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* ---- Responsive ---- */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    .bills-section {
        margin-bottom: 1rem;
    }

    .stats-row {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .divider {
        display: none;
    }

    /* Summary table → cards on mobile */
    .summary-table {
        display: block;
        overflow-x: auto;
    }
    .summary-table thead {
        display: none;
    }
    .summary-table tbody,
    .summary-table tr {
        display: block;
    }
    .summary-table td {
        display: flex;
        justify-content: space-between;
        padding: 0.4rem 0.6rem;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.82rem;
    }
    .summary-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary-color);
        margin-left: 8px;
        flex-shrink: 0;
    }
    .summary-table tr {
        background: #fff;
        border: 1px solid #e0e8f0;
        border-radius: 8px;
        margin-bottom: 0.6rem;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        overflow: hidden;
    }
    .summary-table .total-row td {
        background: var(--gold-light);
        font-weight: 700;
    }
}

/* Views */
.view {
    display: none;
}

.active-view {
    display: block;
}

/* ---- Preview Modal ---- */
.preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.preview-overlay.active {
    opacity: 1;
}

.preview-container {
    background: #fff;
    border-radius: 16px;
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.preview-overlay.active .preview-container {
    transform: scale(1);
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--primary-color, #1a3a2a);
    color: #fff;
    flex-shrink: 0;
}

.preview-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.preview-title small {
    opacity: 0.7;
    font-weight: 400;
    font-size: 0.8rem;
    margin-right: 8px;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-open-btn,
.preview-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s;
    text-decoration: none;
}

.preview-open-btn:hover,
.preview-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.preview-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Preview button in bill cards */
.preview-btn {
    background: none;
    border: none;
    color: var(--secondary-color, #c9a84c);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.preview-btn:hover {
    background: var(--secondary-color, #c9a84c);
    color: #fff;
}

@media (max-width: 600px) {
    .preview-container {
        width: 98vw;
        height: 90vh;
        border-radius: 10px;
    }
}

/* ---- Edit Field Overlay ---- */
.edit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-popup {
    background: #fff;
    border-radius: 12px;
    padding: 1.2rem;
    min-width: 280px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    direction: rtl;
}

.edit-popup-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-color, #1a3a2a);
    margin-bottom: 0.7rem;
}

.edit-popup-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.edit-popup-input:focus {
    border-color: var(--secondary-color, #c9a84c);
}

.edit-popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 0.7rem;
}

.edit-save-btn {
    flex: 1;
    padding: 0.5rem;
    background: var(--primary-color, #1a3a2a);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.edit-save-btn:hover {
    opacity: 0.85;
}

.edit-cancel-btn {
    flex: 1;
    padding: 0.5rem;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.edit-cancel-btn:hover {
    background: #e0e0e0;
}
/* ---- Progress Bar ---- */
.progress-bar-wrap {
    width: 100%;
    background: #e0e0e0;
    border-radius: 8px;
    height: 10px;
    margin-top: 0.8rem;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--gold));
    border-radius: 8px;
    width: 0%;
    transition: width 0.3s ease;
}
.progress-text {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    margin-top: 4px;
}

/* ---- Fallback Date Badge ---- */
.fallback-date-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 4px;
    margin-right: 4px;
    cursor: help;
    vertical-align: middle;
}

/* ---- Edit Modal Info Line ---- */
.edit-modal-info {
    font-size: 0.82rem;
    color: #666;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 6px;
}
.edit-modal-label {
    display: block;
    font-size: 0.8rem;
    color: #555;
    font-weight: 600;
    margin-bottom: 6px;
}

/* ---- Actions Divider ---- */
.actions-divider {
    width: 1px;
    height: 24px;
    background: #ddd;
    margin: 0 4px;
    flex-shrink: 0;
}

/* ---- Gmail Reset Button ---- */
.gmail-sync-btn-reset {
    background: #e67e22;
}
.gmail-sync-btn-reset:hover {
    background: #d35400;
}

/* ---- Bills Sort Bar ---- */
.bills-sort-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 8px;
}
.sort-btn {
    padding: 5px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    background: white;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    font-family: inherit;
}
.sort-btn:hover { border-color: #2563eb; color: #2563eb; }
.sort-btn.active { background: #2563eb; border-color: #2563eb; color: white; }

/* ---- Bills Table ---- */
.bills-table td { vertical-align: middle; }
.bills-table .email-date-col { font-size: 0.82rem; color: #64748b; }
.bills-table .badge-paid {
    background: #dcfce7; color: #166534; padding: 3px 10px; border-radius: 12px; font-size: 0.78rem; font-weight: 600;
}
.bills-table .badge-pending {
    background: #fef3c7; color: #92400e; padding: 3px 10px; border-radius: 12px; font-size: 0.78rem; font-weight: 600;
}
.bills-table .action-btn { padding: 4px 6px; border-radius: 6px; }
.bills-table .action-btn:hover { background: #f1f5f9; }
