/* ==========================================================================
   MODERN ENTERPRISE INVOICE STYLING (Screen Modal Preview + Print to PDF)
   ========================================================================== */
.invoice-preview-wrapper {
    background: #f1f5f9;
    padding: 24px 16px;
    border-radius: 8px;
    overflow-x: auto;
    display: flex;
    justify-content: center;
}

.invoice-sheet {
    background: #ffffff;
    color: #0f172a;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    width: 100%;
    max-width: 820px;
    padding: 36px 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.5;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 22px;
    border-bottom: 2px solid #0f172a;
    margin-bottom: 22px;
}

.invoice-brand {
    max-width: 480px;
}

.invoice-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.invoice-logo-badge {
    width: 38px;
    height: 38px;
    background: #0f172a;
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.invoice-brand-title {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.3px;
    color: #0f172a;
    line-height: 1.1;
}

.invoice-brand-sub {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #2563eb;
    margin-top: 2px;
}

.invoice-company-details {
    font-size: 11.5px;
    color: #475569;
    line-height: 1.45;
    margin-top: 6px;
}

.invoice-tax-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.invoice-tax-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10.5px;
    font-family: 'JetBrains Mono', monospace;
    color: #334155;
}

.invoice-tax-pill strong {
    color: #0f172a;
}

.invoice-meta {
    text-align: right;
    min-width: 220px;
}

.invoice-title {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #0f172a;
    margin: 0;
    line-height: 1;
}

.invoice-ref-badge {
    display: inline-block;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    margin: 8px 0;
}

.invoice-dates-table {
    margin-left: auto;
    font-size: 12px;
    border-collapse: collapse;
}

.invoice-dates-table td {
    padding: 2px 4px;
}

.invoice-dates-table td:first-child {
    color: #64748b;
    text-align: right;
}

.invoice-dates-table td:last-child {
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

.invoice-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 6px;
}

.invoice-status-pill.paid {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.invoice-status-pill.partial {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.invoice-status-pill.issued {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
}

/* Two-column info cards */
.invoice-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.invoice-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
}

.invoice-card-header {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
}

.invoice-client-name {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 4px;
}

.invoice-client-info {
    font-size: 11.5px;
    color: #475569;
    line-height: 1.45;
}

.invoice-client-fiscal {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed #cbd5e1;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: #334155;
    line-height: 1.5;
}

/* Table of items */
.invoice-table-container {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 22px;
}

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

.invoice-table th {
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    text-align: left;
}

.invoice-table th.center { text-align: center; }
.invoice-table th.right { text-align: right; }

.invoice-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12.5px;
    color: #1e293b;
    vertical-align: middle;
}

.invoice-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

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

.invoice-table td.center { text-align: center; }
.invoice-table td.right { text-align: right; font-family: 'JetBrains Mono', monospace; }
.invoice-table td.total-cell { font-weight: 700; color: #0f172a; }

/* Financial summary section */
.invoice-financials {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    margin-bottom: 24px;
    align-items: start;
}

.invoice-amount-words {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #2563eb;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.invoice-words-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 4px;
}

.invoice-words-text {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    font-style: italic;
    line-height: 1.4;
}

.invoice-bank-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 14px;
}

.invoice-bank-title {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #475569;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.invoice-bank-row {
    font-size: 11px;
    color: #334155;
    margin-bottom: 2px;
}

.invoice-rib-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #0f172a;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 3px;
    font-size: 11.5px;
}

.invoice-totals-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 4px 0;
    color: #475569;
}

.invoice-total-row.sub {
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 6px;
    margin-bottom: 4px;
}

.invoice-total-row strong {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #0f172a;
}

.invoice-ttc-banner {
    background: #0f172a;
    color: #ffffff;
    border-radius: 6px;
    padding: 10px 14px;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invoice-ttc-banner .label {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.invoice-ttc-banner .amount {
    font-size: 17px;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    color: #ffffff;
}

.invoice-paid-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    font-size: 11.5px;
}

/* Signatures section */
.invoice-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.invoice-signature-box {
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    padding: 12px 14px;
    min-height: 95px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #fafafa;
    position: relative;
}

.invoice-signature-title {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
}

.invoice-stamp-watermark {
    position: absolute;
    right: 14px;
    bottom: 10px;
    opacity: 0.2;
    pointer-events: none;
}

.invoice-signature-sub {
    font-size: 10px;
    color: #94a3b8;
    text-align: right;
}

/* Legal Footer */
.invoice-footer {
    margin-top: 22px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 9.5px;
    color: #64748b;
    line-height: 1.5;
}

/* ==========================================================================
   FICHE CLIENT / CUSTOMER DOSSIER & STATEMENT STYLING
   ========================================================================== */
.client-hero-card {
    background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
    border: 1px solid #DBEAFE;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.client-hero-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.client-avatar-badge {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #1E40AF;
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.2);
    flex-shrink: 0;
}

.client-hero-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.client-hero-sub {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.client-hero-sub span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.client-hero-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.recovery-progress {
    width: 100%;
    height: 6px;
    background: #E2E8F0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
}

.recovery-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #059669);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.dossier-nav {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
}

.dossier-tab-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.dossier-tab-btn:hover {
    color: var(--primary);
}

.dossier-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 700;
}

/* Print optimizations */
@media print {
    @page {
        size: A4 portrait;
        margin: 8mm 10mm;
    }
    
    html, body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    body * {
        visibility: hidden !important;
    }
    
    #printSection, #printSection * {
        visibility: visible !important;
    }
    
    #printSection {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        background: #ffffff !important;
        box-shadow: none !important;
    }
    
    .invoice-preview-wrapper {
        background: transparent !important;
        padding: 0 !important;
    }

    .invoice-sheet {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

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

    .monthly-att-wrapper {
        background: transparent !important;
        padding: 0 !important;
    }

    .monthly-att-sheet {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .monthly-att-table th,
    .monthly-att-table td {
        border-color: #64748b !important;
    }
}

/* ==========================================================================
   MONTHLY ATTENDANCE TIMESHEET STYLING (Screen & Print)
   ========================================================================== */
.monthly-att-wrapper {
    background: #f1f5f9;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
}

.monthly-att-sheet {
    background: #ffffff;
    color: #0f172a;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    width: 100%;
    margin: 0 auto;
    padding: 20px 22px;
    box-sizing: border-box;
    font-size: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.monthly-att-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.monthly-att-table th,
.monthly-att-table td {
    border: 1px solid #cbd5e1;
    padding: 4px 2px;
    text-align: center;
    vertical-align: middle;
}

.monthly-att-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #334155;
    font-size: 9.5px;
}

.monthly-att-table .th-weekend {
    background: #f1f5f9;
    color: #64748b;
}

.monthly-att-table .td-weekend {
    background: #fafafa;
}

.monthly-att-table .cell-p {
    color: #16a34a;
    font-weight: 800;
}

.monthly-att-table .cell-a {
    color: #dc2626;
    font-weight: 800;
    background: #fef2f2;
}

.monthly-att-table .cell-m {
    color: #d97706;
    font-weight: 800;
}

.monthly-att-table .cell-c {
    color: #2563eb;
    font-weight: 800;
}

.monthly-att-table .cell-r {
    color: #64748b;
    font-weight: 700;
}

.monthly-att-table .cell-none {
    color: #cbd5e1;
}

.monthly-att-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-top: 14px;
    text-align: center;
    font-size: 11px;
}

.monthly-att-sig-box {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 10px;
    min-height: 80px;
    background: #ffffff;
}
