@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&display=swap");

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

:root {
    --spacing-unit: 6px;
    --primary-black: #000000;
    --secondary-gray: #666666;
    --light-gray: #f0f0f0;
    --border-gray: #e5e5e5;
    --accent-color: #677fa5;
    --success-color: #2e7d32;
    --max-width: 1280px;
    --bg-color: #ffffff;
    --text-color: #000000;
    --hover-bg: #f0f0f0;
}

[data-theme="dark"] {
    --primary-black: #e4e4e7;
    --secondary-gray: #a1a1aa;
    --light-gray: #27272a;
    --border-gray: #3f3f46;
    --accent-color: #8b9dc9;
    --success-color: #4ade80;
    --bg-color: #18181bbf;
    --text-color: #e4e4e7;
    --hover-bg: #27272a;
}

html {
    background: var(--bg-color);
    transition: background-color 0.3s ease;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
    min-height: 100vh;
}

/* Prevent flash of unstyled content */
body.theme-loading {
    visibility: hidden;
    opacity: 0;
}

body.theme-loaded {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.1s ease;
}

.dashboard-container,
.invoice-container {
    min-height: 100vh;
    background: var(--bg-color);
}

/* Header */
.dashboard-header,
.invoice-header {
    padding: calc(var(--spacing-unit) * 7) calc(var(--spacing-unit) * 6);
    border-bottom: 1px solid var(--border-gray);
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
}

.logo-icon {
    height: 34px;
    width: auto;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.logo-icon:hover {
    opacity: 0.8;
}

.logo-icon.clickable {
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo-icon.clickable:hover {
    opacity: 0.7;
}

/* Main Content */
.dashboard-main,
.invoice-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 6) calc(var(--spacing-unit) * 6)
        calc(var(--spacing-unit) * 8);
}

/* Month Navigator */
.month-navigator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: calc(var(--spacing-unit) * 7);
    padding-bottom: calc(var(--spacing-unit) * 6);
}

.current-month {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -1.4px;
    color: var(--primary-black);
    text-transform: uppercase;
}

/* Navigation Buttons */
.nav-btn,
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    background: transparent;
    color: var(--primary-black);
    border: 1px solid var(--primary-black);
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover,
.back-btn:hover {
    background: var(--primary-black);
    color: #ffffff;
}

.nav-btn:hover svg,
.back-btn:hover svg {
    color: #ffffff;
}

.new-invoice-btn {
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: calc(var(--spacing-unit) * 6);
    margin-bottom: calc(var(--spacing-unit) * 8);
}

.stat-card {
    padding: 0;
    background: transparent;
}

.stat-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--secondary-gray);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.stat-value {
    font-size: 40px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1.4px;
    color: var(--primary-black);
    font-variant-numeric: tabular-nums;
}

/* Sections */
.invoices-section {
    margin-bottom: calc(var(--spacing-unit) * 8);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: calc(var(--spacing-unit) * 3) 0;
    margin-bottom: calc(var(--spacing-unit) * 3);
    border-bottom: 1px solid var(--border-gray);
}

.section-title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.7px;
    color: var(--primary-black);
}

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

.invoices-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.invoices-table th {
    text-align: left;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 1.5);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--secondary-gray);
    border-bottom: 1px solid var(--border-gray);
}

.invoices-table td {
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 1.5);
    font-size: 14px;
    font-weight: 400;
    border-bottom: 1px solid var(--light-gray);
    color: var(--primary-black);
}

.invoices-table tbody tr:hover {
    background: var(--hover-bg);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 3px;
}

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

.status-unpaid {
    background: var(--light-gray);
    color: var(--secondary-gray);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: calc(var(--spacing-unit) * 1.5);
}

.action-btn {
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-gray);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary-black);
    color: var(--bg-color);
    border-color: var(--primary-black);
}

/* Icon buttons styling */
.action-btn.icon-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: none;
    background: transparent;
}

.action-btn.icon-btn:hover {
    background: var(--hover-bg);
    transform: scale(1.1);
}

.action-btn.icon-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-color);
}

.action-btn.icon-btn:hover svg {
    stroke: var(--primary-black);
}

/* Delete button special styling */
.action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.action-btn.delete-btn:hover svg {
    stroke: #ef4444;
}

.mark-paid-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Empty State */
.empty-state {
    padding: calc(var(--spacing-unit) * 10);
    text-align: center;
    font-size: 14px;
    letter-spacing: 0.7px;
    color: var(--secondary-gray);
}

.invoices-table:not(:empty) ~ .empty-state {
    display: none;
}

/* Invoice Form Styles */
.invoice-document {
    background-color: transparent;
    padding: calc(var(--spacing-unit) * 8);
    max-width: 900px;
    margin: 0 auto;
}

[data-theme="dark"] .invoice-document {
    background-color: transparent;
}

.invoice-title {
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 8);
}

.invoice-title h1 {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -2px;
    color: var(--primary-black);
}

/* Bill Section */
.bill-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) * 8);
    margin-bottom: calc(var(--spacing-unit) * 8);
}

.section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--secondary-gray);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

/* Input Fields */
.input-field {
    width: 100%;
    padding: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 2);
    border: none;
    border-bottom: 1px solid var(--border-gray);
    font-family: "Inter", sans-serif;
    font-size: 14px;
    background: transparent;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-bottom-color: var(--primary-black);
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Remove scrollbars from textareas */
textarea {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    resize: none; /* Remove resize handle */
}

textarea::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.address-field {
    resize: none; /* Remove resize handle */
    min-height: 60px;
    overflow: hidden; /* Hide overflow to prevent scrollbar appearance */
}

/* Terms Section */
.terms-section {
    margin-bottom: calc(var(--spacing-unit) * 8);
}

.terms-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.term-item {
    display: flex;
    flex-direction: column;
}

.term-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--secondary-gray);
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.payment-terms,
.notes {
    margin-bottom: calc(var(--spacing-unit) * 4);
}

/* Services Table */
.services-section {
    margin-bottom: calc(var(--spacing-unit) * 8);
}

.services-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.services-table th {
    text-align: left;
    padding: calc(var(--spacing-unit) * 2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--secondary-gray);
    border-bottom: 2px solid var(--border-gray);
}

.services-table td {
    padding: calc(var(--spacing-unit) * 2);
    border-bottom: 1px solid var(--light-gray);
}

.service-description {
    min-width: 300px;
    min-height: 40px;
    resize: none;
    overflow: hidden;
    line-height: 1.4;
}

/* Auto-resize service description textarea */
.service-description:focus {
    min-height: 60px;
}

.service-rate,
.service-qty {
    width: 100px;
}

.service-total {
    width: 120px;
    font-weight: 700;
}

.remove-row-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-gray);
    background: var(--bg-color);
    color: var(--secondary-gray);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-row-btn:hover {
    background: var(--primary-black);
    color: var(--bg-color);
    border-color: var(--primary-black);
}

.add-row-btn {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    background: transparent;
    color: var(--primary-black);
    border: 1px solid var(--primary-black);
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.add-row-btn:hover {
    background: var(--primary-black);
    color: var(--bg-color);
}

/* Totals Section */
.totals-section {
    display: flex;
    justify-content: flex-end;
    margin-bottom: calc(var(--spacing-unit) * 8);
}

.totals-grid {
    width: 350px;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    padding: calc(var(--spacing-unit) * 2) 0;
    border-bottom: 1px solid var(--light-gray);
}

.balance-row {
    margin-top: calc(var(--spacing-unit) * 2);
    padding: calc(var(--spacing-unit) * 3) 0;
}

.totals-label {
    font-size: 14px;
    color: var(--secondary-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.totals-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-black);
}

.balance-row .totals-value {
    font-size: 24px;
    font-weight: 900;
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
}

.save-btn,
.print-btn,
.back-btn {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
    background: transparent;
    color: var(--primary-black);
    border: 1px solid var(--primary-black);
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.save-btn:hover,
.back-btn:hover {
    background: var(--primary-black);
    color: var(--bg-color);
}

.print-btn {
    background: var(--primary-black);
    color: var(--bg-color);
}

.print-btn:hover {
    background: transparent;
    color: var(--primary-black);
}

/* Invoice Footer */
.invoice-footer {
    text-align: center;
    padding: calc(var(--spacing-unit) * 8) 0;
    border-top: 1px solid var(--border-gray);
}

.bottom-actions {
    display: flex;
    justify-content: center;
    padding: calc(var(--spacing-unit) * 4) 0;
    margin-top: calc(var(--spacing-unit) * 4);
}

.bottom-actions .save-btn {
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 8);
    font-size: 14px;
}

.footer-content p {
    font-size: 14px;
    color: var(--secondary-gray);
    font-style: italic;
}

/* Responsive */
@media (max-width: 960px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .terms-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bill-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .dashboard-main,
    .invoice-main {
        padding: calc(var(--spacing-unit) * 4);
    }

    .current-month {
        font-size: 24px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .terms-grid {
        grid-template-columns: 1fr;
    }

    .invoice-document {
        padding: calc(var(--spacing-unit) * 4);
    }

    .services-table {
        font-size: 12px;
    }

    .totals-grid {
        width: 100%;
    }
}

/* Print Styles - Compact Professional Layout */
@media print {
    @page {
        margin: 0.5in;
        size: letter;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    html {
        background: white !important;
    }

    body {
        background: white !important;
        color: #000 !important;
        font-size: 11pt;
        line-height: 1.3;
    }

    .dashboard-container,
    .invoice-container {
        min-height: auto;
        background: white !important;
    }

    .invoice-header {
        display: none;
    }

    .invoice-main {
        padding: 0;
        max-width: 100%;
        background: white !important;
    }

    .invoice-document {
        padding: 0;
        box-shadow: none;
        max-width: 100%;
        background: white !important;
    }

    /* Compact Invoice Title */
    .invoice-title {
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 3px solid #000;
    }

    .invoice-title h1 {
        font-size: 28pt;
        margin: 0;
        letter-spacing: -1px;
        color: #000 !important;
    }

    /* Compact Bill Section - Two Columns */
    .bill-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #000;
    }

    .bill-from,
    .bill-to {
        padding: 0;
    }

    .section-label {
        font-size: 9pt;
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: #000 !important;
        margin-bottom: 8px;
        border-bottom: 1px solid #000;
        padding-bottom: 3px;
    }

    /* Remove border under services section label */
    .services-section .section-label {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* Compact Input Fields for Print */
    .input-field {
        border: none !important;
        padding: 2px 0 !important;
        margin-bottom: 3px !important;
        font-size: 10pt !important;
        line-height: 1.2 !important;
        background: transparent !important;
        color: #000 !important;
    }

    /* Hide empty fields and sections in print */
    .print-empty {
        display: none !important;
    }

    .print-hide-discount,
    .hide-discount-zero {
        display: none !important;
    }
    
    /* 1. Hide the actual input fields in the rate and total columns */
    .print-mode .service-rate,
    .print-mode .service-total {
        display: none !important;
    }

    /* 2. Display the formatted value using the parent TD */
    .print-mode td[data-print-value]::after {
        content: attr(data-print-value);
        display: block;
        font-size: 10pt;
        color: #000 !important;
        text-align: right;
        width: 100%;
        /* Ensure it stays inside the cell */
        padding: 0;
        margin: 0;
    }

    /* 3. Bold the total column specifically (usually the 4th column) */
    .print-mode td:nth-child(4)[data-print-value]::after {
        font-weight: 700;
    }

    /* Hide calendar icons in date inputs */
    input[type="date"]::-webkit-calendar-picker-indicator {
        display: none !important;
    }

    /* Hide textarea resize handle */
    textarea {
        resize: none !important;
    }

    textarea.input-field {
        min-height: auto !important;
        height: auto !important;
    }

    /* Compact Terms Section */
    .terms-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #000;
    }

    .terms-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
        margin-bottom: 10px;
    }

    .term-label {
        font-size: 8pt;
        font-weight: 600;
        margin-bottom: 2px;
        color: #000 !important;
    }

    .payment-terms {
        margin-bottom: 5px;
    }

    .notes {
        margin-bottom: 10px;
    }

    /* Compact Services Table */
    .services-section {
        margin-bottom: 20px;
    }

    .services-section .section-label {
        margin-bottom: 10px;
    }

    .services-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 10pt;
        page-break-inside: avoid;
    }

    .services-table th {
        text-align: left;
        padding: 8px 5px;
        font-size: 9pt;
        font-weight: 700;
        text-transform: uppercase;
        color: #000 !important;
        border-bottom: 2px solid #000;
        border-top: 2px solid #000;
        vertical-align: bottom;
    }

    .services-table th:nth-child(2),
    .services-table th:nth-child(3),
    .services-table th:nth-child(4) {
        text-align: right;
        width: 80px;
    }

    .services-table th:first-child {
        width: auto;
    }

    .services-table td {
        padding: 8px 5px;
        border-bottom: 1px solid #ccc;
        vertical-align: top;
    }

    .services-table td:nth-child(2),
    .services-table td:nth-child(3),
    .services-table td:nth-child(4) {
        text-align: right;
        width: 80px;
    }

    .services-table input {
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 10pt !important;
        background: transparent !important;
        width: 100% !important;
        word-wrap: break-word !important;
        white-space: normal !important;
    }

    .services-table .service-description {
        width: 100% !important;
        word-wrap: break-word !important;
        white-space: pre-wrap !important;
        overflow-wrap: break-word !important;
        min-height: auto !important;
        height: auto !important;
        resize: none !important;
        overflow: visible !important;
        line-height: 1.3 !important;
    }

    .services-table .service-rate,
    .services-table .service-qty,
    .services-table .service-total {
        text-align: right;
        width: 100% !important;
    }
    
    /* 4. Force columns to align right */
    .services-table th:nth-child(2),
    .services-table th:nth-child(4),
    .services-table td:nth-child(2),
    .services-table td:nth-child(4) {
        text-align: right !important;
    }
    
    /* 5. Ensure table cell has enough space */
    .services-table td {
        min-width: 80px;
        vertical-align: middle;
    }
    
    .services-table .service-total {
        font-weight: 600;
    }
    
    /* Hide input borders and chrome-specific focus rings */
    .print-mode .input-field {
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }

    /* Compact Totals Section */
    .totals-section {
        display: flex !important;
        justify-content: flex-end;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    .totals-grid {
        width: 250px;
        display: block !important;
    }

    .totals-row {
        display: flex !important;
        justify-content: space-between;
        padding: 5px 0;
        border-bottom: none;
        font-size: 10pt;
    }
    
    /* Override for hidden discount rows */
    .totals-row.print-hide-discount,
    .totals-row.hide-discount-zero {
        display: none !important;
    }

    .totals-label {
        font-size: 9pt;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #333;
    }

    .totals-value {
        font-size: 10pt;
        font-weight: 600;
        color: #000;
    }

    .balance-row {
        border-bottom: none;
        border-top: 2px solid #000;
        margin-top: 5px;
        padding: 8px 0;
    }

    .balance-row .totals-label {
        font-weight: 700;
        color: #000;
        font-size: 10pt;
    }

    .balance-row .totals-value {
        font-size: 14pt;
        font-weight: 900;
    }

    /* Footer */
    .invoice-footer {
        position: relative;
        text-align: center;
        padding-top: 20px;
        margin-top: 30px;
        border-top: 1px solid #ccc;
    }

    .invoice-footer p {
        font-size: 9pt;
        color: #666;
        font-style: italic;
        margin: 0;
        margin-bottom: 5px;
    }

    .invoice-footer .footer-attribution {
        font-size: 8pt;
        color: #999;
        font-style: normal;
        margin-top: 5px;
    }

    /* Remove all buttons and controls */
    .remove-row-btn,
    .add-row-btn,
    .save-btn,
    .print-btn,
    .theme-toggle {
        display: none !important;
    }
}

.print-only {
    display: none;
}

/* Dark mode specific adjustments */
[data-theme="dark"] .status-paid {
    background: rgba(74, 222, 128, 0.1);
    color: var(--success-color);
}

[data-theme="dark"] .status-unpaid {
    background: var(--light-gray);
    color: var(--secondary-gray);
}

[data-theme="dark"] .input-field {
    color: var(--text-color);
}

[data-theme="dark"] .input-field::placeholder {
    color: var(--secondary-gray);
}

/* Fix calendar icon in dark mode */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}

[data-theme="dark"]
    input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-color);
    border-radius: 50%;
    padding: 0;
}

.theme-toggle-btn:hover {
    background: var(--hover-bg);
    transform: scale(1.1);
}

.theme-toggle-btn svg {
    width: 24px;
    height: 24px;
}

/* Show sun in light mode, moon in dark mode */
.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* Paid Status Toggle */
.paid-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border-gray);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
    display: inline-block;
}

.paid-toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--bg-color);
    border-radius: 50%;
    transition: transform 0.3s;
}

.paid-toggle.active {
    background: var(--success-color);
}

.paid-toggle.active .paid-toggle-slider {
    transform: translateX(20px);
}

[data-theme="dark"] .paid-toggle {
    background: var(--border-gray);
}

[data-theme="dark"] .paid-toggle.active {
    background: var(--success-color);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 3);
}

/* Month navigation */
.month-nav {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 3);
}

.month-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-color);
    border-radius: 50%;
}

.month-btn:hover:not(:disabled) {
    background: var(--hover-bg);
    transform: scale(1.1);
}

.month-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.month-display {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-color);
    min-width: 180px;
    text-align: center;
}
