/* Style card headers with Jazzmin blue background */
.card-header {
    background-color: #17a2b8;
    color: white;
    border-bottom: 1px solid #17a2b8;
}

.card-header .card-title {
    color: white;
    margin: 0;
}

.card-header strong {
    color: white;
}

/* Hide add/change buttons on dashboard for all models except auth */
/* Target the model cards and hide their action buttons */
.dashboard-item .btn-group,
.dashboard-item .btn {
    display: none;
}

/* Show buttons only for auth models */
.dashboard-item[data-model-name*="auth"] .btn-group,
.dashboard-item[data-model-name*="auth"] .btn {
    display: inline-block;
}


/* ===== QB Line Items inline: column width control ===== */
/* Target any tabular inline that contains a line_num column (specific to QB line items) */
.tabular.inline-related:has(.column-line_num) table {
    table-layout: fixed;
    width: 100%;
}

/* Jazzmin adds text-nowrap to the table; allow wrapping in cells */
.tabular.inline-related:has(.column-line_num) td,
.tabular.inline-related:has(.column-line_num) th {
    white-space: normal;
}

/* Original/marker column — center the plus icon */
.tabular.inline-related:has(.column-line_num) th.original,
.tabular.inline-related:has(.column-line_num) td.original {
    width: 10px;
    padding: 0;
    text-align: center;
    vertical-align: middle;
}
.tabular.inline-related:has(.column-line_num) td.original p {
    margin: 0;
}

.tabular.inline-related:has(.column-line_num) .column-line_num,
.tabular.inline-related:has(.column-line_num) .field-line_num {
    width: 100px;
}

.tabular.inline-related:has(.column-line_num) .column-quantity,
.tabular.inline-related:has(.column-line_num) .field-quantity {
    width: 100px;
}

.tabular.inline-related:has(.column-line_num) .column-unit_price,
.tabular.inline-related:has(.column-line_num) .field-unit_price {
    width: 125px;
}

.tabular.inline-related:has(.column-line_num) .column-amount,
.tabular.inline-related:has(.column-line_num) .field-amount {
    width: 125px;
}

.tabular.inline-related:has(.column-line_num) .column-taxable,
.tabular.inline-related:has(.column-line_num) .field-taxable {
    width: 80px;
    text-align: center;
}

.tabular.inline-related:has(.column-line_num) .column-item,
.tabular.inline-related:has(.column-line_num) .field-item {
    width: 200px;
}

/* Delete column (last th has no class) */
.tabular.inline-related:has(.column-line_num) thead tr th:last-child,
.tabular.inline-related:has(.column-line_num) td.delete {
    width: 80px;
}

/* description gets all remaining space (no width set = auto) */

/* Override select2's hardcoded inline style="width: 320px;" */
.tabular.inline-related:has(.column-line_num) .select2-container {
    width: 100% !important;
    min-width: 0 !important;
}

/* ===== Custom Fields inline: match font to other inline card headers ===== */
.tabular.inline-related:has(.field-field_name_display) .card-header,
.tabular.inline-related:has(.field-field_name_display) .card-header h2,
.tabular.inline-related:has(.field-field_name_display) .card-header .card-title {
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
}

/* Hide the thead row in the Custom Fields inline table */
.tabular.inline-related:has(.field-field_name_display) thead {
    display: none;
}

/* Keep all inputs/textareas within their columns */
.tabular.inline-related:has(.column-line_num) td input[type="number"],
.tabular.inline-related:has(.column-line_num) td textarea {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* ===== QB Addresses inline: column width control ===== */
.tabular.inline-related:has(.column-is_billing) table {
    table-layout: fixed;
    width: 100%;
}

.tabular.inline-related:has(.column-is_billing) td,
.tabular.inline-related:has(.column-is_billing) th {
    white-space: normal;
}

.tabular.inline-related:has(.column-is_billing) th.original,
.tabular.inline-related:has(.column-is_billing) td.original {
    width: 10px;
    padding: 0;
    text-align: center;
    vertical-align: middle;
}
.tabular.inline-related:has(.column-is_billing) td.original p {
    margin: 0;
}

.tabular.inline-related:has(.column-is_billing) .column-is_billing,
.tabular.inline-related:has(.column-is_billing) .field-is_billing,
.tabular.inline-related:has(.column-is_billing) .column-is_shipping,
.tabular.inline-related:has(.column-is_billing) .field-is_shipping {
    width: 100px;
    text-align: center;
}

.tabular.inline-related:has(.column-is_billing) .column-city,
.tabular.inline-related:has(.column-is_billing) .field-city {
    width: 175px;
}

.tabular.inline-related:has(.column-is_billing) .column-state,
.tabular.inline-related:has(.column-is_billing) .field-state {
    width: 75px;
}

.tabular.inline-related:has(.column-is_billing) .column-postal_code,
.tabular.inline-related:has(.column-is_billing) .field-postal_code {
    width: 130px;
}

.tabular.inline-related:has(.column-is_billing) .column-country,
.tabular.inline-related:has(.column-is_billing) .field-country {
    width: 90px;
}

/* Delete column */
.tabular.inline-related:has(.column-is_billing) thead tr th:last-child,
.tabular.inline-related:has(.column-is_billing) td.delete {
    width: 80px;
}

/* line1 and line2 share remaining space equally */

/* Keep inputs within their columns */
.tabular.inline-related:has(.column-is_billing) td input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* ===== Admin Messages ===== */
/* Make links in success messages yellow for better readability on green background */
.alert-success a {
    color: #FFEB3B !important;
    font-weight: bold !important;
}

.alert-success a:visited {
    color: #FFEB3B !important;
}

.alert-success a:hover {
    color: #FFF59D !important;
    text-decoration: underline !important;
}

