/* =============================================
   Garment ERP — Horizontal Theme
   Primary: #FE9F43 | Dark: #092C4C | Font: Nunito
   ============================================= */

:root {
    --primary:      #FE9F43;
    --primary-dark: #e8882a;
    --nav-bg:       #092C4C;
    --nav-hover:    #0d3a63;
    --nav-text:     rgba(255,255,255,0.78);
    --nav-height:   62px;
    --body-bg:      #F7F7F7;
    --card-bg:      #ffffff;
    --border:       #E6EAED;
    --text-main:    #212B36;
    --text-muted:   #646B72;
    --radius:       8px;
    --shadow:       0 2px 12px rgba(0,0,0,0.07);
    --shadow-sm:    0 1px 6px rgba(0,0,0,0.05);
    --transition:   all 0.22s ease;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: var(--text-main);
    background: var(--body-bg);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: var(--nav-height);
}

h1,h2,h3,h4,h5,h6 { font-family: 'Nunito', sans-serif; font-weight: 700; color: var(--text-main); margin-bottom: 0; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
p:last-child { margin-bottom: 0; }
ul { list-style: none; padding: 0; margin: 0; }

/* =============================================
   TOP NAVBAR
   ============================================= */

.top-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    display: flex;
    align-items: center;
    z-index: 1050;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 0 8px 0 0;
}

/* Brand */
.navbar-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    height: 100%;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    transition: var(--transition);
}
.navbar-brand-link:hover { background: var(--nav-hover); color: #fff; }
.brand-icon {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: #fff; flex-shrink: 0;
}

/* Mobile hamburger */
.nav-toggler {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    color: #fff;
    font-size: 17px;
    padding: 5px 11px;
    margin-left: auto;
    margin-right: 10px;
    cursor: pointer;
}

/* Nav menu */
.nav-menu {
    display: flex;
    align-items: center;
    height: 100%;
    flex: 1;
    overflow: visible;
}

/* Single nav link (Dashboard) */
.nav-link-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 15px;
    height: var(--nav-height);
    color: var(--nav-text);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    border-top: 3px solid transparent;
    transition: var(--transition);
    text-decoration: none !important;
    line-height: 1;
    user-select: none;
}
.nav-link-item i { font-size: 13px; }
.nav-caret { font-size: 11px !important; margin-left: 2px; transition: transform 0.2s ease; }

.nav-link-item:hover,
.nav-link-item.nav-active {
    color: #fff !important;
    background: var(--nav-hover);
    border-bottom-color: var(--primary);
}

/* Dropdown wrapper — must have position:relative for Bootstrap dropdown */
.nav-dd-wrap {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Rotate caret when dropdown open */
.nav-dd-wrap .dropdown-menu.show ~ a .nav-caret,
.nav-dd-wrap.show .nav-caret { transform: rotate(180deg); }

/* ---- Dropdown Menu ---- */
.nav-dropdown {
    top: 100% !important;
    left: 0 !important;
    transform: none !important;
    margin-top: 0 !important;
    min-width: 215px;
    border: none !important;
    border-top: 3px solid var(--primary) !important;
    border-radius: 0 0 var(--radius) var(--radius) !important;
    box-shadow: 0 8px 28px rgba(0,0,0,0.13) !important;
    padding: 6px 0 !important;
}

.nav-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    transition: var(--transition);
}
.nav-dropdown .dropdown-item i { width: 16px; color: var(--text-muted); font-size: 13px; flex-shrink: 0; }

.nav-dropdown .dropdown-item:hover,
.nav-dropdown .dropdown-item:focus {
    background: #FFF5EC;
    color: var(--primary);
}
.nav-dropdown .dropdown-item:hover i,
.nav-dropdown .dropdown-item:focus i { color: var(--primary); }

.nav-dropdown .dropdown-item.dd-active {
    background: #FFF5EC;
    color: var(--primary);
    font-weight: 600;
}
.nav-dropdown .dropdown-item.dd-active i { color: var(--primary); }

.nav-dropdown .dropdown-divider { margin: 5px 14px; border-color: var(--border); }

.dd-section-label {
    display: block;
    padding: 4px 18px 2px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
}

/* ---- User area ---- */
.nav-user-area {
    position: relative;
    flex-shrink: 0;
    margin-left: 8px;
}

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px;
    border-radius: var(--radius);
    color: #fff !important;
    text-decoration: none !important;
    transition: var(--transition);
    cursor: pointer;
}
.nav-user-btn:hover,
.nav-user-btn.show { background: var(--nav-hover); }

.user-avatar {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: #fff; flex-shrink: 0;
}
.user-info { line-height: 1.25; }
.user-name { font-size: 13px; font-weight: 600; color: #fff; }
.user-role { font-size: 11px; color: var(--nav-text); }

/* =============================================
   PAGE WRAPPER
   ============================================= */

.page-wrapper { min-height: calc(100vh - var(--nav-height)); display: flex; flex-direction: column; }
.page-content { flex: 1; padding: 24px; }
.page-footer {
    padding: 10px 24px;
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    border-top: 0;
    background: linear-gradient(135deg, #4F0FB7 0%, #6610F2 45%, #2F6FFD 100%);
    text-align: center;
    letter-spacing: 0.3px;
    box-shadow: 0 -2px 8px rgba(76, 14, 178, 0.12);
}

.page-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

/* =============================================
   CARDS & TABLES
   ============================================= */

.card { border-radius: var(--radius); border: 1px solid var(--border); background: var(--card-bg); box-shadow: var(--shadow-sm); }
.card-header { border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0 !important; padding: 14px 18px; background: #fff; font-weight: 600; }
.card-body { padding: 18px; }
.card-footer { border-top: 1px solid var(--border); padding: 12px 18px; background: #fafafa; border-radius: 0 0 var(--radius) var(--radius); }

.table { font-size: 13.5px; }
.table th { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); background: #FAFBFC; }
.table td { vertical-align: middle; color: var(--text-main); }
.table-hover tbody tr:hover { background: #FFF9F3; }

/* =============================================
   FORMS
   ============================================= */

.form-control, .form-select {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 13.5px;
    padding: 8px 12px;
    color: var(--text-main);
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(254,159,67,0.15);
    outline: none;
}
.form-label { font-size: 13px; font-weight: 600; color: var(--text-main); margin-bottom: 5px; }
.input-group-text { border-radius: var(--radius) 0 0 var(--radius); border-color: var(--border); background: #F5F6F8; color: var(--text-muted); }

/* =============================================
   BUTTONS
   ============================================= */

.btn { border-radius: var(--radius); font-size: 13.5px; font-weight: 600; padding: 7px 16px; transition: var(--transition); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; box-shadow: 0 4px 12px rgba(254,159,67,0.35); }
.btn-outline-primary { border-color: var(--primary); color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-sm { padding: 4px 12px; font-size: 12.5px; }

/* =============================================
   BADGES & ALERTS
   ============================================= */

.badge { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 3px 8px; }
.alert { border-radius: var(--radius); border: none; font-size: 13.5px; }
.alert-success { background: #ECFDF5; color: #065F46; }
.alert-danger  { background: #FEF2F2; color: #991B1B; }
.alert-warning { background: #FFFBEB; color: #92400E; }
.alert-info    { background: #EFF6FF; color: #1E40AF; }

/* =============================================
   STAT CARDS
   ============================================= */

.stat-card {
    border-radius: var(--radius);
    padding: 20px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    border: none;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
}
.stat-card::after {
    content: '';
    position: absolute;
    right: -20px; top: -20px;
    width: 90px; height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.10);
}
.stat-icon, .stat-card-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    background: rgba(255,255,255,0.22);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-label, .stat-card-label { font-size: 11px; font-weight: 700; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value, .stat-card-value { font-size: 26px; font-weight: 700; line-height: 1.1; }

.stat-orange { background: linear-gradient(135deg, #FE9F43, #e8882a); }
.stat-blue   { background: linear-gradient(135deg, #155EEF, #0d47c7); }
.stat-green  { background: linear-gradient(135deg, #3EB780, #2a9065); }
.stat-purple { background: linear-gradient(135deg, #8B5CF6, #28c1d9); }

.stat-teal   { background: linear-gradient(135deg, #0EA5E9, #0284C7); }
.stat-red    { background: linear-gradient(135deg, #EF4444, #DC2626); }
.stat-yellow { background: linear-gradient(135deg, #FFCA18, #e6b200); color: #1a1a1a !important; }
.stat-yellow .stat-icon, .stat-yellow .stat-card-icon { background: rgba(0,0,0,0.12); color: #1a1a1a; }
.stat-yellow .stat-label, .stat-yellow .stat-card-label { opacity: 0.65; }

/* =============================================
   LOGIN PAGE
   ============================================= */

body.login-body { padding-top: 0; background: linear-gradient(135deg, #092C4C 0%, #1a4a7a 100%); }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
}

.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon {
    width: 62px; height: 62px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px; color: #fff; margin-bottom: 12px;
}
.login-logo h4 { font-size: 20px; color: #092C4C; font-weight: 700; }
.login-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */

@media (max-width: 991px) {
    body { padding-top: 56px; }

    .top-navbar { flex-wrap: wrap; height: auto; padding: 0; }

    .navbar-brand-link { height: 56px; flex: 1; }
    .nav-toggler { display: flex; align-items: center; }

    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        height: auto;
        background: var(--nav-bg);
        border-top: 1px solid rgba(255,255,255,0.08);
        padding: 6px 0 10px;
        overflow: visible;
    }
    .nav-menu.nav-open { display: flex; }

    .nav-link-item { height: auto; padding: 11px 18px; border-bottom: none; border-top: none; border-left: 3px solid transparent; width: 100%; }
    .nav-link-item.nav-active { border-left-color: var(--primary); border-bottom-color: transparent; }
    .nav-link-item:hover { border-left-color: var(--primary); border-bottom-color: transparent; }

    .nav-dd-wrap { height: auto; width: 100%; flex-direction: column; align-items: stretch; }

    .nav-dropdown {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        border-top: none !important;
        border-radius: 0 !important;
        background: rgba(0,0,0,0.2) !important;
        min-width: unset;
        width: 100%;
        padding: 2px 0 !important;
    }
    .nav-dropdown .dropdown-item { color: var(--nav-text); padding: 9px 18px 9px 42px; }
    .nav-dropdown .dropdown-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
    .nav-dropdown .dropdown-item.dd-active { background: rgba(255,255,255,0.07); color: var(--primary); }
    .nav-dropdown .dropdown-divider { border-color: rgba(255,255,255,0.1); margin: 4px 14px; }
    .dd-section-label { color: rgba(255,255,255,0.38); padding-left: 42px; }

    .nav-user-area { width: 100%; margin: 0; border-top: 1px solid rgba(255,255,255,0.08); }
    .nav-user-btn { padding: 12px 18px; border-radius: 0; }

    .nav-user-area .nav-dropdown {
        position: static !important;
        transform: none !important;
    }
    .user-info, .user-name, .user-role { display: block !important; }
}

/* =============================================
   UTILITIES
   ============================================= */

.text-primary { color: var(--primary) !important; }
.bg-primary   { background: var(--primary) !important; }
.fw-semibold  { font-weight: 600; }
.text-muted   { color: var(--text-muted) !important; }

/* =============================================
   PREADMIN-STYLE TWO-ROW HEADER  (new layout)
   ============================================= */

/* Reset legacy body offset (old .top-navbar was position:fixed and required padding-top) */
body { padding-top: 0 !important; }
.page-wrapper { min-height: calc(100vh - 104px); }

/* --- Row 1: Top bar (GRADIENT) --- */
.app-topbar {
    height: 56px;
    background: linear-gradient(135deg, #4F0FB7 0%, #6610F2 45%, #2F6FFD 100%);
    border-bottom: 0;
    box-shadow: 0 2px 8px rgba(76, 14, 178, 0.15);
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 14px;
    position: sticky; top: 0; z-index: 1030;
    color: #fff;
}
.app-topbar .brand-block {
    display: inline-flex; align-items: center; gap: 10px;
    text-decoration: none; color: #fff;
    font-weight: 700; font-size: 16px;
    padding-right: 18px; border-right: 1px solid rgba(255,255,255,0.2); height: 100%;
}
.app-topbar .brand-block:hover { color: #fff; opacity: 0.85; }
.app-topbar .brand-mark {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(255,255,255,0.18); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; overflow: hidden;
    backdrop-filter: blur(4px);
}
.app-topbar .brand-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.app-breadcrumb {
    display: inline-flex; align-items: center; gap: 6px;
    color: rgba(255,255,255,0.75); font-size: 13px; flex: 1;
}
.app-breadcrumb a { color: rgba(255,255,255,0.85); text-decoration: none; }
.app-breadcrumb a:hover { color: #fff; }
.app-breadcrumb .sep { font-size: 10px; color: rgba(255,255,255,0.5); }
.app-breadcrumb .current { color: #fff; font-weight: 600; }

/* Language switcher (on gradient) */
.lang-switch { display: inline-flex; background: rgba(255,255,255,0.15); border-radius: 20px; padding: 3px; }
.lang-switch button {
    background: transparent; border: 0; padding: 4px 12px; border-radius: 18px;
    font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.85); cursor: pointer; transition: .18s;
}
.lang-switch button:hover { color: #fff; }
.lang-switch button.active { background: #fff; color: var(--primary, #6610F2); box-shadow: 0 1px 3px rgba(0,0,0,.15); }

/* User pill (on gradient) */
.user-pill {
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 22px;
    transition: background .18s; text-decoration: none; color: #fff;
}
.user-pill:hover { background: rgba(255,255,255,0.12); }
.user-pill .ava {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(255,255,255,0.22);
    color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
    border: 1px solid rgba(255,255,255,0.3);
}
.user-pill .uname { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.1; }
.user-pill .urole { font-size: 11px; color: rgba(255,255,255,0.7); line-height: 1.1; }
.app-topbar .app-toggler { color: #fff; }
.app-topbar .app-toggler:hover { background: rgba(255,255,255,0.12); }
/* Caret icon next to user pill */
.user-pill ~ * .text-muted, .user-pill .text-muted { color: rgba(255,255,255,0.7) !important; }

/* --- Row 2: Main horizontal nav (GRADIENT, slightly lighter than top bar) --- */
.app-mainnav {
    height: 48px;
    background: linear-gradient(135deg, #5A14C9 0%, #7B27F5 45%, #4A85FF 100%);
    border-bottom: 0;
    box-shadow: 0 1px 6px rgba(76, 14, 178, 0.12);
    display: flex; align-items: center;
    padding: 0 14px; gap: 2px;
    position: sticky; top: 56px; z-index: 1029;
    /* IMPORTANT: must be visible so Bootstrap dropdowns can escape this container */
    overflow: visible;
}
.app-mainnav-item {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 0 14px; height: 100%;
    color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 500;
    text-decoration: none; cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: .18s; white-space: nowrap;
}
.app-mainnav-item:hover { color: #fff; background: rgba(255,255,255,0.08); }
.app-mainnav-item.active {
    color: #fff;
    background: rgba(255,255,255,0.12);
    border-bottom-color: #fff;
    font-weight: 600;
}
.app-mainnav-item i.fa { font-size: 12px; }
.app-mainnav-item .caret { font-size: 9px; opacity: .7; margin-left: 1px; }

/* Dropdown styling for new nav */
.app-mainnav .dropdown-menu {
    border: 1px solid #ECEEF1; border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    padding: 6px; min-width: 230px; margin-top: 0;
    z-index: 1040;  /* Above the sticky topbar (1030) and mainnav (1029) */
}
.app-topbar .dropdown-menu { z-index: 1040; }
.app-mainnav .dropdown-item {
    border-radius: 6px; padding: 8px 10px;
    font-size: 13px; display: flex; align-items: center; gap: 10px;
    color: #4b5563;
}
.app-mainnav .dropdown-item i.fa { width: 14px; text-align: center; color: #9ca3af; }
.app-mainnav .dropdown-item:hover,
.app-mainnav .dropdown-item.dd-active { background: #F4F0FF; color: var(--primary, #6610F2); }
.app-mainnav .dropdown-item:hover i.fa,
.app-mainnav .dropdown-item.dd-active i.fa { color: var(--primary, #6610F2); }
.app-mainnav .dropdown-divider { margin: 4px 0; }
.app-mainnav .dd-section-label {
    display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
    color: #9ca3af; padding: 6px 10px 2px; font-weight: 700;
}

/* Hamburger (mobile) */
.app-toggler {
    display: none; background: transparent; border: 0; color: #4b5563;
    width: 40px; height: 40px; border-radius: 8px; cursor: pointer;
}
.app-toggler:hover { background: #F4F6F8; }

@media (max-width: 991px) {
    .app-toggler { display: inline-flex; align-items: center; justify-content: center; }
    .app-breadcrumb { display: none; }
    .app-mainnav {
        position: fixed; top: 56px; left: 0; right: 0;
        flex-direction: column; align-items: stretch;
        height: auto; padding: 6px; max-height: 70vh; overflow-y: auto;
        transform: translateY(-200%); transition: transform .25s;
        box-shadow: 0 8px 24px rgba(76, 14, 178, .25);
    }
    .app-mainnav.open { transform: translateY(0); }
    .app-mainnav-item { height: 44px; border-bottom: 0; border-left: 3px solid transparent; }
    .app-mainnav-item.active { border-left-color: #fff; border-bottom-color: transparent; background: rgba(255,255,255,0.15); }
}

/* Print: hide both rows */
@media print {
    .app-topbar, .app-mainnav { display: none !important; }
}

/* =============================================
   GLOBAL LOADING OVERLAY
   ============================================= */
#globalLoader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
}
#globalLoader.show { display: flex; }
#globalLoader .spinner-ring {
    width: 56px;
    height: 56px;
    border: 5px solid rgba(13, 110, 253, 0.18);
    border-top-color: var(--primary, #0d6efd);
    border-radius: 50%;
    animation: gerp-spin 0.8s linear infinite;
}
#globalLoader .spinner-text {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.4px;
}
@keyframes gerp-spin { to { transform: rotate(360deg); } }

/* Inline button spinner (for individual button actions) */
.btn .btn-spinner {
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    vertical-align: -2px;
    animation: gerp-spin 0.7s linear infinite;
}

@media print { #globalLoader { display: none !important; } }

/* =============================================
   PRINT — clean, professional report output
   ============================================= */

/* Print-only / no-print helpers (apply on screen too) */
.print-only { display: none !important; }
.no-print   { /* visible on screen, hidden in print */ }

@media print {

    /* ---------- Page setup ---------- */
    @page { size: A4; margin: 14mm 12mm 16mm 12mm; }

    html, body {
        background: #fff !important;
        color: #000 !important;
        font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif !important;
        font-size: 10.5pt !important;
        line-height: 1.35 !important;
        margin: 0 !important;
        padding: 0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page-wrapper, .page-content, .px-3, .container, .container-fluid {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* ---------- Hide all interactive chrome ---------- */
    .top-navbar, .page-footer, .nav-toggler, .nav-user-area,
    .alert, .modal, .modal-backdrop, .dropdown-menu,
    .breadcrumb, .pagination,
    .no-print { display: none !important; }

    /* Hide every button & form input — filter controls and row actions */
    button, .btn, .btn-group,
    input, select, textarea,
    form, .input-group { display: none !important; }

    /* Hide dashboard / report summary stat-cards — data already in tables */
    .stat-card, .stat-card-icon, .stat-card-label, .stat-card-value,
    .stat-icon, .stat-label, .stat-value {
        display: none !important;
    }
    /* Also collapse the Bootstrap row that wraps stat-cards so it leaves no gap */
    .row:has(> .col > .stat-card),
    .row:has(> [class*="col-"] > .stat-card) { display: none !important; }

    /* If a parent <form> wraps the table itself (rare), keep its contents
       visible by neutralising rather than hiding it. */
    form.print-keep, form.print-keep * { display: revert !important; }

    /* ---------- Print-only header band ---------- */
    .print-only { display: block !important; }
    .print-header {
        text-align: center;
        border-bottom: 2px solid #000;
        padding: 0 0 6px 0;
        margin: 0 0 10px 0;
    }
    .print-header .brand     { font-size: 16pt; font-weight: 700; letter-spacing: .5px; }
    .print-header .doc-title { font-size: 12pt; font-weight: 600; margin-top: 2px; }
    .print-header .doc-meta  { font-size: 9pt;  color: #333; margin-top: 2px; }

    /* ---------- Strip card chrome ---------- */
    .card, .card-body, .card-header, .card-footer {
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 0 6pt 0 !important;
        border-radius: 0 !important;
    }
    /* Card headers usually duplicate the H5 above them — hide them */
    .card-header { display: none !important; }

    /* ---------- Headings & coloured text become black ---------- */
    h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
        margin: 0 0 4pt 0 !important;
        page-break-after: avoid;
    }
    .text-primary, .text-success, .text-danger,
    .text-warning, .text-info, .text-muted, .text-secondary,
    .text-white, .text-dark { color: #000 !important; }

    /* Hide the page H5 if a .print-header exists for this page */
    .print-header ~ * .page-screen-heading,
    .page-screen-heading.no-print { display: none !important; }

    /* ---------- Tables: clean black borders, light grey thead ---------- */
    .table {
        width: 100% !important;
        border-collapse: collapse !important;
        color: #000 !important;
        margin: 0 !important;
        font-size: 10pt !important;
    }
    .table th, .table td {
        border: 1px solid #000 !important;
        padding: 4px 6px !important;
        vertical-align: top !important;
        background: #fff !important;
    }
    .table thead th,
    .table-light, .table-primary, .table-success,
    .table-warning, .table-danger, .table-info, .table-secondary {
        background: #f0f0f0 !important;
        color: #000 !important;
        font-weight: 600 !important;
    }
    tr, td, th, tfoot { page-break-inside: avoid !important; }
    thead { display: table-header-group; }   /* repeat header on each page */
    tfoot { display: table-row-group; }

    /* Badges — flatten to plain text in brackets-style */
    .badge {
        background: transparent !important;
        color: #000 !important;
        border: 1px solid #555 !important;
        padding: 1px 4px !important;
        font-weight: 500 !important;
    }

    /* Hide all FontAwesome glyphs — they don't render well on paper */
    .fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands { display: none !important; }

    /* Bootstrap utility colours that paint cells / rows */
    .bg-primary, .bg-success, .bg-danger, .bg-warning,
    .bg-info, .bg-secondary, .bg-light, .bg-white {
        background: #fff !important;
        color: #000 !important;
    }

    /* Avoid orphan/last-line breaks in important blocks */
    .receipt-paper, .invoice, .summary-block { page-break-inside: avoid; }

    /* Remove default link decoration (prints look cleaner) */
    a, a:link, a:visited { color: #000 !important; text-decoration: none !important; }
}

/* ===== Easy forms: required marks + big Save button (Scripts/easy-forms.js) ===== */
.req-star { color: #dc3545; font-weight: 700; }
.form-control.req-field.req-empty, .form-select.req-field.req-empty, select.req-field.req-empty {
    border-left: 4px solid #dc3545 !important;
}
.btn-save-big {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    padding: .6rem 1.8rem !important;
    min-width: 170px;
}
@media (max-width: 576px) { .btn-save-big { width: 100%; } }
