:root {
    /* Primary: Off-white to light gray gradient for subtle depth */
    --primary-gradient-start: #FAF9F7;
    --primary-gradient-end: #F5F3F0;
    /* Accent: Dutch Orange */
    --accent: #FF8C42;
    --accent-hover: #FF6B35;
    --accent-light: #FFF4ED;
    --accent-lighter: #FFF9F5;
    /* Neutrals - Warm grays to complement orange */
    --slate-900: #2D2926;
    --slate-800: #3D3936;
    --slate-700: #524E4B;
    --slate-600: #656260;
    --slate-500: #807D7A;
    --slate-400: #9B9896;
    --slate-300: #B8B5B3;
    --slate-200: #D6D4D2;
    --slate-100: #ECEAE8;
    --slate-50: #FAF9F7;
    --white: #FFFFFF;
    /* Background */
    --background: #FAF9F7;
    --surface: #FFFFFF;
    /* Semantic colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    /* Text */
    --text-primary: #2D2926;
    --text-secondary: #656260;
    --text-light: #9B9896;
    /* Shadows - warm tone */
    --shadow-color: 255, 140, 66; /* RGB values of orange for warm shadows */
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.12);
    --shadow-strong: rgba(255, 140, 66, 0.15);
    --shadow-heavy: rgba(255, 140, 66, 0.25);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(180deg, #FAF9F7 0%, #F5F3F0 100%);
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.faktuurtje-app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.gradient-text {
    font-size: 3rem;
    font-weight: 600;
    color: var(--slate-800);
    background: var(--slate-800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.25rem;
    margin-bottom: 3rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Magic Input Container */
.magic-input-container {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 40px var(--shadow-light), 0 0 1px var(--shadow-light);
    margin-bottom: 2.5rem;
}

.magic-input {
    width: 100%;
    border: 2px solid var(--slate-200);
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.125rem;
    resize: none;
    transition: all 0.2s ease;
    background: var(--white);
    color: var(--text-primary);
    min-height: 80px;
}

    .magic-input::placeholder {
        color: var(--text-light);
    }

    .magic-input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 4px var(--shadow-medium);
    }

.submit-button {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px var(--shadow-strong);
}

    .submit-button:hover:not(:disabled) {
        background: var(--accent-hover);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px var(--shadow-strong);
    }

    .submit-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        box-shadow: none;
    }

/* Examples Section */
.examples {
    color: var(--text-secondary);
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

    .examples h4 {
        color: var(--slate-300);
        font-weight: 500;
        margin-bottom: 1rem;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .examples ul {
        list-style: none;
        padding: 0;
    }

    .examples li {
        background: var(--white);
        border: 1px solid var(--slate-200);
        color: var(--text-primary);
        box-shadow: 0 1px 3px var(--shadow-light);
        backdrop-filter: blur(10px);
        padding: 1rem 1.25rem;
        margin: 0.75rem 0;
        border-radius: 10px;
        font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
        font-size: 0.95rem;
        transition: all 0.2s ease;
        cursor: pointer;
    }

        .examples li:hover {
            background: rgba(255, 255, 255, 0.12);
            transform: translateX(4px);
            border-color: rgba(255, 255, 255, 0.2);
        }

/* Invoice Preview Container */
.invoice-preview-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Actions */
.page-actions {
    margin-bottom: 1.5rem;
}

/* Invoice Paper */
.invoice-paper {
    background: var(--white);
    padding: 4rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-light);
    margin: 2rem 0;
}

/* Invoice Header */
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--slate-200);
}

.invoice-title h1 {
    margin: 0;
    color: var(--slate-900);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.invoice-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
}

.lines-table-mobile {
    display: block;
}

/* Invoice Parties */
.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 3rem 0;
}

.sender, .recipient {
    font-size: 0.95rem;
}

    .sender h3, .recipient h3 {
        color: var(--text-secondary);
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin: 0 0 1rem 0;
    }

    .sender p, .recipient p {
        margin: 0.35rem 0;
        color: var(--text-primary);
        line-height: 1.5;
    }

/* Invoice Details */
.invoice-details {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--slate-200);
    border-bottom: 1px solid var(--slate-200);
}

    .invoice-details table {
        width: 100%;
        border-collapse: collapse;
    }

    .invoice-details td {
        padding: 0.5rem 0;
        vertical-align: middle;
    }

        .invoice-details td:first-child {
            width: 150px;
            color: var(--text-secondary);
            font-weight: 500;
        }

/* Invoice Lines Table */
.invoice-lines {
    margin: 2rem 0;
    overflow-x:auto;
}

.lines-table {
    width: 100%;
    border-collapse: collapse;
    overflow-x:auto;
}

    .lines-table thead {
        background: var(--slate-50);
    }

    .lines-table th {
        text-align: left;
        padding: 0.75rem;
        border-bottom: 2px solid var(--slate-300);
        color: var(--text-secondary);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

        .lines-table th:nth-child(2) {
            width: 180px;
        }

        .lines-table th:nth-child(3) {
            width: 120px;
        }

        .lines-table th:nth-child(4) {
            width: 100px;
            text-align: right;
        }

        .lines-table th:nth-child(5) {
            width: 50px;
            text-align: center;
        }

    .lines-table tbody tr {
        border-bottom: 1px solid var(--slate-100);
    }

        .lines-table tbody tr:hover {
            background: var(--slate-50);
        }

    .lines-table td {
        padding: 0.75rem;
        vertical-align: middle;
    }

        .lines-table td:nth-child(4) {
            text-align: right;
            font-weight: 500;
        }

        .lines-table td:nth-child(5) {
            text-align: center;
        }

/* Editable Fields */
.editable-field {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    width: 100%;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

    .editable-field:hover {
        background: var(--accent-lighter);
        border-color: var(--slate-200);
    }

    .editable-field:focus {
        outline: none;
        background: white;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--shadow-medium);
    }

.editable-field-inline {
    display: inline-block;
    width: auto;
    min-width: 60px;
}

.field-required {
    border-color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.05);
}

    .field-required:focus {
        border-color: var(--danger) !important;
        box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    }

/* Button to Add Line */
.btn-add-line {
    background: var(--slate-50);
    border: 2px dashed var(--slate-300);
    color: var(--text-secondary);
    padding: 0.75rem;
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .btn-add-line:hover {
        background: var(--accent-lighter);
        border-color: var(--accent);
        color: var(--accent);
    }

/* Remove Line Button */
.btn-remove-line {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

    .btn-remove-line:hover {
        opacity: 1;
    }

/* Invoice Totals */
.invoice-totals {
    display: flex;
    justify-content: flex-end;
    margin: 3rem 0 2rem 0;
}

    .invoice-totals table {
        width: 350px;
        border-collapse: collapse;
    }

    .invoice-totals td {
        padding: 0.5rem;
        vertical-align: middle;
    }

        .invoice-totals td:first-child {
            text-align: left;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .invoice-totals td:last-child {
            text-align: right;
            font-weight: 600;
            color: var(--text-primary);
        }

.total-row {
    font-size: 1.25rem;
}

    .total-row td {
        border-top: 3px solid var(--slate-900);
        padding-top: 1rem;
        font-weight: 700;
        color: var(--slate-900);
    }

/* Payment Section */
.invoice-payment {
    background: var(--slate-50);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 2rem 0;
}

    .invoice-payment p {
        margin: 0.5rem 0;
        color: var(--text-primary);
    }

        .invoice-payment p:first-child {
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 1rem;
        }

/* QR Code Section */
.invoice-qr {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--slate-50);
    border-radius: 12px;
}

    .invoice-qr img {
        width: 150px;
        height: 150px;
        padding: 1rem;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

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

/* Invoice Footer */
.invoice-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--slate-200);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

    .invoice-footer a {
        color: var(--accent);
        text-decoration: none;
        font-weight: 500;
    }

        .invoice-footer a:hover {
            text-decoration: underline;
        }

/* Invoice Actions */
.invoice-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 14px var(--shadow-strong);
}

    .btn-primary:hover:not(:disabled) {
        background: var(--accent-hover);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px var(--shadow-heavy);
    }

.btn-secondary {
    background: var(--slate-100);
    color: var(--text-primary);
}

    .btn-secondary:hover:not(:disabled) {
        background: var(--slate-200);
    }

.btn-block {
    width: 100%;
    justify-content: center;
}

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

/* Form Controls */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--slate-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--white);
}

    .form-control:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--shadow-medium);
    }

/* Validation Messages */
.validation-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Validation Warning Banner */
.validation-warning {
    background: #FEF3C7;
    border: 2px solid #F59E0B;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: #92400E;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Validation Modal */
.validation-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.validation-modal {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px var(--shadow-strong);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.validation-header {
    margin-bottom: 1.5rem;
}

.validation-header h3 {
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.progress-bar {
    height: 8px;
    background: var(--slate-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Validation Modal Question Options */
.options {
    display: grid;
    gap: 0.75rem;
}

.option-button {
    padding: 1rem 1.25rem;
    border: 2px solid var(--slate-200);
    background: var(--white);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    color: var(--text-primary);
    text-align: left;
    font-weight: 500;
    font-family: inherit;
    width: 100%;
    display: block;
}

    .option-button:hover {
        background: var(--accent-lighter);
        border-color: var(--accent);
        transform: translateX(2px);
        box-shadow: 0 2px 8px var(--shadow-medium);
    }

    .option-button:active {
        transform: translateX(0);
    }

    .option-button.selected {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    }

/* For text input options in validation modal */
.option-input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--slate-200);
    border-radius: 8px;
    font-size: 1rem;
    width: 100%;
    transition: all 0.2s ease;
    background: var(--white);
    font-family: inherit;
    color: var(--text-primary);
}

    .option-input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--shadow-medium);
    }

    .option-input::placeholder {
        color: var(--text-light);
    }

/* Question Actions Buttons */
.question-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

    .question-actions .btn {
        flex: 1;
    }

/* Skip button style */
.btn-skip {
    background: var(--slate-100);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

    .btn-skip:hover {
        background: var(--slate-200);
        color: var(--text-primary);
    }

/* Confirm/Next button */
.btn-confirm {
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

    .btn-confirm:hover {
        background: var(--accent-hover);
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    }

    .btn-confirm:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

/* Confidence Indicators */
.confidence-indicator {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.confidence-high {
    background: #D1FAE5;
    color: #065F46;
}

.confidence-medium {
    background: #FEF3C7;
    color: #92400E;
}

.confidence-low {
    background: #FEE2E2;
    color: #991B1B;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gradient-text {
        font-size: 2.5rem;
    }

    .invoice-paper {
        padding: 2rem 1.5rem;
    }

    .invoice-parties {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .faktuurtje-app {
        padding: 1rem;
    }

    .invoice-totals table {
        width: 100%;
    }

    .magic-input-container {
        padding: 1rem;
    }

    .magic-input {
        padding: 0.75rem;
        font-size: 1rem;
    }
}

/* Spinner */
.spinner {
    border: 4px solid var(--slate-200);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 700ms linear infinite;
    margin: 0 auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

@media (max-width: 480px) {
    .invoice-paper {
        padding: 1.5rem 1rem;
    }

    .lines-table {
        font-size: 0.875rem;
    }

        .lines-table th,
        .lines-table td {
            padding: 0.5rem 0.25rem;
        }
}

/* Pricing Table */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-light);
}

    .pricing-table thead {
        background: var(--slate-100);
    }

    .pricing-table th {
        padding: 1rem;
        text-align: left;
        color: var(--text-secondary);
        font-weight: 600;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        border-bottom: 2px solid var(--slate-200);
    }

    .pricing-table td {
        padding: 1rem;
        color: var(--text-primary);
        border-bottom: 1px solid var(--slate-100);
    }

    .pricing-table tbody tr {
        transition: background 0.2s ease;
    }

        .pricing-table tbody tr:hover {
            background: var(--accent-lighter);
        }

        .pricing-table tbody tr.highlighted {
            background: var(--accent-lighter);
            border-left: 4px solid var(--accent);
        }

            .pricing-table tbody tr.highlighted:hover {
                background: var(--accent-light);
            }

.badge-popular {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.features-summary {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--slate-50);
    border-radius: 8px;
}

@media (max-width: 640px) {
    .pricing-table {
        font-size: 0.875rem;
    }

        .pricing-table th,
        .pricing-table td {
            padding: 0.75rem 0.5rem;
        }

    .badge-popular {
        display: block;
        margin: 0.25rem 0 0 0;
        width: fit-content;
    }
}

/* ============================================
   App Header
   ============================================ */
.app-header {
    padding: 0.75rem 1.5rem;
}

.app-header-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Account button - fixed bottom-left (like Claude/ChatGPT) */
.account-btn {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--slate-200);
    background: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.account-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

/* ============================================
   Account Management Modal
   ============================================ */
.account-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.account-modal {
    background: var(--white);
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px var(--shadow-strong);
    animation: slideUp 0.3s ease;
}

.account-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem 0;
}

.account-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.account-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.account-modal-close:hover {
    color: var(--text-primary);
}

.account-modal-body {
    padding: 1.5rem 2rem 2rem;
}

.account-loading {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

/* Account Sections */
.account-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--slate-100);
}

.account-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.account-section h4 {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Profile Info */
.account-profile-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.account-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-info-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.account-info-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.account-edit-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
}

.account-edit-btn:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Edit Form */
.account-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.account-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.account-field label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.account-edit-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

/* Sender Status */
.account-sender-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.account-sender-configured,
.account-sender-missing {
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.account-sender-configured {
    color: var(--text-primary);
}

.account-sender-missing {
    color: var(--text-secondary);
}

.account-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.account-status-ok {
    background: var(--success);
}

.account-status-warn {
    background: var(--warning);
}

/* Subscription Placeholder */
.account-coming-soon {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
}

/* Logout Section */
.account-section-logout {
    padding-top: 1rem;
}

/* Danger Zone */
.account-danger-zone {
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 1rem 1.25rem !important;
    background: rgba(239, 68, 68, 0.04);
}

.danger-zone-title {
    color: var(--danger) !important;
    margin-bottom: 0.4rem !important;
}

.danger-zone-description {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.875rem;
}

.danger-confirm-form {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.danger-confirm-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.danger-confirm-input {
    font-size: 0.875rem;
}

.danger-confirm-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin: 0;
}

.danger-confirm-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-family: inherit;
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--white);
}

/* Small button variant */
.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.875rem;
}

/* ============================================
   Nudge Banner
   ============================================ */
.nudge-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.nudge-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.nudge-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ============================================
   Sender Details Warning (Invoice Preview)
   ============================================ */
.sender-warning {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.sender-warning-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--warning);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sender-warning-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    font-size: 0.9rem;
}

.sender-warning-content strong {
    color: var(--text-primary);
}

.sender-warning-content span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Sender Setup Skip Link */
.sender-skip-link {
    display: block;
    margin-top: 0.75rem;
    text-align: center;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    text-decoration: underline;
}

.sender-skip-link:hover {
    color: #FF8C42;
}

/* ============================================
   Responsive: Account & Nudge
   ============================================ */
@media (max-width: 480px) {
    .account-modal-body {
        padding: 1rem 1.5rem 1.5rem;
    }

    .account-modal-header {
        padding: 1.25rem 1.5rem 0;
    }

    .account-sender-status {
        flex-direction: column;
        align-items: flex-start;
    }

    .nudge-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .sender-warning {
        flex-direction: column;
        text-align: center;
    }

    .sender-warning-content {
        align-items: center;
    }
}

/* ============================================
   App Header Navigation
   ============================================ */
.app-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.app-header-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex: 1;
}

.app-header-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.app-header-nav-link:hover {
    color: var(--accent);
}

/* ============================================
   Invoices List Page
   ============================================ */
.invoices-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
}

.invoices-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.invoices-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.invoices-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.invoices-empty p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.invoices-table-wrapper {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 16px var(--shadow-light);
    overflow: hidden;
}

.invoices-table {
    width: 100%;
    border-collapse: collapse;
}

.invoices-table thead {
    background: var(--slate-50);
}

.invoices-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--slate-200);
}

.invoices-table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--slate-100);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.invoices-table tbody tr:last-child td {
    border-bottom: none;
}

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

.invoice-number-cell {
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', monospace;
}

.text-right { text-align: right; }

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-draft     { background: var(--slate-100); color: var(--text-secondary); }
.status-sent      { background: #DBEAFE; color: #1D4ED8; }
.status-paid      { background: #D1FAE5; color: #065F46; }
.status-overdue   { background: #FEE2E2; color: #991B1B; }
.status-cancelled { background: var(--slate-100); color: var(--text-light); text-decoration: line-through; }

/* Invoice Row Actions */
.invoice-actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-success {
    background: #10B981;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-success:hover:not(:disabled) { background: #0D9E6A; }

.btn-danger {
    background: #EF4444;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-danger:hover:not(:disabled) { background: #DC2626; }

/* Small spinner inside button */
.btn-spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
    vertical-align: middle;
}

/* Delete Confirm Dialog */
.confirm-dialog-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.confirm-dialog {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    animation: slideUp 0.25s ease;
}

.confirm-dialog h4 { margin: 0 0 1rem; color: var(--text-primary); }
.confirm-dialog p  { color: var(--text-secondary); margin-bottom: 1.5rem; }

.confirm-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Subscription Usage in Account Modal */
.account-subscription-usage {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.subscription-usage-bar {
    height: 6px;
    background: var(--slate-200);
    border-radius: 3px;
    overflow: hidden;
}

.subscription-usage-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Pagination */
.invoices-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 0.75rem 0;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Responsive – card layout on mobile */
@media (max-width: 640px) {
    .invoices-page { padding: 1rem; }

    /* Remove wrapper chrome so card shadows are visible */
    .invoices-table-wrapper {
        background: transparent;
        box-shadow: none;
        overflow: visible;
        border-radius: 0;
    }

    /* Hide table header */
    .invoices-table thead { display: none; }

    /* Make table elements block-level */
    .invoices-table,
    .invoices-table tbody,
    .invoices-table tr,
    .invoices-table td {
        display: block;
        width: 100%;
    }

    /* Style rows as cards */
    .invoices-table tbody tr {
        margin-bottom: 0.75rem;
        border-radius: 12px;
        background: var(--white);
        box-shadow: 0 2px 8px var(--shadow-light);
        padding: 0.5rem 0;
        overflow: hidden;
    }
    .invoices-table tbody tr:hover { background: var(--white); }

    /* Style cells as label-value pairs */
    .invoices-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 1rem;
        border-bottom: 1px solid var(--slate-100);
        text-align: right;
    }
    .invoices-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-light);
        text-align: left;
        margin-right: 1rem;
        flex-shrink: 0;
    }
    .invoices-table td:last-child { border-bottom: none; }
    .invoices-table tbody tr:last-child td { border-bottom: 1px solid var(--slate-100); }
    .invoices-table tbody tr:last-child td:last-child { border-bottom: none; }

    /* Actions cell: no label, buttons aligned right */
    .invoices-table td.invoice-actions-cell::before { display: none; }
    .invoices-table td.invoice-actions-cell {
        justify-content: flex-end;
        gap: 0.5rem;
        padding-top: 0.75rem;
    }

    /* Keep amount right-aligned */
    .invoices-table td.text-right { text-align: right; }
}

/* =============================================
   Legal Pages (Privacy & Terms)
   ============================================= */

.legal-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    width: 100%;
}

.legal-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem 2.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.legal-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.legal-back {
    display: inline-block;
    color: #9b9896;
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.legal-back:hover { color: #FF8C42; }

.legal-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2D2926;
    margin: 0 0 0.25rem;
}

.legal-date {
    color: #9b9896;
    font-size: 0.85rem;
    margin: 0;
}

.legal-body section {
    margin-bottom: 2rem;
}

.legal-body h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2D2926;
    margin: 0 0 0.75rem;
}

.legal-body p,
.legal-body li {
    color: #374151;
    font-size: 0.925rem;
    line-height: 1.7;
}

.legal-body ul {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.legal-body ul li {
    margin-bottom: 0.4rem;
}

.legal-body a {
    color: #FF8C42;
    text-decoration: none;
}

.legal-body a:hover { text-decoration: underline; }

.legal-notice {
    background: #fff8f0;
    border: 1px solid #fde68a;
    border-left: 3px solid #FF8C42;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
}

.legal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.legal-table th {
    background: #f9fafb;
    padding: 0.6rem 0.875rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.legal-table td {
    padding: 0.6rem 0.875rem;
    border: 1px solid #e5e7eb;
    color: #374151;
    vertical-align: top;
}

.legal-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.legal-footer a {
    color: #9b9896;
    text-decoration: none;
    font-size: 0.85rem;
}

.legal-footer a:hover { color: #FF8C42; }

.legal-footer-divider {
    color: #d6d4d2;
    margin: 0 0.75rem;
}

@media (max-width: 600px) {
    .legal-card { padding: 1.5rem 1.25rem; }
    .legal-header h1 { font-size: 1.4rem; }
    .legal-table { font-size: 0.8rem; }
}
