/*
 * Heavier, darker text everywhere, for easier reading (client request, October 2026).
 *
 * Perfex loads this file on its own, after the app's styles, on every admin page
 * (the till included), the client area, the login page and the public forms.
 *
 *   weight   on every page, in light and dark mode alike
 *   colour   light mode only - dark mode (the dark theme's html[data-perfex-theme])
 *            keeps its light text. Only greys are made black: red, green and the other
 *            colours that mean something keep theirs, as do the sidebar and the top
 *            bar, whose colours Setup > Theme Style may have made dark.
 */

body {
    font-weight: 600;
}

h1, h2, h3, h4, h5, h6,
b, strong, th, label, .control-label, .bold,
.tw-font-medium, .tw-font-semibold {
    font-weight: 700;
}

html:not([data-perfex-theme="dark"]) body,
html:not([data-perfex-theme="dark"]) .table {
    color: #000;
}

html:not([data-perfex-theme="dark"]) :where(
    .text-muted, .help-block, .form-control, .input-group-addon,
    .bootstrap-select .filter-option, .dropdown-menu > li:not(.active):not(.selected) > a,
    .nav-tabs > li > a, .dataTables_info, .dataTables_length, .dataTables_filter,
    .table.items thead, .page-header,
    .tw-text-neutral-400, .tw-text-neutral-500, .tw-text-neutral-600,
    .tw-text-neutral-700, .tw-text-neutral-800, .tw-text-neutral-900,
    .tw-text-gray-400, .tw-text-gray-500, .tw-text-gray-600,
    .tw-text-gray-700, .tw-text-gray-800, .tw-text-gray-900
):not(.sidebar *):not(#header *) {
    color: #000;
}

/*
 * Table cells: the app's own .table > tbody > tr > td grey also out-ranks a cell's
 * text-danger or text-success, so a loss showed grey. Black for plain cells, and
 * each status colour put back.
 */
html:not([data-perfex-theme="dark"]) .table > tbody > tr > td,
html:not([data-perfex-theme="dark"]) .table > tfoot > tr > td {
    color: #000;
}
html:not([data-perfex-theme="dark"]) .table > tbody > tr > td.text-success,
html:not([data-perfex-theme="dark"]) .table > tfoot > tr > td.text-success { color: rgb(22 163 74); }
html:not([data-perfex-theme="dark"]) .table > tbody > tr > td.text-danger,
html:not([data-perfex-theme="dark"]) .table > tfoot > tr > td.text-danger { color: rgb(239 68 68); }
html:not([data-perfex-theme="dark"]) .table > tbody > tr > td.text-warning,
html:not([data-perfex-theme="dark"]) .table > tfoot > tr > td.text-warning { color: rgb(202 138 4); }
html:not([data-perfex-theme="dark"]) .table > tbody > tr > td.text-info,
html:not([data-perfex-theme="dark"]) .table > tfoot > tr > td.text-info { color: rgb(2 132 199); }

/* Low priority on purpose (:where), so a form error can still turn its label red. */
html:not([data-perfex-theme="dark"]) :where(label, .control-label) {
    color: #000;
}

/* Still a shade lighter than typed text, so an empty box reads as empty. */
html:not([data-perfex-theme="dark"]) ::placeholder {
    color: #555;
    font-weight: 500;
}

/*
 * Payment status badges: solid colour, bold capitals, a size up - so whether an
 * invoice is paid is seen across the room, not read up close (client request,
 * 26 Oct 2026). The app's are pale tints in small type. Every invoice status comes
 * from format_invoice_status() with an invoice-status-<id> class; Credit is the
 * till's credit-sale label. Solid colours read in dark mode too, so no theme guard.
 */
.label.invoice-status-1,
.label.invoice-status-2,
.label.invoice-status-3,
.label.invoice-status-4,
.label.pos-credit-sale {
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.3rem 0.6rem;
    color: #fff;
    border: 0;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}
.label.invoice-status-1 { background-color: #dc2626; }                 /* Unpaid: red */
.label.invoice-status-2 { background-color: #16a34a; }                 /* Paid: green */
.label.invoice-status-3 { background-color: #facc15; color: #000; }    /* Partially paid: yellow */
.label.invoice-status-4 { background-color: #c026d3; }                 /* Overdue: magenta */
.label.pos-credit-sale  { background-color: #2563eb; }                 /* Credit: blue */
