/* ═══════════════════════════════════════════════
   FINANCE / INVOICING STYLES
   ═══════════════════════════════════════════════ */

.page-subtitle {
    color: var(--color-text-secondary, #6b7280);
    font-size: 14px;
    margin: 0 0 20px;
}

/* --- Inline editable table inputs --- */
.finance-inline-input {
    padding: 6px 10px;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    background: var(--color-bg-subtle, #fff);
    color: var(--color-text, #1e293b);
}

.finance-inline-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 114, 206, 0.1);
}

.finance-input-narrow {
    width: 100px;
}

/* --- Delete / destructive button (matches users-docs-link sizing) --- */
.finance-delete-btn {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
    white-space: nowrap;
}

.finance-delete-btn:hover {
    box-shadow: var(--shadow-btn-hover);
}

/* --- Empty state --- */
.finance-empty {
    text-align: center;
    padding: 32px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════
   INVOICE STATUS BADGES
   ═══════════════════════════════════════════════ */
/* Shape comes from the shared badge rules in styles.css. Only colour lives here. */

.invoice-badge-draft {
    color: #4b6bab;
    background: #eff6ff;
}

.invoice-badge-unpaid {
    color: var(--color-amount-out, #b0703a);
    background: var(--color-amount-out-bg, #fdf6ef);
}

.invoice-badge-sent,
.invoice-badge-booked {
    color: #4b6bab;
    background: #eff6ff;
}

/* Booked for a date now past and still unbilled. The same amber every other
   figure running against the club takes, because that is what this is: either
   the flight did not happen, or it did and nobody has been charged. */
.invoice-badge-booked-not-flown {
    color: var(--color-amount-out, #b0703a);
    background: var(--color-amount-out-bg, #fdf6ef);
}

.invoice-badge-paid {
    color: var(--color-amount-in, #5b8c72);
    background: var(--color-amount-in-bg, #f2f8f4);
}

.invoice-badge-partial {
    color: #a16207;
    background: #fefce8;
}

.invoice-badge-voided {
    color: #64748b;
    background: #f1f5f9;
}

.invoice-badge-confirmed {
    color: var(--color-amount-in, #5b8c72);
    background: var(--color-amount-in-bg, #f2f8f4);
}

.invoice-badge-cancelled {
    color: #64748b;
    background: #f1f5f9;
}

/* ═══════════════════════════════════════════════
   INVOICE FILTERS
   ═══════════════════════════════════════════════ */
.finance-filters {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.finance-filter-form {
    display: flex;
    gap: 8px 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.finance-filter-form .form-field {
    flex: 1;
    /* Narrower than the old 140px, so more filters fit on one row before it
       wraps to a second and doubles the height of the bar. */
    min-width: 120px;
}

.finance-filter-form select,
.finance-filter-form input[type="date"] {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════
   INVOICE DETAIL
   ═══════════════════════════════════════════════ */
.invoice-top-row {
    display: flex;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 16px;
}

.invoice-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex: 0 0 auto;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.invoice-header-right {
    display: flex;
    gap: 8px;
}

.invoice-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px 24px;
    flex: 1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.invoice-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.invoice-meta-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #6b7280;
}

.invoice-meta-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-amount, #3f3f46);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.invoice-nav-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.invoice-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

/* FIX 1 -Dark theme: invoice detail cards */
[data-palette="phpstorm_classic"] .invoice-header,
[data-palette="phpstorm_classic"] .invoice-meta-grid,
[data-palette="phpstorm_teal"] .invoice-header,
[data-palette="phpstorm_teal"] .invoice-meta-grid {
    background: var(--color-surface) !important;
    border-color: var(--color-border) !important;
}

[data-palette="phpstorm_classic"] .invoice-header h2,
[data-palette="phpstorm_teal"] .invoice-header h2 {
    color: var(--color-text) !important;
}

[data-palette="phpstorm_classic"] .invoice-meta-value,
[data-palette="phpstorm_teal"] .invoice-meta-value {
    color: var(--color-text) !important;
}

[data-palette="phpstorm_classic"] .invoice-meta-label,
[data-palette="phpstorm_teal"] .invoice-meta-label {
    color: var(--color-text-secondary) !important;
}

/* Dark theme: finance inline inputs, selects, page subtitle */
[data-palette="phpstorm_classic"] .finance-inline-input,
[data-palette="phpstorm_teal"] .finance-inline-input {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

[data-palette="phpstorm_classic"] .finance-inline-input:focus,
[data-palette="phpstorm_teal"] .finance-inline-input:focus {
    border-color: var(--color-primary-bg);
    box-shadow: 0 0 0 3px rgba(130, 170, 255, 0.15);
}

[data-palette="phpstorm_classic"] .page-subtitle,
[data-palette="phpstorm_teal"] .page-subtitle {
    color: var(--color-text-secondary);
}

/* --- Line items table --- */
.flight-group-separator td {
    padding: 4px 0 !important;
    border-bottom: 2px solid #e5e7eb !important;
}

/* A discount is a reduction, not a warning. Amber, like every other figure that
   moves money the other way. */
.discount-row td {
    color: var(--color-amount-out, #b0703a);
}

/* A line type is a definition, so it is outlined rather than filled. Colour only:
   the shape is the shared badge rule in styles.css. */
.line-type-badge.line-type-badge {
    color: #64748b;
    border-color: #cbd5e1;
}

.invoice-total-row td {
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
}

.invoice-grand-total-row td {
    border-top: 2px solid var(--color-text, #1e293b);
    background: var(--color-bg-subtle, #f0f7ff);
}

.users-th-right {
    text-align: right !important;
}

/* --- Inline line item editing --- */
.line-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    transition: all 0.15s ease;
    font-family: inherit;
    color: #6b7280;
}

.line-icon-btn:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.line-icon-add {
    color: #059669;
    border-color: #6ee7b7;
    background: #d1fae5;
    font-size: 16px;
    font-weight: 700;
}

.line-icon-add:hover {
    box-shadow: var(--shadow-btn-hover);
}

.line-icon-edit:hover {
    box-shadow: var(--shadow-btn-hover);
}

.line-icon-copy:hover {
    box-shadow: var(--shadow-btn-hover);
}

.line-icon-delete:hover {
    box-shadow: var(--shadow-btn-hover);
}

.line-icon-save {
    color: #059669;
    border-color: #6ee7b7;
    background: #d1fae5;
}

.line-icon-save:hover {
    box-shadow: var(--shadow-btn-hover);
}

.line-icon-cancel {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fee2e2;
}

.line-icon-cancel:hover {
    box-shadow: var(--shadow-btn-hover);
}

.line-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.line-edit-row {
    background: #eff6ff;
}

.line-edit-row td {
    padding: 6px 8px !important;
    vertical-align: middle;
}

.line-edit-row .finance-inline-input {
    font-size: 12px;
    padding: 5px 8px;
}

.line-edit-row select.finance-inline-input {
    font-size: 12px;
    padding: 4px 6px;
    min-width: 100px;
}

.line-add-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    border: 1px dashed #d1d5db;
    border-radius: 0 0 14px 14px;
    background: #fafafa;
    color: #059669;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.line-add-btn:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #047857;
}

/* ═══════════════════════════════════════════════
   BILLING CATEGORIES
   ═══════════════════════════════════════════════ */

/* --- Override generic settingsStyle.css rules for billing categories --- */
.container .flag-toggle {
    display: inline-block;
    margin-top: 0;
}
.container .flag-toggle input[type="checkbox"] {
    width: 0;
    height: 0;
    padding: 0;
    margin: 0;
}
.container .bc-add-toggles label.toggle-pill {
    display: flex;
    margin-top: 0;
}
.container .bc-add-toggles .toggle-pill input[type="checkbox"] {
    width: 16px;
    padding: 0;
    margin: 0;
}
.container .bc-add-toggles .form-field {
    margin-top: 0;
}
.container .bc-add-toggles .form-field label {
    margin-top: 0;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary, #4b5563);
}
.container form button.users-docs-link {
    margin-top: 0;
    color: #0072ce;
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 13px;
}
.container form button.users-docs-link:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(0, 114, 206, 0.15);
}
.container form button.finance-delete-btn {
    margin-top: 0;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 13px;
}
.container form button.finance-delete-btn:hover {
    box-shadow: var(--shadow-btn-hover);
}

/* --- Table row actions --- */
.bc-actions {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

/* --- Add form layout --- */
.bc-add-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.bc-add-toggles {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.container form .bc-add-btn {
    margin-top: 0;
}

@media (max-width: 700px) {
    .bc-add-grid {
        grid-template-columns: 1fr;
    }
    .bc-add-toggles {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .finance-filter-form {
        flex-direction: column;
    }

    /* FIX 2 -Side-by-side cards on mobile, equal height */
    .invoice-top-row {
        flex-direction: row;
        gap: 10px;
        align-items: stretch;
        margin-bottom: 12px;
    }

    .invoice-header,
    .invoice-meta-grid {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 12px;
        box-sizing: border-box;
        align-self: stretch;
    }

    .invoice-header {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .invoice-meta-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .invoice-meta-grid select.finance-inline-input {
        width: 100%;
        font-size: 14px;
        height: 36px;
    }

    .invoice-meta-label {
        font-size: 9px;
    }

    /* FIX 1 -All action buttons in one row */
    .invoice-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 16px;
    }

    .invoice-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
        height: 44px;
        font-size: 13px;
        white-space: nowrap;
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════
   PAST BOOKING ROWS & FLIGHT STATUS BADGES
   ═══════════════════════════════════════════════ */
.booking-row-past td {
    color: #9ca3af;
}

.flight-badge-flown {
    color: var(--color-amount-in, #5b8c72);
    background: var(--color-amount-in-bg, #f2f8f4);
}

.flight-badge-not-flown {
    color: #a16207;
    background: #fefce8;
}

/* --- Quick filter buttons (Today / This Week / This Month) --- */
.filter-quick-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* ═══════════════════════════════════════════════
   BILLING SETTINGS TABS
   ═══════════════════════════════════════════════ */
.billing-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border, #e5e7eb);
    margin-bottom: 24px;
}

.billing-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary, #6b7280);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.billing-tab:hover {
    color: var(--color-text, #1e293b);
}

.billing-tab.active {
    color: var(--color-primary-bg, #0072ce);
    border-bottom-color: var(--color-primary-bg, #0072ce);
}

/* ═══════════════════════════════════════════════
   INVOICE TEMPLATE SETTINGS
   ═══════════════════════════════════════════════ */
.invoice-tpl-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.invoice-tpl-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 80px;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}

.invoice-tpl-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 114, 206, 0.1);
}

.invoice-tpl-preview-wrap {
    position: sticky;
    top: 24px;
}

.invoice-tpl-preview {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 40px 36px;
    aspect-ratio: 210 / 297;
    overflow: hidden;
    font-size: 11px;
    color: #333;
    display: flex;
    flex-direction: column;
}

.invoice-tpl-preview h2 {
    font-size: 18px;
    color: var(--color-primary-text);
    margin: 0 0 4px;
}

.invoice-tpl-preview .preview-inv-number {
    font-size: 12px;
    color: #666;
    margin-bottom: 16px;
}

.invoice-tpl-preview .preview-section {
    margin-bottom: 12px;
}

.invoice-tpl-preview .preview-section-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #888;
    margin-bottom: 2px;
}

.invoice-tpl-preview .preview-section-value {
    font-size: 11px;
    color: #333;
    line-height: 1.4;
}

.preview-placeholder {
    color: #ccc;
    font-style: italic;
}

.invoice-tpl-preview .preview-line-items {
    flex: 1;
    margin: 12px 0;
    border-top: 2px solid #e5e7eb;
    padding-top: 8px;
}

.invoice-tpl-preview .preview-line-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 10px;
}

.invoice-tpl-preview .preview-totals {
    border-top: 2px solid #333;
    padding-top: 6px;
    margin-bottom: 12px;
}

.invoice-tpl-preview .preview-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    padding: 2px 0;
}

.invoice-tpl-preview .preview-total-row.grand {
    font-weight: 700;
    font-size: 12px;
}

.invoice-tpl-preview .preview-bank {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 8px 10px;
    margin-bottom: 12px;
}

.invoice-tpl-preview .preview-footer {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    font-size: 9px;
    color: #999;
    text-align: center;
}

@media (max-width: 900px) {
    .invoice-tpl-layout {
        grid-template-columns: 1fr;
    }
    .invoice-tpl-preview-wrap {
        position: static;
    }
}

/* ═══════════════════════════════════════════════
   INVOICE NOTES
   ═══════════════════════════════════════════════ */
.invoice-notes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invoice-note-item {
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-bg);
}

.invoice-note-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    font-size: 12px;
}

.invoice-note-author {
    font-weight: 600;
    color: var(--color-text);
}

.invoice-note-date {
    color: var(--color-muted);
}

.invoice-note-delete {
    background: none;
    border: none;
    color: var(--color-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    margin-left: auto;
}

.invoice-note-delete:hover {
    color: #dc2626;
}

.invoice-note-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
}

/* Paginated tables: remove inner scroll so sticky works against viewport */
.container:has(.users-table-wrap--paginated) {
    overflow: visible;
}
.users-table-wrap--paginated {
    max-height: none;
    overflow: visible;
}

/* Sticky thead below topbar for paginated (full-page) tables */
.users-table-wrap--paginated .users-table thead tr:first-child th {
    top: 46px;
    z-index: 11;
}
.users-table-wrap--paginated .users-table thead tr:nth-child(2) th {
    top: 85px;
    z-index: 10;
}

/* ═══════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3px;
    margin-top: 16px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 7px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #fff;
    text-decoration: none;
    transition: all 0.15s ease;
}

.pagination-link:hover:not(.pagination-disabled):not(.pagination-active) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-active {
    color: #fff;
    background: var(--color-primary, #0072ce);
    border-color: var(--color-primary, #0072ce);
}

.pagination-disabled {
    color: #d1d5db;
    cursor: default;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 26px;
    font-size: 12px;
    color: #9ca3af;
}

/* ═══════════════════════════════════════════════
   CLICKABLE TABLE ROWS
   ═══════════════════════════════════════════════ */
.clickable-row {
    cursor: pointer;
    transition: background 0.12s ease;
}

.clickable-row:hover {
    background: var(--color-hover-row, #f0f7ff);
}

/* ═══════════════════════════════════════════════
   SALES CATEGORIES
   ═══════════════════════════════════════════════ */
.sales-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px 24px;
    padding: 8px 0 16px;
}

.sales-categories-actions {
    padding-top: 8px;
    border-top: 1px solid var(--color-border, #e5e7eb);
}

/* ═══════════════════════════════════════════════
   CREDIT SYSTEM
   ═══════════════════════════════════════════════ */
/* --- Money figures ------------------------------------------------------
   Every summary of amounts in Finance and My Finance. Quiet on purpose.

   These were 20px bold in primary blue, with green and red for direction, so a
   panel of five figures shouted five different things at once and the one that
   mattered was no easier to find than the rest. Colour carried the meaning too,
   which is no use to a reader who cannot separate the hues and none at all on
   paper.

   Now: near-black numbers at a readable size, tabular so the digits line up
   down the column, separated by hairlines. The wording says which way the money
   goes, so the colour does not have to.
*/
.credit-summary {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    padding: 4px 20px;
    margin-bottom: 20px;
}

.credit-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border-subtle, #f1f5f9);
}

.credit-summary-row:last-child {
    border-bottom: 0;
}

.credit-summary-balance {
    /* The figure a reader came for, so it keeps a rule above it and a little
       more weight. Nothing louder than that. */
    border-top: 1px solid var(--color-border, #e5e7eb);
    font-weight: 600;
}

.credit-summary-label {
    color: var(--color-text-secondary, #6b7280);
    font-size: 13px;
    font-weight: 400;
}

.credit-summary-value {
    color: var(--color-amount, #3f3f46);
    font-size: 13px;
    font-weight: 400;
    /* Digits of one width, so figures in a column align without a table. */
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    white-space: nowrap;
}

.credit-balance-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-amount, #3f3f46);
}

/* Direction is in the label, so these only tint. Sage and amber rather than a
   signal green and red: unpaid is not a fault and paid is not a triumph. */
.credit-positive {
    color: var(--color-amount-in, #5b8c72);
}

.credit-negative {
    color: var(--color-amount-out, #b0703a);
}

.credit-topup-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border, #e5e7eb);
}
.credit-section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text-primary, #1f2937);
}
.credit-topup-note {
    font-size: 13px;
    color: var(--color-text-secondary, #6b7280);
    margin-bottom: 12px;
}
.credit-topup-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.credit-topup-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text-primary, #1f2937);
}
.credit-topup-input {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 6px;
    font-size: 14px;
    background: var(--color-bg-input, #fff);
    color: var(--color-text-primary, #1f2937);
}
.credit-topup-error {
    color: var(--color-danger, #dc2626);
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
}
.credit-stripe-element {
    display: none;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 6px;
    background: var(--color-bg-input, #fff);
}
.credit-confirm-btn {
    margin-top: 12px;
}
.credit-success-notice {
    background: var(--color-success-bg, #f0fdf4);
    border: 1px solid var(--color-success-border, #bbf7d0);
    color: var(--color-success, #16a34a);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.credit-ledger-table {
    width: 100%;
}
.credit-ledger-table th,
.credit-ledger-table td {
    padding: 8px 12px;
    font-size: 13px;
}
.credit-ledger-table th {
    text-align: left;
}

/* Outstanding balance column in transactions */
.outstanding-badge--partial {
    color: #a16207;
    background: #fefce8;
}
.outstanding-badge--unpaid {
    color: var(--color-amount-out, #b0703a);
    background: var(--color-amount-out-bg, #fdf6ef);
}

/* Credit applied / outstanding in invoice detail totals.
   Calm sage rather than a deep success green, and regular weight: these are two
   figures among several on the same panel and none of them is an announcement. */
.credit-applied-label {
    text-align: right;
    font-weight: 400;
    color: var(--color-amount-in, #5b8c72);
}
.credit-applied-value {
    text-align: right;
    font-weight: 400;
    color: var(--color-amount-in, #5b8c72);
    font-variant-numeric: tabular-nums;
}
.outstanding-label {
    text-align: right;
    font-weight: 500;
    font-size: 13px;
}
/* The amount still due on an invoice. Amber and 500: still the figure a reader
   looks for, but a signal red made every unpaid invoice look like a problem. */
.outstanding-value {
    text-align: right;
    font-weight: 500;
    font-size: 13px;
    color: var(--color-amount-out, #b0703a);
    font-variant-numeric: tabular-nums;
}

/* Credit applied tag in transaction lists */
.credit-applied-tag {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--color-amount-in, #5b8c72);
    margin-top: 2px;
}

/* "Paid by credit" badge in Outstanding column */
.outstanding-badge--paid {
    color: var(--color-amount-in, #5b8c72);
    background: var(--color-amount-in-bg, #f2f8f4);
}

/* Document type, one hue each.
   Colours only: the shape is on .type-badge, shared with .invoice-badge above.

   None of these reuses a Status colour. Amber means unpaid and green means paid one
   column across, and the same colour must not also stand for a kind of document.
   Written as literal hex to match the .invoice-badge-* variants they sit beside, which
   is the closest neighbour; theming the two halves of one control differently would
   look worse than either. */

/* The ordinary case, so the quietest. Slate rather than the grey DRAFT uses. */
.type-badge--invoice {
    color: #64748b;
    border-color: #cbd5e1;
}

/* A bill we owe. Teal, and the Direction column says "Paid to you" beside it. */
.type-badge--purchase {
    color: #0f766e;
    border-color: #5eead4;
}

/* Member money held as credit, not yet earned. */
.type-badge--advance {
    color: #4f46e5;
    border-color: #a5b4fc;
}

.type-badge--credit-note {
    color: #7c3aed;
    border-color: #c4b5fd;
}

.type-badge--credit-topup {
    color: #0891b2;
    border-color: #67e8f9;
}

/* ═══════════════════════════════════════════════
   INVOICE SETTINGS TABS
   ═══════════════════════════════════════════════ */
.tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border, #e5e7eb);
    margin-bottom: 24px;
}

.tabs-nav .tab-btn {
    text-decoration: none;
}

/* ═══════════════════════════════════════════════
   NUMBERING PREVIEW
   ═══════════════════════════════════════════════ */
.numbering-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.numbering-preview-label {
    font-size: 14px;
    color: var(--color-text-secondary, #6b7280);
}

.numbering-preview-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    background: var(--color-bg-card, #f3f4f6);
    padding: 4px 10px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
/* Chart-of-accounts dropdowns in the Xero and Stripe settings pages. */
.finance-account-select {
    width: 100%;
    max-width: 400px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: inherit;
    font-size: 14px;
}

.finance-account-select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

/* Unspent Credits page. */
.unspent-remaining {
    font-weight: 600;
}

.unspent-footnote {
    margin-top: 12px;
}

/* Agencies settings page. */
.agency-delete-form {
    display: inline;
}

.agency-rate-card {
    margin-top: 24px;
}

.agency-rate-group td {
    font-weight: 600;
    background: var(--color-bg-alt, #f6f7f8);
    font-size: 13px;
}

.agency-rate-duration {
    color: #888;
    font-size: 12px;
    margin-left: 6px;
}

.agency-rate-retail {
    color: #888;
}

.agency-rate-empty {
    color: #888;
    font-size: 13px;
}

.agency-rate-actions {
    margin-top: 16px;
}

.agency-address-field {
    margin-top: 12px;
}

.agency-add-btn {
    margin-top: 16px;
}

.agency-rate-link {
    text-decoration: none;
    color: inherit;
}

.agency-rate-link:hover {
    text-decoration: underline;
}

.agency-rates-btn {
    padding: 4px 10px;
    font-size: 12px;
    margin-left: 6px;
}

.agency-rate-card {
    scroll-margin-top: 16px;
}

/* Rate card: the rule belongs in the header, not as ghost text inside the input where it
   reads as a value. */
.agency-rate-hint {
    display: block;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    color: var(--color-text-secondary, #6b7280);
    margin-top: 2px;
}

.agency-rate-currency {
    color: #888;
    margin-right: 2px;
}

.agency-rate-input {
    text-align: right;
}

.agency-rate-state {
    display: block;
    font-size: 11px;
    color: #b45309;
    margin-top: 2px;
}

/* Marks an invoice billed to an agency rather than a member, in a list where the column
   would otherwise be read as a pilot name. */
.payer-kind {
    display: inline-block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    border: 1px solid var(--color-border, #d1d5db);
    border-radius: 3px;
    padding: 1px 4px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Agency reports. */
.agency-report-total {
    font-weight: 600;
}

.agency-age-days {
    font-size: 11px;
    color: #6b7280;
    margin-left: 4px;
}

/* Instructor rates: the hourly-pay opt-in. */
.instructor-pay-hint {
    /* Only the bits that undo the uppercased, letter-spaced table heading it
       sits inside. Everything else comes from .field-hint. */
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
    margin-top: 2px;
}

.instructor-bank-na {
    color: #b0b7bd;
}

.instructor-pay-note {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 10px;
    max-width: 70ch;
}

/* Instructor payment details in My Account. */
.bank-vat-heading {
    margin-top: 20px;
}

.bank-save-btn {
    margin-top: 20px;
}

.bank-rate-card {
    margin-top: 20px;
}

.bank-privacy-note {
    margin-top: 16px;
}

/* Instructor payout run on the Purchase Invoices page. */
.payout-run-output {
    margin-bottom: 20px;
}

.payout-run-log {
    margin: 0;
    padding: 12px 16px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--color-text, #333);
}

.payout-blocked-list {
    margin: 6px 0 6px 18px;
    padding: 0;
}

.payout-period-note {
    margin-top: 10px;
    max-width: 72ch;
}

.payout-run-btn {
    margin-top: 12px;
}

.instructor-unbilled-card {
    margin-top: 24px;
}

/* --- Readiness checklist -------------------------------------------------
   Shown on Xero Integration and Stripe Integration: what still has to be
   configured before invoicing and member credit work.

   Treated as a warning, because that is what it is while anything is
   outstanding: invoices are not reaching Xero and members are being turned
   away. Amber rather than red, since nothing is broken and no data is at risk,
   there is simply setup left to finish.
*/
.readiness-card--warning {
    background: var(--color-warning-bg, #fffbeb);
    border: 1px solid var(--color-warning-border, #fde68a);
    border-left: 4px solid var(--color-warning, #f59e0b);
}

.readiness-summary {
    margin: 0 0 18px;
    max-width: 90ch;
    font-size: 14px;
    line-height: 1.55;
    color: var(--color-text, #1e293b);
}

.readiness-card--warning .readiness-summary {
    color: var(--color-warning-text, #92400e);
}

.readiness-group {
    margin: 20px 0 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-warning-border, #fde68a);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--color-text-secondary, #6b7280);
}

.readiness-group:first-of-type {
    margin-top: 0;
}

/* Grid rather than flex: the badge column stays a fixed width and the text
   column wraps under itself, so a long explanation lines up with its own
   heading instead of running back under the badge. */
.readiness-row {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 4px 12px;
    align-items: baseline;
    padding: 12px 0;
}

.readiness-row + .readiness-row {
    border-top: 1px solid var(--color-border-light, #f1f3f5);
}

.readiness-card--warning .readiness-row + .readiness-row {
    border-top-color: var(--color-warning-border, #fde68a);
}

.readiness-item {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #1e293b);
}

/* Second grid row, under the label rather than under the badge. */
.readiness-detail {
    grid-column: 2;
    max-width: 82ch;
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-secondary, #6b7280);
}

/* A met condition is reference, not a task: quieter, and no instructions. */
.readiness-row--met .readiness-item {
    font-weight: 400;
    color: var(--color-text-secondary, #6b7280);
}

@media (max-width: 600px) {
    .readiness-row {
        grid-template-columns: 1fr;
    }

    .readiness-detail {
        grid-column: 1;
    }
}

/* The receivable and payable explanation above the account code mapping. */
.account-map-guide {
    margin: 8px 0 14px;
    padding-left: 20px;
}

.account-map-guide li {
    margin-bottom: 6px;
}

/* --- Stacked settings cards ---------------------------------------------
   The Xero Integration page stacks several .users-table-card panels. They each
   carried style="margin-top:24px" inline, which is the same rule written four
   times and cannot be themed. Named for the shape rather than for the page, so
   the next stacked card is a reuse.
*/
.finance-card-stacked {
    margin-top: 24px;
}

/* Error text inside a table cell: a Xero refusal, shown in full so the page
   answers the question rather than pointing at a log. Uses the shared danger
   colour so the [data-palette] overrides theme it, which the hardcoded #991b1b
   it replaces did not. */
.finance-error-cell {
    color: var(--color-danger-text, #991b1b);
    font-size: 12px;
}

/* --- Reactive search on a report -----------------------------------------
   Sits above the summary figures it filters. One row on wide screens, stacked
   on a phone, and the field takes the width it can rather than a fixed size,
   because a voucher reference can be long.
*/
.report-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
}

.report-search label {
    color: var(--color-text-secondary, #6b7280);
    font-size: 13px;
    font-weight: 600;
}

.report-search input[type="search"] {
    flex: 1 1 200px;
    max-width: 280px;
    /* 30px matches the filter controls beside it. The mobile block below puts
       it back to 44px, which is the size a thumb needs. */
    min-height: 30px;
    padding: 4px 10px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    background: var(--color-bg, #fff);
    color: var(--color-text, #1e293b);
    font-size: 14px;
}

.report-search input[type="search"]:focus {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 1px;
}

.report-search .field-hint {
    /* Reset the block layout .field-hint uses under a form control. */
    display: inline;
    margin-top: 0;
}

@media (max-width: 600px) {
    .report-search input[type="search"] {
        max-width: none;
        /* A comfortable tap target, the same as the filter controls get at
           this width. */
        min-height: 44px;
    }
}

/* --- Which way the money goes, on a member's own finance list -------------
   My Finance lists both directions in one table. The only thing separating an
   instructor's own pay from their own flying bill used to be the PIV or INV in
   the reference, and the Type column called both of them "Invoice".

   Stated in words as well as in colour, because colour alone is no use to a
   reader who cannot distinguish these two and none at all in a printout.
*/
.money-direction {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.money-direction--in {
    color: var(--color-amount-in, #5b8c72);
}

.money-direction--out {
    color: var(--color-text-secondary, #6b7280);
}

.outstanding-badge--due-to-you {
    color: var(--color-amount-in, #5b8c72);
    background: var(--color-amount-in-bg, #f2f8f4);
}

/* Every amount in a finance table: calm, regular weight. The inline
   font-weight:600 this replaced made a whole column shout.

   Deliberately not `td.text-right`, which is how the first version of this was
   written. That selector carries one more point of specificity than a bare
   class, so it beat `.credit-positive` on cells marked
   `class="text-right credit-positive"` and stripped the tint off every figure
   owed to a member. */
.my-finance-amount,
.agency-report-total,
.agency-rate-retail,
.unspent-remaining {
    color: var(--color-amount, #3f3f46);
    font-weight: 400;
}

/* Alignment only, so it cannot fight a colour anywhere. Figures line up down a
   column whether or not they carry a direction tint. */
.text-right,
.credit-summary-value,
.account-balance-value,
.outstanding-badge {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* --- Money in both directions, above a transaction list -------------------
   Uses the existing .credit-summary rows so it matches the other summary
   blocks in Finance rather than introducing a second kind of figure panel.
*/
.transaction-totals-settled .credit-summary-label,
.transaction-totals-settled .credit-summary-value {
    /* Settled history, quieter than the outstanding figures above it. */
    color: var(--color-text-secondary, #6b7280);
    font-weight: 500;
}

.transaction-totals-note {
    margin: -6px 0 16px;
}

/* --- Account balance, over the Outstanding column ------------------------
   The net of everything still outstanding, sitting immediately above the table
   and aligned to its right edge so it reads as the sum of the column beneath.
*/
.account-balance-bar {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 0 0 8px;
    padding: 0 2px;
}

.account-balance-label {
    color: var(--color-text-secondary, #6b7280);
    font-size: 13px;
}

.account-balance-value {
    color: var(--color-amount, #3f3f46);
    font-size: 15px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    white-space: nowrap;
}

/* Two classes, so the tint beats the base colour above whatever the source order.
   With one class each they tied, and this rule being later in the file meant the
   grey won and the figure was never green or amber at all: the markup applied the
   class and nothing showed. The same specificity trap as `td.text-right` earlier. */
.account-balance-value.credit-positive,
.credit-summary-value.credit-positive {
    color: var(--color-amount-in, #5b8c72);
}

.account-balance-value.credit-negative,
.credit-summary-value.credit-negative {
    color: var(--color-amount-out, #b0703a);
}

.account-balance-qualifier {
    color: var(--color-text-secondary, #6b7280);
    font-size: 13px;
}

@media (max-width: 600px) {
    .account-balance-bar {
        justify-content: flex-start;
    }
}

/* --- The breakdown behind the account balance -----------------------------
   Two pairs, always all four figures. A zero is information: it says that side
   is clear. Suppressing them made the panel look as though a row had failed to
   render, and the net is not repeated here because the balance bar above the
   table already carries it.
*/
.transaction-totals-group + .transaction-totals-group {
    margin-top: 2px;
    border-top: 1px solid var(--color-border, #e5e7eb);
}

.transaction-totals-group-title {
    margin: 12px 0 2px;
    color: var(--color-text-secondary, #6b7280);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.transaction-totals-group .credit-summary-row:last-child {
    border-bottom: 0;
}

/* Settled figures are history, so they sit back from the outstanding pair. */
.transaction-totals-group:last-child .credit-summary-value {
    color: var(--color-text-secondary, #6b7280);
}

/* --- Page typeface -------------------------------------------------------
   Nunito Sans across the finance and report pages. Loaded from Google Fonts in
   the views that pull this stylesheet, the same way dashboard.php, techlog.php
   and flightTrack.php already load Inter.

   Scoped to `.container`, the wrapper these pages put their content in, rather
   than to body: this stylesheet only loads on finance and report pages, so it
   cannot reach activePilot or any other mobile view, which stay on the system
   stack as the standing rule requires. The topbar sits outside .container and
   is shared with every other page, so it keeps the app-wide font.

   It began on the tables alone, which left the filter inputs and the date
   fields in the browser's own font beside labels in this one. Form controls do
   not inherit font-family: a browser uses its UA default for input, select,
   textarea and button unless told otherwise, which is what the inherit rule
   below is for. styles.css already does exactly this for body.techlog-page.

   The system stack is the fallback, so a blocked or slow font request leaves
   the pages readable rather than falling back to a serif.
*/
.container,
.org-settings-page {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, sans-serif;
}

.container input,
.container select,
.container textarea,
.container button,
.container optgroup,
.container option,
.container .btn,
.org-settings-page input,
.org-settings-page select,
.org-settings-page textarea,
.org-settings-page button,
.org-settings-page optgroup,
.org-settings-page option,
.org-settings-page .btn {
    font-family: inherit;
}

/* Figures keep the tabular digits the typeface provides, so columns still line
   up now that the font has changed. */
.users-table .text-right,
.data-table .text-right,
.credit-summary-value,
.account-balance-value {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* --- Outstanding figures --------------------------------------------------
   Money still owed, either way. Amber, from the same token as every other
   figure that runs against the organisation: an invoice it has not collected
   is cash that is not in the bank, exactly as a bill it has not paid is.

   Named for what it is rather than reusing .credit-negative, which is named
   for a direction and would read oddly on "Still owed to us".
*/
.amount-outstanding {
    color: var(--color-amount-out, #b0703a);
}

/* Total Invoiced and Total Paid when they disagree.

   Its own name rather than reusing .amount-outstanding: that one means "this is
   money still owed", which is a property of one figure, while this marks a pair
   that does not reconcile. Same amber, because both mean "look at this", and the
   finance pages carry no second alert colour.

   Not signal red, which is what My Billing used: #c0392b on Total Invoiced and
   Total Paid meant every report of a business that is owed anything at all came
   up red, and a warning that is always on is not a warning. */
.amount-mismatch {
    color: var(--color-amount-out, #b0703a);
}

/* A category on a billing report that runs the other way: money the club pays
   out rather than collects. Said in words as well as by the sign, because a
   minus in a column of figures is easy to miss. */
.report-direction-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border: 1px solid var(--color-amount-out, #b0703a);
    border-radius: 4px;
    color: var(--color-amount-out, #b0703a);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* Replaces the inline font-weight/border on the totals row. */
.report-total-row {
    font-weight: 600;
}

.report-total-row td {
    border-top: 2px solid var(--color-border, #d1d5db);
}

/* --- Finance report tab groups -------------------------------------------
   The reports are all about money coming in except the last, which is money
   the club pays out. A rule between them, so the outgoing report does not read
   as another income report.
*/
.billing-tabs-divider {
    align-self: center;
    width: 1px;
    height: 18px;
    margin: 0 6px;
    background: var(--color-border, #e5e7eb);
}

/* The outgoing group takes the amber used for every other figure that runs
   against the organisation, so the direction is legible before it is clicked. */
.billing-tab--out {
    color: var(--color-amount-out, #b0703a);
}

.billing-tab--out.active {
    color: var(--color-amount-out, #b0703a);
    border-bottom-color: var(--color-amount-out, #b0703a);
}

/* --- Report summary strip -------------------------------------------------
   The figures above a finance report. One component for all six of them: three
   used a vertical panel of rows and three used this strip, so moving between
   two tabs of the same report set changed the shape of the header.

   Tighter than the invoice header grid it shares markup with, because a report
   shows five or six figures rather than three.
*/
.report-summary {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px 16px;
    padding: 12px 16px;
    margin-bottom: 14px;
}

/* --- The figures above a report ------------------------------------------
   Two classes, so a tint beats `.invoice-meta-value`'s base colour whatever the
   source order. Declared as single classes they tie, and the later rule wins:
   the figure then carries the right class and shows the wrong colour, which no
   test asserting "the class is applied" can see. The same specificity trap as
   `td.text-right` and `.account-balance-value` above.
*/
.invoice-meta-value.credit-positive {
    color: var(--color-amount-in, #5b8c72);
}

.invoice-meta-value.amount-outstanding {
    color: var(--color-amount-out, #b0703a);
}

/* --- A grouped strip -----------------------------------------------------
   A flex row rather than the grid, so a rule can sit between two figures.
   In the grid every child takes a full track, so a 1px rule would occupy
   150px of one. Two classes, so this beats `.invoice-meta-grid`'s own
   `display: grid` whatever the source order.

   Only Total Billing groups its figures, because only Total Billing has two
   directions to keep apart. The other five reports pass no groups and keep
   the grid exactly as it was.
*/
.report-summary.report-summary-grouped {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 20px;
}

/* The figures spread across the panel, the way the grid's 1fr tracks did.
   A flex row packs its children at the start by default, which left every
   figure bunched against the left edge with a hand's width of empty panel
   after the last one. Growing equally keeps the dividers tight to the
   boundaries they mark, which justify-content would not: it would space the
   dividers like figures and float them between the two groups. */
.report-summary.report-summary-grouped .invoice-meta-item {
    flex: 1 1 auto;
}

/* Same rule as the tab strip's, so the two dividers in Finance match. */
.report-summary-divider {
    align-self: center;
    width: 1px;
    height: 26px;
    background: var(--color-border, #e5e7eb);
}

/* A line under a figure saying what it counts, where the label alone cannot.
   Genuinely new: `.field-hint` is the app's hint under a form control and is
   sized for one, which in a strip of 11px labels reads as another figure. Named
   for what it is rather than for the report that needed it. Kept to one short
   phrase, because a strip is not the place for a sentence. */
.report-summary-hint {
    display: block;
    margin-top: 1px;
    color: var(--color-text-secondary, #6b7280);
    font-size: 10px;
    line-height: 1.3;
}

/* The main figure: the balance the rest of the row explains.
   The one figure in Finance over weight 500 or 15px, which is a deliberate
   exception and is asserted as such in AmountStyleTest.

   17px, arrived at from both sides. At 15px with weight 600 it was
   indistinguishable from the six figures beside it, which is the problem this
   strip was rebuilt to fix. At 20px it was too big for a strip of figures.
   Three pixels over its neighbours, with the weight and the tint, is enough to
   be read first without becoming a heading. Everything else stays at regular
   weight: a panel of bold amounts is what made the old one unreadable. */
.invoice-meta-value.report-summary-headline {
    font-size: 17px;
    font-weight: 600;
}

.invoice-meta-item.report-summary-headline {
    padding-right: 4px;
}

@media (max-width: 600px) {
    /* The rules would fall at the start of a wrapped line and read as a stray
       mark, so the groups stack instead and the figures keep their order. */
    .report-summary-divider {
        display: none;
    }
}

/* --- A voucher booked in the past and still unbilled ----------------------
   The text is amber, the row keeps its own background. Asked for as "booked
   not flown rows must be marked (just the text not the whole row space)
   amber".

   Class plus element, so this beats the single-class colours on the money
   cells (.agency-report-total sets its own grey). No !important: the extra
   point of specificity is what a context override is supposed to use.
*/
.voucher-row-not-flown td {
    color: var(--color-amount-out, #b0703a);
}

/* Dark palettes: keep the amount tints on table cells.
   The app-wide dark theme sets every td to var(--color-text) with !important, which
   silently removed these colours in dark mode. Naming the tint class here makes the
   selector more specific than that rule, so the tint wins regardless of file order. */
[data-palette="phpstorm_classic"] .discount-row td,
[data-palette="phpstorm_teal"] .discount-row td,
[data-palette="phpstorm_classic"] .voucher-row-not-flown td,
[data-palette="phpstorm_teal"] .voucher-row-not-flown td,
[data-palette="phpstorm_classic"] td.amount-outstanding,
[data-palette="phpstorm_teal"] td.amount-outstanding,
[data-palette="phpstorm_classic"] td.credit-negative,
[data-palette="phpstorm_teal"] td.credit-negative {
    color: var(--color-amount-out, #b0703a) !important;
}

[data-palette="phpstorm_classic"] td.credit-positive,
[data-palette="phpstorm_teal"] td.credit-positive {
    color: var(--color-amount-in, #5b8c72) !important;
}

/* Finances > Flights. Sixteen columns (eighteen with CFI) did not fit the card: every
   header was nowrap at the table's 14px padding, so the table ran past the card's edge.
   Tighter cells, headers that may wrap, and Fuel surcharge capped so it takes two lines.
   Amounts, invoice numbers and the discount group stay on one line. Phone widths scroll
   sideways through the shared .users-table-wrap--paginated rule in styles.css; an
   overflow here would make the sticky header stick inside the wrapper, over row one. */

.users-table.billing-report-table th {
    white-space: normal;
    padding: 10px 8px;
    line-height: 1.25;
}

.users-table.billing-report-table td {
    padding: 10px 8px;
    font-size: 13px;
}

.users-table.billing-report-table .text-right,
.users-table.billing-report-table .users-th-right,
.users-table.billing-report-table .billing-td-nowrap {
    white-space: nowrap;
}

.users-table.billing-report-table .users-th-right.billing-th-wrap {
    white-space: normal;
    width: 84px;
    max-width: 84px;
}
