/* Products list: clean, professional table */
.products-table-limited {
    width: 100%;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

.products-table-limited thead th {
    background: #f7f9fb;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid #e6edf4;
    padding: 12px 16px;
}

.products-table-limited tbody td {
    color: #1f2937;
    font-size: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
    white-space: normal;
    word-break: break-word;
}

.products-table-limited tbody tr:nth-child(even) td {
    background: #fbfcfe;
}

.products-table-limited tbody tr:hover td {
    background: #f4f8fb;
}

/* Global fix for product descriptions formatting - Max specificity - Adjusted for HTML content */
#items-list-table td.items_col_description,
#category-items-table td.items_col_description,
.products-table-limited td.items_col_description,
.text-wrap-new-lines {
    white-space: normal !important;
    word-break: break-word !important;
}

#items-list-table td.items_col_description p,
#category-items-table td.items_col_description p,
.products-table-limited td.items_col_description p,
.text-wrap-new-lines p {
    margin-bottom: 5px !important;
}

#items-list-table td.items_col_description ul,
#category-items-table td.items_col_description ul,
.products-table-limited td.items_col_description ul,
.text-wrap-new-lines ul {
    margin-bottom: 5px !important;
    padding-left: 1.5rem !important;
}

/* Proposal and Document color overrides */
.proposal-template-wrap .proposal-template .pt-muted {
    color: #000000 !important;
}

.docs-main-wrapper {
    color: #000000 !important;
    font-size: 12px !important;
}

/* Contract print view - body padding */
html.print-page body .docs-main-wrapper .doc-body {
    margin: 0 !important;
    padding: 20px 75px 75px 75px !important;
}

/* Custom font overrides for specific elements in proposals */
.proposal-template-wrap .proposal-template .pt-recipient,
.proposal-template-wrap .proposal-template .pt-title {
    font-family: "PublicSans" !important;
    font-weight: 500 !important;
}

/* Global font override for all other text in the proposal */
.proposal-template-wrap .proposal-template * {
    font-family: "Public Sans Light", Helvetica, Arial, sans-serif !important;
    font-weight: 300;
    color: #000000 !important;
}

/* Link styled as a professional button when title="bouton" - ONLY IN PROPOSALS */
.proposal a[title="bouton"],
.proposal-pdf a[title="bouton"] {
    display: inline-block;
    background: linear-gradient(135deg, #d4af37 0%, #b8962e 100%);
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
    margin-top: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

/* Icône flèche */
.proposal a[title="bouton"]::after,
.proposal-pdf a[title="bouton"]::after {
    content: "➜";
    margin-left: 8px;
    font-size: 14px;
    transition: transform 0.25s ease;
}

/* Hover */
.proposal a[title="bouton"]:hover,
.proposal-pdf a[title="bouton"]:hover {
    background: linear-gradient(135deg, #e6c65c 0%, #c9a93a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(180, 150, 50, 0.25);
}

/* Animation icône au hover */
.proposal a[title="bouton"]:hover::after,
.proposal-pdf a[title="bouton"]:hover::after {
    transform: translateX(3px);
}

/* Modal Selector Toggle Buttons (Estimates, Proposals, Invoices) */
.client-selector-links,
.modal-selector-links {
    display: flex !important;
    background: #f4f7fa !important;
    padding: 5px !important;
    border-radius: 12px !important;
    margin-top: 10px !important;
    margin-bottom: 25px !important;
    border: 1px solid #eef2f6 !important;
    width: 100% !important;
    max-width: 400px !important;
    position: relative !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
    box-sizing: border-box !important;
    flex-direction: row-reverse;
}

.client-selector-links a,
.modal-selector-links a,
.customer-type-selector,
.client-type-selector {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    /* Force vertical centering */
    justify-content: center !important;
    /* Force horizontal centering */
    height: 40px !important;
    /* Exact fixed height */
    line-height: normal !important;
    /* Let flex handle it */
    padding: 0 15px !important;
    border-radius: 9px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    text-align: center !important;
    border: none !important;
    cursor: pointer !important;
    background: transparent !important;
    white-space: nowrap !important;
    margin: 0 !important;
    /* Clear any margins */
}

.client-selector-links a:hover,
.modal-selector-links a:hover,
.client-type-selector:hover,
.customer-type-selector:hover {
    color: #1e293b !important;
    background: rgba(255, 255, 255, 0.4) !important;
}

.client-selector-links a.active,
.modal-selector-links a.active,
.customer-type-selector.active,
.client-type-selector.active {
    background: #ffffff !important;
    color: #1586b0 !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    /* Ensure no shifts in active state */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

@media screen and (max-width: 767px) {
    .container-fluid.proposal {
        width: 1100px !important;
    }
}

.loggedin.fix-header.card-no-border.fix-sidebar.estimate .pull-left.m-t-30.text-left,
.loggedin.fix-header.card-no-border.fix-sidebar.invoice .pull-left.m-t-30.text-left {
    display: none;
}

.loggedin.fix-header.card-no-border.fix-sidebar.estimate .pull-left.m-t-30.text-left.bill-file-attachments,
.loggedin.fix-header.card-no-border.fix-sidebar.invoice .pull-left.m-t-30.text-left.bill-file-attachments {
    display: block !important;
}

/* Modernized Estimate Totals Section */
.billing-summary-section {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #eef2f6;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    min-width: 350px;
    text-align: left;
}

/* Hide proposals on client estimates page */
body.client tr[id^="proposal_"] {
    display: none !important;
}

.billing-summary-section .invoice-total-table {
    width: 100%;
}

.billing-summary-section .billing-summary-label {
    padding: 10px 15px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}

.billing-summary-section .billing-summary-value {
    padding: 10px 15px;
    text-align: right;
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
}

.billing-summary-section .billing-total-row {
    background: #f8fafc;
    border-top: 2px solid #eef2f6;
}

.billing-summary-section .billing-total-label {
    padding: 15px;
    color: #1e293b;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
}

.billing-summary-section .billing-total-value {
    padding: 15px;
    text-align: right;
    color: #20aee3;
    font-weight: 800;
    font-size: 18px;
}

/* Payment Sections */
.billing-summary-section .billing-payment-row {
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
}

.billing-summary-section .billing-payment-label {
    padding: 10px 15px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.billing-summary-section .billing-payment-value {
    padding: 10px 15px;
    text-align: right;
    color: #1e293b;
    font-weight: 700;
    font-size: 15px;
}

/* Installment Sections */
.billing-summary-section .billing-installment-header {
    border-top: 2px solid #e2e8f0;
    background: #fafbfc;
}

.billing-summary-section .billing-installment-label {
    padding: 8px 15px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.billing-summary-section .billing-installment-value {
    padding: 8px 15px;
    text-align: right;
    color: #475569;
    font-weight: 700;
}

.billing-summary-section .billing-installment-row {
    background: #fafbfc;
}

.billing-summary-section .billing-installment-main-label {
    padding: 2px 15px 15px 15px;
    color: #0f172a;
    font-weight: 700;
    font-size: 14px;
}

.billing-summary-section .billing-installment-main-value {
    padding: 2px 15px 15px 15px;
    text-align: right;
    color: #1e293b;
    font-weight: 800;
    font-size: 20px;
}

/* Hide category column in estimates and proposals tables as per user request */
#estimates-list-table .estimates_col_category,
#proposals-list-table .col_category {
    display: none !important;
}

/* Truncate long text in estimates and proposals table columns */
#estimates-list-table .estimates_col_company a.text-truncate,
#estimates-list-table .estimates_col_created_by span.text-truncate,
#proposals-list-table .col_client a,
#proposals-list-table .col_doc_title,
#proposals-list-table .col_created_by {
    display: inline-block !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
