/*
 * NidhiBook desktop density
 * --------------------------
 * Auto-tightens overall type size on laptops / low-resolution monitors.
 * Phones and small tablets (< 768px) are intentionally left alone —
 * those use nidhi-mobile.css.
 *
 * Uses root/body font-size only (NOT CSS zoom). Zoom breaks JS-positioned
 * overlays (Action menus via getBoundingClientRect, Select2 dropdowns).
 *
 * Load this AFTER nidhi-reports.css and layout chrome so rem scaling and
 * the scoped overrides below win for shared report/table UI.
 *
 * Shared report/sidebar tokens use rem calibrated to a 14px desktop root
 * (this file's baseline), so large screens keep prior sizes and low-res shrinks.
 */

@media (min-width: 768px) {
    html {
        font-size: 14px;
    }
    body {
        font-size: 1rem;
    }

    /* Tables follow root (was locked at 14px; now tracks density). */
    table,
    .table,
    .card-table,
    .report-table-card table {
        font-size: 1rem;
    }
}

/* ~15–16" laptops / 1440–1600-wide panels — slight tighten */
@media (min-width: 768px) and (max-width: 1600px) {
    html {
        font-size: 13.25px;
    }
}

@media (min-width: 768px) and (max-width: 1440px) {
    html {
        font-size: 12.75px;
    }
}

/* Common 1366×768 class machines */
@media (min-width: 768px) and (max-width: 1366px) {
    html {
        font-size: 12px;
    }

    /* Filter Select2 single-line (page inlines often lock px heights). */
    .select2-container .select2-selection--single {
        min-height: 1.875rem;
    }
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 1.75rem;
    }
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 1.75rem;
    }
}

/* Narrower desktop / older 1280 panels */
@media (min-width: 768px) and (max-width: 1280px) {
    html {
        font-size: 11.5px;
    }
}

@media (min-width: 768px) and (max-width: 1100px) {
    html {
        font-size: 11px;
    }
}

/* Short vertical space (720p / 768p height) even on wider monitors */
@media (min-width: 768px) and (max-height: 820px) {
    html {
        font-size: 12px;
    }

    .report-table-card .table th,
    .report-table-card .table td,
    .report-table-head th {
        padding-top: 0.286rem;
        padding-bottom: 0.286rem;
    }
}

@media (min-width: 768px) and (max-height: 720px) {
    html {
        font-size: 11.5px;
    }
}

/* Classic constrained laptop: both narrow and short */
@media (min-width: 768px) and (max-width: 1366px) and (max-height: 800px) {
    html {
        font-size: 11.5px;
    }
}

@media (min-width: 768px) and (max-width: 1280px) and (max-height: 720px) {
    html {
        font-size: 11px;
    }
}

/* Sales Details / list pages: beat leftover page-inline Select2 locks on low-res */
@media (min-width: 768px) and (max-width: 1366px) {
    .sales-list-page .sales-list-customer-filter .select2-container .select2-selection--single {
        min-height: 1.875rem !important;
    }
    .sales-list-page .sales-list-customer-filter .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 1.75rem !important;
    }
    .sales-list-page .sales-list-customer-filter .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 1.75rem !important;
    }
}
