/*
 * Invoice List Premium Badges
 * Scoped to documents list within .descriptionList
 */

#listview_documents .nav-counter {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    min-height: 18px !important;
    line-height: 1.2 !important;
    margin: 2px 5px 2px 0 !important;
    /* Reset the negative margins from index-portal.css */
    padding: 1px 7px !important;
    border-radius: 4px !important;
    /* Balanced compact style */
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: normal !important;
    border: none !important;
    /* Remove the white border */
    box-shadow: none !important;
    /* Flat look like before */
    vertical-align: middle !important;
    text-shadow: none !important;
}

#listview_documents .nav-counter.hide {
    display: none !important;
}

/* Specific colors to override global defaults and the :not() red fallback below.
   Specificity must be >= the :not() rule (1 ID + 4 pseudo-classes = 1,4,0).
   Using .nav-counter repeated brings these to 1,4,0 as well, and since they appear
   BEFORE the :not() rule, CSS cascade still requires equal specificity to win,
   so we add one extra class repeat to reach 1,5,0. */
#listview_documents .descriptionList .nav-counter.nav-counter-orange {
    background: #f59e0b !important;
    /* Modern Amber */
    color: #ffffff !important;
}

#listview_documents .descriptionList .nav-counter.nav-counter-green {
    background: #10b981 !important;
    /* Modern Emerald */
    color: #ffffff !important;
}

/* Default red badge (often for Unpaid, Canceled, or the document number if not caught by orange/green) 
   Excludes hidden elements to avoid empty red blocks */
#listview_documents .nav-counter:not(.nav-counter-orange):not(.nav-counter-green):not(.hide) {
    background: #ef4444 !important;
    /* Modern Rose/Red */
    color: #ffffff !important;
}

/* Ensure the container doesn't clip the badges and provides enough vertical space - SCOPED TO DOCUMENTS */
#listview_documents .descriptionList {
    overflow: visible !important;
    height: auto !important;
    min-height: 22px !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
}

/* Force TTC (con IVA) amount to right-align like HT (sin IVA) */
#listview_documents .descriptionListRight.fg-color-blueDark-title {
    clear: both !important;
    float: none !important;
    width: 100% !important;
    text-align: right !important;
}

/* Adjust the customer name line to follow the badges nicely - Removed margin-top to avoid clipping in other lists */
.fg-color-blueDark-title {
    font-weight: 700 !important;
    color: #1e3a8a !important;
    /* Use the brand dark blue */
}

/* Premium Styling for 'Abono' (Credit Memo) Tab and 'Comptabilizar' button */
#pageCreditMemo table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
    margin-top: 10px !important;
}

#pageCreditMemo th {
    text-align: left !important;
    padding: 10px !important;
    font-size: 12px !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

#pageCreditMemo td {
    padding: 12px 10px !important;
    background: #ffffff !important;
    vertical-align: middle !important;
    font-size: 13px !important;
}

#pageCreditMemo tr {
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

#pageCreditMemo tr:hover td {
    background: #f8fafc !important;
}

/* 'Comptabilizar' Button Premium Style */
.labelAccounted.btnconfirm {
    background-color: #2b5797 !important;
    color: white !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.025em !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.labelAccounted.btnconfirm:hover {
    background-color: #1e3a8a !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-1px) !important;
}

.labelAccounted.btnconfirm:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* Premium Styling for 'Payments' Tab buttons */
.btnPaid.btnconfirm {
    background-color: #10b981 !important;
    /* Success Green */
    color: white !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    transition: all 0.2s ease !important;
}

.btnPaid.btnconfirm:hover {
    background-color: #059669 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

#BtnRemovePayment.btnconfirm {
    background-color: #ef4444 !important;
    /* Danger Red */
    color: white !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    transition: all 0.2s ease !important;
}

#BtnRemovePayment.btnconfirm:hover {
    background-color: #dc2626 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

/* Generic table improvements for Document Detail tabs (Abono, Payments, Follow-up) */
.documentFrame table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 4px !important;
}

.documentFrame th {
    font-size: 11px !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    padding: 8px !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.documentFrame td {
    padding: 10px 8px !important;
    font-size: 13px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}