/* ==========================================================================
   MANDISCOPE ERP - LIGHTER THEME DESIGN SYSTEM
   Baseline: Bootstrap 5.2.3 | White-grey surfaces | Rectangular controls
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   PRESERVED FOR RECOVERY: ORIGINAL ROOT VARIABLES (BLUE THEME)
   To restore original colors, uncomment this block and remove the 3-color block below.
   ==========================================================================
:root {
    --theme-primary: #0d6efd;
    --theme-primary-rgb: 13, 110, 253;
    --theme-primary-dark: #0b5ed7;
    --theme-primary-darker: #0a58ca;
    --theme-primary-light: rgba(13, 110, 253, 0.10);
    --theme-primary-light-03: rgba(13, 110, 253, 0.03);
    --theme-primary-light-15: rgba(13, 110, 253, 0.15);
    --theme-primary-light-20: rgba(13, 110, 253, 0.20);
    --theme-primary-light-30: rgba(13, 110, 253, 0.30);
    --theme-primary-lighter: #f0f4f8;
    --theme-primary-subtle: #e7f1ff;
    --theme-teal: #0d6efd;
    --theme-teal-hover: #0b5ed7;
    --theme-emerald: #198754;
    --theme-emerald-hover: #157347;
    --theme-amber: #d97706;
    --theme-amber-hover: #b45309;
    --theme-rose: #dc3545;
    --theme-rose-hover: #bb2d3b;
    --theme-indigo: #6610f2;
    --theme-indigo-hover: #520dc2;
    --theme-blue: #0d6efd;
    --theme-blue-hover: #0b5ed7;
    --theme-slate: #6c757d;
    --theme-slate-hover: #5c636a;
    --theme-cool-gray: #6c757d;
    --theme-cool-gray-hover: #5c636a;
    --theme-bg-body: #f4f6f8;
    --theme-bg-surface: #ffffff;
    --theme-text-dark: #212529;
    --theme-text-muted: #6c757d;
    --theme-text-light: #ffffff;
    --theme-border: #e9ecef;
    --theme-border-strong: #ced4da;
    --theme-border-focus: #86b7fe;
    --theme-shadow: rgba(13, 110, 253, 0.12);
}
   ========================================================================== */

/* ===================== ROOT THEME VARIABLES (3-COLOR PALETTE) =====================
   Color 1: Theme Primary Accent (Teal #168e89 - matching reference image)
   Color 2: Dark Neutral (Charcoal #212529 / Slate #64748b)
   Color 3: Light Neutral (White #ffffff / Soft background #f4f6f8)
   ================================================================================= */
:root {
    /* COLOR 1: PRIMARY TEAL ACCENT (Matching reference image) */
    --theme-primary: #168e89;
    --theme-primary-rgb: 22, 142, 137;
    --theme-primary-dark: #127571;
    --theme-primary-darker: #0d5a57;
    --theme-primary-light: rgba(22, 142, 137, 0.10);
    --theme-primary-light-03: rgba(22, 142, 137, 0.03);
    --theme-primary-light-15: rgba(22, 142, 137, 0.15);
    --theme-primary-light-20: rgba(22, 142, 137, 0.20);
    --theme-primary-light-30: rgba(22, 142, 137, 0.30);
    --theme-primary-lighter: #eef7f6;
    --theme-primary-subtle: #e8f5f4;

    /* Semantic action colors mapped strictly into unified Teal palette */
    --theme-teal: #168e89;
    --theme-teal-hover: #127571;

    --theme-emerald: #168e89;
    --theme-emerald-hover: #127571;

    --theme-blue: #168e89;
    --theme-blue-hover: #127571;

    --theme-indigo: #168e89;
    --theme-indigo-hover: #127571;

    /* Functional alerts (kept visible while visually restrained) */
    --theme-amber: #b45309;
    --theme-amber-hover: #92400e;

    --theme-rose: #dc2626;
    --theme-rose-hover: #b91c1c;

    /* COLOR 2: DARK NEUTRALS */
    --theme-slate: #64748b;
    --theme-slate-hover: #475569;
    --theme-cool-gray: #64748b;
    --theme-cool-gray-hover: #475569;
    --theme-text-dark: #212529;
    --theme-text-muted: #64748b;

    /* COLOR 3: LIGHT / WHITE NEUTRAL SURFACES */
    --theme-bg-body: #f4f6f8;
    --theme-bg-surface: #ffffff;
    --theme-text-light: #ffffff;
    --theme-border: #e2e8f0;
    --theme-border-strong: #cbd5e1;
    --theme-border-focus: #168e89;

    --theme-shadow-xs: 0 1px 2px 0 rgba(33, 37, 41, 0.04);
    --theme-shadow-sm: 0 1px 3px 0 rgba(33, 37, 41, 0.06);
    --theme-shadow-md: 0 4px 8px rgba(33, 37, 41, 0.06);
    --theme-shadow-lg: 0 10px 18px rgba(33, 37, 41, 0.08);
    --theme-shadow: rgba(22, 142, 137, 0.16);

    /* Form Controls — rectangular, not round (merged in tables / input-groups) */
    --theme-control-height: 36px;
    --theme-control-line-height: 1.5;
    --theme-control-padding-y: 0.375rem;
    --theme-control-padding-x: 0.75rem;
    --theme-control-padding-right-select: 2.25rem;
    --theme-control-radius: 2px;

    /* Universal themed table headers & cells */
    --table-header-bg: #eef7f6;
    --table-header-color: #127571;
    --table-header-border: #d1e7e5;
    --table-header-border-bottom: #b2dfdb;
    --table-cell-border: #e9ecef;
    --table-border: #dee2e6;
    --table-body-bg: #ffffff;
    --table-body-alt-bg: #f8fafc;
    --table-footer-bg: #f8fafc;
    --table-row-hover-bg: #f0f8f7;
    --table-quick-entry-bg: #eef7f6;
    --table-hover-bg: #f0f8f7;
    --table-hover-color: #212529;
    --table-cell-padding: 7px 10px;
    --table-control-text-align: center;
    --table-control-padding: 0px;
}

/* ===================== GLOBAL BASE STYLES ===================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 14px !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 14px;
    font-weight: 400;
    color: var(--theme-text-dark);
    background-color: var(--theme-bg-body);
    line-height: 1.5;
    overflow-x: hidden;
}

body.select2-open {
    overflow-x: hidden;
}

input {
    autocomplete: off;
}

/* ===================== THEME UTILITIES & MULTI-COLOR TOKENS ===================== */
.theme-bg-primary {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-light) !important;
}

.theme-border {
    border-color: var(--theme-border-focus) !important;
}

.theme-text {
    color: var(--theme-primary) !important;
}

.theme-bg-soft {
    background-color: var(--theme-primary-light) !important;
}

.theme-bg-lightest {
    background-color: var(--theme-primary-lighter) !important;
}

.theme-bg {
    background-color: var(--theme-primary) !important;
    color: var(--theme-text-light) !important;
    border-color: var(--theme-border-focus);
}

.theme-bg td {
    color: var(--theme-text-light) !important;
}

.theme-bg-lighter {
    background-color: #F8FAFC !important;
    color: var(--theme-text-dark) !important;
    border-color: var(--theme-border) !important;
}

.theme-navbar {
    background-color: var(--theme-primary-dark) !important;
    color: var(--theme-text-light) !important;
    border-color: var(--theme-primary-darker);
}

.theme-card {
    background-color: #FFFFFF !important;
    border: 1px solid var(--theme-border) !important;
}

.theme-text-color,
a {
    color: var(--theme-primary-dark);
    text-decoration: none;
}

a:hover {
    color: var(--theme-primary);
}

/* ==========================================================================
   PRESERVED FOR RECOVERY: ORIGINAL MULTI-COLOR BADGES
   ==========================================================================
.badge-emerald { background-color: #ECFDF5 !important; color: #065F46 !important; border: 1px solid #A7F3D0 !important; font-weight: 600; }
.badge-indigo { background-color: #EEF2FF !important; color: #3730A3 !important; border: 1px solid #C7D2FE !important; font-weight: 600; }
.badge-sky { background-color: #F0F9FF !important; color: #075985 !important; border: 1px solid #BAE6FD !important; font-weight: 600; }
.badge-rose { background-color: #FFF1F2 !important; color: #9F1239 !important; border: 1px solid #FECDD3 !important; font-weight: 600; }
.badge-amber { background-color: #FFFBEB !important; color: #92400E !important; border: 1px solid #FDE68A !important; font-weight: 600; }
.badge-purple { background-color: #FAF5FF !important; color: #6B21A8 !important; border: 1px solid #E9D5FF !important; font-weight: 600; }
.badge-orange { background-color: #FFF7ED !important; color: #9A3412 !important; border: 1px solid #FED7AA !important; font-weight: 600; }
.badge-teal { background-color: #F0FDFA !important; color: #115E59 !important; border: 1px solid #99F6E4 !important; font-weight: 600; }
.badge-slate { background-color: #F1F5F9 !important; color: #334155 !important; border: 1px solid #CBD5E1 !important; font-weight: 600; }
.badge-dr { background-color: #FFF1F2 !important; color: #BE123C !important; border: 1px solid #FDA4AF !important; font-weight: 700; }
.badge-cr { background-color: #ECFDF5 !important; color: #047857 !important; border: 1px solid #6EE7B7 !important; font-weight: 700; }
   ========================================================================== */

/* ===================== THEME BADGES (3-COLOR SYSTEM) ===================== */
.badge-emerald,
.badge-teal,
.badge-sky,
.badge-indigo,
.badge-purple,
.badge-cr {
    background-color: #e8f5f4 !important;
    color: #127571 !important;
    border: 1px solid #b2dfdb !important;
    font-weight: 600;
}

.badge-slate {
    background-color: #F1F5F9 !important;
    color: #334155 !important;
    border: 1px solid #CBD5E1 !important;
    font-weight: 600;
}

.badge-amber,
.badge-orange {
    background-color: #FFFBEB !important;
    color: #92400E !important;
    border: 1px solid #FDE68A !important;
    font-weight: 600;
}

.badge-rose,
.badge-dr {
    background-color: #FFF1F2 !important;
    color: #9F1239 !important;
    border: 1px solid #FECDD3 !important;
    font-weight: 600;
}

/* Multi-Color Module Tags */
.tag-farmer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.tag-buyer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #F0F9FF;
    color: #075985;
    border: 1px solid #BAE6FD;
}

.tag-transport {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.ledger-summary-scroll {
    max-height: 320px;
    overflow-y: auto;
}

/* ===================== ADMIN TOP CHROME & MODERN TOP NAVBAR ===================== */
.admin-top-chrome {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.02);
}

/* Header Bar / Brand Chrome */
.admin-header-bar {
    background-color: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
    padding: 0.75rem 1.5rem;
    min-height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.admin-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

.admin-brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background-color: var(--theme-primary);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}

.admin-brand-text {
    font-size: 1.22rem;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.02em;
}

.admin-brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background-color: var(--theme-primary-lighter);
    color: var(--theme-primary-dark);
    border: 1px solid rgba(22, 142, 137, 0.25);
    padding: 2px 7px;
    border-radius: 2px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-brand-divider {
    width: 1px;
    height: 22px;
    background-color: #CBD5E1;
    margin: 0 6px;
}

.admin-header-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #334155;
    margin: 0;
    display: inline-flex;
    align-items: center;
    letter-spacing: -0.01em;
}

.quick-nav-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #fff;
    border: 1px solid var(--theme-border-strong);
    color: #343a40 !important;
    font-size: 0.825rem;
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    height: 34px;
    border-radius: 2px;
    text-decoration: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.quick-nav-action-btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #212529 !important;
}

.user-profile-btn {
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    color: #1E293B;
    font-weight: 600;
    font-size: 0.835rem;
    padding: 0.3rem 0.75rem 0.3rem 0.4rem;
    height: 36px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.user-profile-btn:hover,
.user-profile-btn:focus,
.user-profile-btn.show {
    background-color: #F8FAFC;
    border-color: #CBD5E1;
    color: #0F172A;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.user-avatar-chip {
    width: 28px;
    height: 28px;
    border-radius: 2px;
    background-color: var(--theme-primary);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
}

.user-name-text {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-role-badge {
    font-size: 0.68rem;
    font-weight: 600;
    background-color: #F1F5F9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   PRESERVED FOR RECOVERY: ORIGINAL ADMIN NAVBAR & SOFT COLOR TOKENS
   To restore original navbar and tokens, uncomment this block and remove the block below.
   ==========================================================================
.admin-navbar { background-color: #FFFFFF !important; border-bottom: 1px solid #E2E8F0; padding: 0.4rem 1.25rem !important; min-height: 48px; margin: 0; }
.admin-navbar .navbar-toggler { border: 1px solid var(--theme-border-strong); border-radius: 2px; padding: 0.3rem 0.5rem; }
.admin-navbar .navbar-nav { margin-bottom: 0 !important; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.admin-navbar .nav-link { color: #343a40 !important; font-weight: 600; font-size: 0.875rem !important; line-height: 1.35; padding: 0.45rem 0.75rem !important; height: 36px; border-radius: 2px; display: inline-flex; align-items: center; gap: 6px; transition: background-color 0.12s ease, color 0.12s ease; border: 1px solid transparent; position: relative; white-space: nowrap; }
.admin-navbar .nav-link:hover, .admin-navbar .nav-link.show { background-color: #f1f3f5 !important; color: #212529 !important; }
.admin-navbar .nav-link.active { background-color: #e7f1ff !important; color: #0b5ed7 !important; font-weight: 600; border-color: #b6d4fe; }
.admin-navbar .dropdown-menu { border: 1px solid #E2E8F0; border-radius: 2px; margin-top: 4px; box-shadow: var(--theme-shadow-md); padding: 0.35rem; min-width: 240px; background-color: #FFFFFF; }
.admin-navbar .dropdown-item { color: #343a40 !important; font-weight: 500; font-size: 0.875rem !important; padding: 0.45rem 0.75rem; border-radius: 2px; transition: background-color 0.12s ease; display: flex; align-items: center; gap: 8px; }
.admin-navbar .dropdown-item:hover { background-color: #f4f6f8 !important; color: #212529 !important; }
.bg-teal-soft { background-color: #ECFDF5 !important; }
.text-teal { color: #0d6efd !important; }
.bg-emerald-soft { background-color: #ECFDF5 !important; }
.text-emerald { color: #059669 !important; }
.bg-sky-soft { background-color: #F0F9FF !important; }
.text-sky { color: #0284C7 !important; }
.bg-indigo-soft { background-color: #EEF2FF !important; }
.text-indigo { color: #4F46E5 !important; }
.bg-amber-soft { background-color: #FFFBEB !important; }
.text-amber { color: #D97706 !important; }
.bg-orange-soft { background-color: #FFF7ED !important; }
.text-orange { color: #EA580C !important; }
.bg-rose-soft { background-color: #FFF1F2 !important; }
.text-rose { color: #E11D48 !important; }
.bg-purple-soft { background-color: #FAF5FF !important; }
.text-purple { color: #7C3AED !important; }
.bg-slate-soft { background-color: #F1F5F9 !important; }
.text-slate { color: #475569 !important; }
   ========================================================================== */

/* ===================== NEW NAVBAR PATTERN (MATCHING REFERENCE THEME) ===================== */
.admin-navbar {
    background-color: var(--theme-primary) !important;
    border-bottom: 1px solid var(--theme-primary-dark);
    padding: 0 1.25rem !important;
    min-height: 42px;
    margin: 0;
}

.admin-navbar .navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 2px;
    padding: 0.3rem 0.5rem;
}

.admin-navbar .navbar-toggler-icon {
    filter: invert(1) brightness(200%);
}

.admin-navbar .navbar-nav {
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}

.admin-navbar .nav-link {
    color: #ffffff !important;
    font-weight: 500;
    font-size: 0.875rem !important;
    line-height: 1.35;
    padding: 0.5rem 0.85rem !important;
    height: 42px;
    border-radius: 0px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.12s ease, color 0.12s ease;
    border: none;
    border-bottom: 3px solid transparent;
    position: relative;
    white-space: nowrap;
}

.admin-navbar .nav-link .nav-item-icon,
.admin-navbar .nav-link .nav-item-icon i,
.admin-navbar .nav-link .fa,
.admin-navbar .nav-link span {
    color: #ffffff !important;
}

.admin-navbar .nav-link:hover,
.admin-navbar .nav-link.show {
    background-color: rgba(0, 0, 0, 0.12) !important;
    color: #ffffff !important;
}

.admin-navbar .nav-link.active {
    background-color: rgba(0, 0, 0, 0.20) !important;
    color: #ffffff !important;
    font-weight: 600;
    border-bottom: 3px solid rgba(255, 255, 255, 0.90);
}

.nav-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Dropdown Menus */
.admin-navbar .dropdown-menu {
    border: 1px solid #d1d5db;
    border-radius: 2px;
    margin-top: 0px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 0.35rem 0;
    min-width: 240px;
    max-height: calc(100vh - 65px);
    overflow-y: auto;
    background-color: #ffffff;
}

.admin-navbar .dropdown-header {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--theme-primary) !important;
    padding: 0.45rem 1rem 0.2rem;
    margin: 0.15rem 0 0.05rem 0;
}

@keyframes dropdownPop {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-navbar .dropdown-item {
    color: #212529 !important;
    font-weight: 500;
    font-size: 0.875rem !important;
    padding: 0.45rem 1rem;
    border-radius: 0px;
    transition: background-color 0.10s ease, color 0.10s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Reference Image Pattern: Hovered item gets solid Teal background + Pure White text */
.admin-navbar .dropdown-item:hover,
.admin-navbar .dropdown-item:focus,
.admin-navbar .dropdown-item.active {
    background-color: var(--theme-primary) !important;
    color: #ffffff !important;
}

.admin-navbar .dropdown-item:hover *,
.admin-navbar .dropdown-item:focus *,
.admin-navbar .dropdown-item.active * {
    color: #ffffff !important;
}

.admin-navbar .dropdown-item:hover .nav-dd-icon,
.admin-navbar .dropdown-item:focus .nav-dd-icon,
.admin-navbar .dropdown-item.active .nav-dd-icon {
    background-color: transparent !important;
    color: #ffffff !important;
}

.admin-navbar .dropdown-divider {
    border-top: 1px solid #e5e7eb;
    margin: 0.35rem 0;
}

.admin-navbar .dropdown-menu.nav-mega {
    padding: 0.75rem 0.9rem;
    min-width: 0;
}

.nav-mega-grid {
    display: grid;
    gap: 0.55rem 1.5rem;
}

.nav-mega-2 {
    grid-template-columns: repeat(2, minmax(168px, 1fr));
}

.nav-mega-3 {
    grid-template-columns: repeat(3, minmax(200px, 1fr));
}

.nav-mega-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-mega-title {
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--theme-primary) !important;
    padding: 0.1rem 0.65rem 0.35rem;
    margin-bottom: 0.2rem;
    border-bottom: 1px solid #e5e7eb;
}

.admin-navbar .nav-mega .dropdown-item {
    padding: 0.42rem 0.75rem;
    white-space: normal;
    line-height: 1.3;
}

/* Dropdown Soft Icon Boxes */
.nav-dd-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: 0.82rem;
    flex-shrink: 0;
    background-color: var(--theme-primary-light);
    color: var(--theme-primary);
    transition: background-color 0.10s ease, color 0.10s ease;
}

/* Soft Color Tokens for Icons & Pills (Unified into 3-Color Palette) */
.bg-teal-soft,
.bg-emerald-soft,
.bg-sky-soft,
.bg-indigo-soft,
.bg-purple-soft {
    background-color: #e8f5f4 !important;
}

.text-teal,
.text-emerald,
.text-sky,
.text-indigo,
.text-purple,
.text-primary {
    color: #168e89 !important;
}

.bg-amber-soft,
.bg-orange-soft {
    background-color: #FFFBEB !important;
}

.text-amber,
.text-orange {
    color: #D97706 !important;
}

.bg-rose-soft {
    background-color: #FFF1F2 !important;
}

.text-rose {
    color: #E11D48 !important;
}

.bg-slate-soft {
    background-color: #F1F5F9 !important;
}

.text-slate {
    color: #475569 !important;
}

/* Reports Directory Page Utilities (3-Color System) */
.btn-category-filter {
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    color: #475569;
    font-weight: 500;
    font-size: 0.815rem;
    padding: 0.28rem 0.75rem;
    border-radius: 2px;
    transition: all 0.15s ease;
}

.btn-category-filter:hover {
    background-color: var(--theme-primary-lighter);
    border-color: var(--theme-primary);
    color: var(--theme-primary-dark);
}

.btn-category-filter.active {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: #ffffff !important;
}

.btn-category-filter.active .badge {
    background-color: #ffffff !important;
    color: var(--theme-primary-dark) !important;
}

.report-link {
    color: #212529 !important;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.6;
    transition: color 0.12s ease;
}

.report-link:hover {
    color: var(--theme-primary) !important;
    text-decoration: underline !important;
}

.report-link .fa-arrow-right {
    font-size: 0.8rem;
    color: var(--theme-primary) !important;
    transition: transform 0.12s ease;
}

.report-link:hover .fa-arrow-right {
    transform: translateX(3px);
}

/* ==========================================================================
   REPORTS DIRECTORY — MINIMALIST 4-COLUMN ERP PATTERN (SCOPED TO .reports-page)
   ========================================================================== */
.reports-page {
    background-color: #ffffff;
    min-height: calc(100vh - 120px);
    padding: 1.5rem 2rem;
    font-family: inherit;
}

/* Page Header & Search */
.reports-page .reports-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eef2f6;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.reports-page .reports-page-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
}

.reports-page .reports-page-title i {
    color: #0d9488;
    font-size: 1.05rem;
}

.reports-page .reports-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reports-page .reports-search-control {
    width: 280px;
    max-width: 100%;
    font-size: 0.84rem;
    padding: 0.38rem 0.75rem 0.38rem 2.1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    transition: all 0.15s ease-in-out;
    background-color: #ffffff;
}

.reports-page .reports-search-control:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}

.reports-page .search-input-box {
    position: relative;
    display: inline-block;
}

.reports-page .search-input-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.8rem;
    pointer-events: none;
}

.reports-page .search-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}

.reports-page .search-clear-btn:hover {
    color: #334155;
}

.reports-page .reports-count-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    background-color: #f1f5f9;
    padding: 0.25rem 0.55rem;
    border-radius: 12px;
}

/* Left Category Navigation Panel (Matching Reference) */
.reports-page .reports-cat-sidebar {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 8px;
    padding: 0.75rem 0.65rem;
    position: sticky;
    top: 1rem;
    z-index: 10;
}

.reports-page .cat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: #64748b;
    padding: 0.25rem 0.5rem 0.6rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.5rem;
}

.reports-page .cat-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.reports-page .cat-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.45rem 0.65rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 20px;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.14s ease-in-out;
}

.reports-page .cat-nav-link:hover {
    background-color: #f0fdfa;
    color: #0d9488;
}

.reports-page .cat-nav-link.active {
    background-color: #0d9488 !important;
    border-color: #0d9488 !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
}

.reports-page .cat-nav-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reports-page .cat-nav-icon {
    width: 16px;
    font-size: 0.82rem;
    text-align: center;
    color: #64748b;
    transition: color 0.12s ease;
}

.reports-page .cat-nav-link:hover .cat-nav-icon {
    color: #0d9488;
}

.reports-page .cat-nav-link.active .cat-nav-icon {
    color: #ffffff !important;
}

.reports-page .cat-nav-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    transition: all 0.12s ease;
}

.reports-page .cat-nav-link:hover .cat-nav-badge {
    background: #ffffff;
    color: #0d9488;
}

.reports-page .cat-nav-link.active .cat-nav-badge {
    background: #ffffff !important;
    color: #0d9488 !important;
}

/* Category Sections */
.reports-page .report-category-section {
    padding: 0.85rem 0 0.5rem 0;
}


.reports-page .report-category-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 0.85rem;
    letter-spacing: -0.15px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reports-page .report-category-title .cat-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
}

/* 4-Column Report Items Grid */
.reports-page .report-grid {
    margin-bottom: 0.5rem;
}

.reports-page .report-item-col {
    padding: 0.25rem 0.5rem;
}

.reports-page .report-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none !important;
    color: #334155;
    font-size: 0.86rem;
    font-weight: 500;
    padding: 0.35rem 0.35rem;
    border-radius: 4px;
    transition: all 0.12s ease-in-out;
    width: 100%;
}

.reports-page .report-link:hover {
    color: #0d9488;
    background-color: #f0fdfa;
    transform: translateX(2px);
}

.reports-page .report-chevron {
    color: #94a3b8;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    transition: color 0.12s ease, transform 0.12s ease;
    flex-shrink: 0;
}

.reports-page .report-link:hover .report-chevron {
    color: #0d9488;
}

.reports-page .report-name {
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

/* Divider between categories */
.reports-page .report-divider {
    border: none;
    border-top: 1px solid #eef2f6;
    margin: 1.15rem 0 0.5rem 0;
}

/* Empty Search Feedback */
.reports-page #noReportsFound {
    padding: 2.5rem 1rem;
    text-align: center;
    background-color: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    margin: 1.5rem 0;
}



.admin-main-container {
    min-height: calc(100vh - 140px);
    background-color: var(--theme-bg-body);
}

.admin-footer {
    background-color: #FFFFFF;
    border-top: 1px solid var(--theme-border);
    padding: 1rem 0;
    color: var(--theme-text-muted);
    font-size: 0.875rem;
}

/* ==========================================================================
   BUTTON SYSTEM — Bootstrap secondary + white text, even grouped sizes
   ========================================================================== */
body {
    --mod-accent: var(--bs-secondary);
    --mod-accent-hover: #5c636a;
    --mod-accent-fg: #ffffff;
    --mod-divider: rgba(255, 255, 255, 0.28);
}

.theme-btn,
.theme-btn-cart {
    padding: 5px 25px !important;
    min-height: 0;
    height: auto;
    min-width: 0;
    background-color: var(--mod-accent) !important;
    border: 1px solid var(--mod-accent) !important;
    color: var(--mod-accent-fg) !important;
    line-height: 1.5;
    font-weight: 600;
    font-size: 13px !important;
    border-radius: 2px;
    box-shadow: none !important;
    text-shadow: none !important;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    text-decoration: none !important;
    cursor: pointer;
    white-space: nowrap;
}

.theme-btn .fa,
.theme-btn-cart .fa {
    padding: 0.25rem;
    color: var(--bs-warning) !important;
}

/* WebForms: icon only below md; label from md up */
@media (max-width: 767.98px) {

    .theme-btn,
    .theme-btn-cart,
    .btn-group>.theme-btn,
    .btn-group>.theme-btn-cart,
    .btn-group>.btn-group>.theme-btn,
    .btn-group-sm>.theme-btn,
    .btn-group-sm>.theme-btn-cart {
        font-size: 0 !important;
        padding: 5px 10px !important;
        gap: 0;
        min-width: 0;
        width: auto;
    }

    .btn-group-sm>.theme-btn,
    .btn-group-sm>.theme-btn-cart {
        padding: 4px 8px !important;
    }

    .theme-btn .fa,
    .theme-btn-cart .fa {
        font-size: 14px !important;
        margin: 0 !important;
        line-height: 1;
    }

    .theme-btn.dropdown-toggle::after {
        margin-left: 0.25rem;
        vertical-align: middle;
    }
}

.theme-btn:hover:not(:disabled),
.theme-btn:focus:not(:disabled),
.theme-btn-cart:hover:not(:disabled),
.theme-btn-cart:focus:not(:disabled) {
    background-color: #e9ecef !important;
    border-color: #e9ecef !important;
    color: var(--mod-accent) !important;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.25) !important;
    transform: none;
}

.theme-btn:active:not(:disabled),
.theme-btn-cart:active:not(:disabled) {
    background-color: var(--mod-accent-hover) !important;
    transform: none;
    box-shadow: none !important;
}

.theme-btn:disabled,
.theme-btn.disabled,
.theme-btn-cart:disabled,
.theme-btn-cart.disabled {
    opacity: 0.45 !important;
    transform: none !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.btn {
    font-weight: 600;
    border-radius: 2px;
}

.btn-sm {
    padding: 0.2rem 0.55rem;
    min-height: 28px;
    height: 28px;
    min-width: 0;
    font-size: 12px !important;
    line-height: 1;
    border-radius: 2px;
}

.btn-lg {
    padding: 0.4rem 1.1rem;
    min-height: 36px;
    height: auto;
    font-size: 14px !important;
}

/* Joined Index bars — equal height and equal share of width */
.btn-group {
    display: inline-flex;
    flex-wrap: nowrap;
    vertical-align: middle;
    align-items: stretch;
}

.btn-group>.theme-btn,
.btn-group>.theme-btn-cart,
.btn-group>.btn-group>.theme-btn,
.btn-group>.btn-group>.theme-btn-cart {
    margin: 0;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    min-height: 0;
    min-width: 0;
    padding: 5px 25px !important;
    line-height: 1.5;
    border-radius: 0 !important;
    background-color: var(--mod-accent) !important;
    border: 1px solid var(--mod-accent) !important;
    color: var(--mod-accent-fg) !important;
}

.btn-group>.btn-group {
    flex: 0 0 auto;
    width: auto;
}

.btn-group>.theme-btn:hover:not(:disabled),
.btn-group>.theme-btn-cart:hover:not(:disabled),
.btn-group>.btn-group>.theme-btn:hover:not(:disabled) {
    background-color: #e9ecef !important;
    border-color: #e9ecef !important;
    color: var(--mod-accent) !important;
}

.btn-group>.theme-btn:not(:first-child),
.btn-group>.theme-btn-cart:not(:first-child),
.btn-group>.btn-group:not(:first-child)>.theme-btn {
    margin-left: 0;
    border-left: 1px solid var(--mod-divider) !important;
}

.btn-group>.theme-btn:first-child,
.btn-group>.theme-btn-cart:first-child {
    border-top-left-radius: 2px !important;
    border-bottom-left-radius: 2px !important;
}

.btn-group>.theme-btn:last-child,
.btn-group>.theme-btn-cart:last-child,
.btn-group>.btn-group:last-child>.theme-btn {
    border-top-right-radius: 2px !important;
    border-bottom-right-radius: 2px !important;
}

.btn-group-sm>.theme-btn,
.btn-group-sm>.theme-btn-cart,
.btn-group-sm>.btn-group>.theme-btn {
    padding: 4px 12px !important;
    font-size: 12px !important;
    min-width: 0;
    flex: 0 0 auto;
    height: auto;
}

/* Icon Buttons (Clean Flat Compact) */
.theme-btn-icon:not(.d-none) {
    padding: 0.2rem 0.5rem !important;
    min-width: 28px !important;
    min-height: 28px !important;
    height: 28px;
    font-size: 12px;
    line-height: 1;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 2px;
    box-shadow: none !important;
}

.btn-detail-chip {
    width: 26px;
    height: 26px;
    min-width: 26px !important;
    min-height: 26px !important;
    padding: 0 !important;
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
    border-radius: 2px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    line-height: 1;
}

.btn-detail-chip .fa {
    color: var(--bs-warning) !important;
    font-size: 12px;
    padding: 0;
}

.btn-detail-chip:hover:not(:disabled) {
    background-color: #fff8e1 !important;
    border-color: #ffc107 !important;
}

.theme-btn-add,
.theme-btn-update,
.theme-btn-cancel-edit {
    background-color: var(--mod-accent) !important;
    border: 1px solid var(--mod-accent) !important;
    color: var(--mod-accent-fg) !important;
    box-shadow: none !important;
}

.theme-btn-add .fa,
.theme-btn-update .fa,
.theme-btn-cancel-edit .fa {
    color: var(--bs-warning) !important;
}

.theme-btn-add:hover:not(:disabled),
.theme-btn-update:hover:not(:disabled),
.theme-btn-cancel-edit:hover:not(:disabled) {
    background-color: #e9ecef !important;
    border-color: #e9ecef !important;
    color: var(--mod-accent) !important;
}

.d-none,
[hidden],
button.d-none,
.btn.d-none,
.theme-btn.d-none,
.theme-btn-icon.d-none,
.btn-entry-popup.d-none,
.btn-row-popup.d-none,
.theme-btn-add.d-none,
.theme-btn-update.d-none,
.theme-btn-cancel-edit.d-none {
    display: none !important;
}

/* ==========================================================================
   TABLE SYSTEM - MODERN FLAT CLEAN (ZERO 3D EFFECT)
   ========================================================================== */
table tr th,
.table-responsive table tr th,
table th,
.table-responsive table th,
thead th,
.table thead th,
.table-responsive .table thead th,
.modern-table thead th,
.responsive-items-table thead th,
.stock-table th,
.stock-grid-table th,
table.dataTable thead th,
table.dataTable thead td {
    background-color: var(--table-header-bg) !important;
    background-image: none !important;
    color: var(--table-header-color) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-bottom: 2px solid var(--table-header-border-bottom) !important;
    padding: var(--table-cell-padding) !important;
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    letter-spacing: 0.01em;
    box-shadow: none !important;
    text-shadow: none !important;
}

table thead th a,
.table-responsive table thead th a,
table th a,
table.dataTable thead th a {
    color: var(--table-header-color) !important;
    text-decoration: none !important;
    text-shadow: none !important;
}

/* DataTables Sorting Arrows */
table.dataTable thead .sorting:before,
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_desc:after {
    color: var(--table-header-color) !important;
    opacity: 0.55;
}

table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before {
    opacity: 1 !important;
    color: var(--table-header-color) !important;
}

/* Table Cells (Clean Flat) */
table td,
.table-responsive table td,
.table tbody td {
    padding: var(--table-cell-padding) !important;
    text-align: left;
    font-weight: 400;
    font-size: 13px;
    vertical-align: middle !important;
    border-color: var(--table-cell-border);
    color: var(--theme-text-dark);
}

table td:has(input, select, button, textarea, a),
.table-responsive table td:has(input, select, button, textarea, a) {
    text-align: var(--table-control-text-align);
    padding: var(--table-control-padding) !important;
}

/* Table Container (Flat with subtle border) */
.table-responsive {
    border: 1px solid var(--table-border);
    border-radius: 2px;
    box-shadow: none;
    background-color: #FFFFFF;
}

.table-responsive table {
    border: none;
    width: 100% !important;
    margin-bottom: 0 !important;
}

/* Table Footer / Summary Totals */
table tfoot tr th,
table tfoot tr td,
.table-responsive table tfoot tr th,
.table-responsive table tfoot tr td,
.table-footer {
    background-color: var(--table-footer-bg) !important;
    background-image: none !important;
    border-top: 2px solid var(--theme-primary) !important;
    border-bottom: 1px solid var(--theme-border-strong) !important;
    color: #0F172A !important;
    font-weight: 700 !important;
    text-shadow: none !important;
    vertical-align: middle;
}

/* Quick Entry Row */
.quick-entry-row,
tr.quick-entry-row,
.table-quick-entry {
    background-color: var(--table-quick-entry-bg) !important;
    border-top: 1px solid var(--theme-primary-light-15) !important;
    border-bottom: 2px solid var(--theme-primary) !important;
}

/* Table Hover State */
.table-hover tbody tr {
    transition: background-color 0.12s ease;
}

.table-hover tbody tr:hover td,
.table-hover tbody tr:hover th,
.table-responsive .table-hover tbody tr:hover td,
.table-responsive .table-hover tbody tr:hover th {
    background-color: var(--table-hover-bg) !important;
    color: var(--table-hover-color) !important;
}

/* List grids and modern-table */
:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) {
    border: 1px solid var(--table-cell-border) !important;
    border-collapse: collapse !important;
}

:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) thead tr,
:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm) thead th {
    background-color: var(--table-header-bg) !important;
    color: var(--table-header-color) !important;
    font-weight: 600 !important;
    border: 1px solid var(--table-header-border) !important;
    vertical-align: middle;
}

:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm)>tbody>tr>td,
:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm)>tfoot>tr>td,
:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm)>tbody>tr>th,
:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm)>tfoot>tr>th {
    background-color: var(--table-body-bg);
    border: 1px solid var(--table-cell-border) !important;
}

:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered.table-hover):not(.table-sm)>tbody>tr:hover>* {
    background-color: var(--table-row-hover-bg) !important;
}

:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm)>tfoot>tr,
:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm)>tfoot>tr>td,
:is(.modern-table, .responsive-items-table, table.dataTable, .table.table-bordered):not(.table-sm)>tfoot>tr>th {
    background-color: var(--table-footer-bg) !important;
}

/* Sizing helpers */
.w-40 {
    width: 40px !important;
}

.w-60 {
    width: 60px !important;
}

.w-80 {
    width: 80px !important;
}

/* ===================== ITEM LEDGER & DAY REPORT SUMMARY SEGMENT TITLE STRIPS ===================== */
table thead th.summary-strip-party,
.table thead th.summary-strip-party,
.table-responsive table thead th.summary-strip-party,
table tr th.summary-strip-party,
.table-responsive table tr th.summary-strip-party,
th.summary-strip-party,
tr.summary-strip-party th,
.summary-strip-party {
    background-color: #0284C7 !important;
    background-image: none !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-align: center !important;
    padding: 0.5rem 0.75rem !important;
    border: none !important;
    letter-spacing: 0.02em;
}

table thead th.summary-strip-lot,
.table thead th.summary-strip-lot,
.table-responsive table thead th.summary-strip-lot,
table tr th.summary-strip-lot,
.table-responsive table tr th.summary-strip-lot,
th.summary-strip-lot,
tr.summary-strip-lot th,
.summary-strip-lot {
    background-color: #D97706 !important;
    background-image: none !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-align: center !important;
    padding: 0.5rem 0.75rem !important;
    border: none !important;
    letter-spacing: 0.02em;
}

table thead th.summary-strip-item,
.table thead th.summary-strip-item,
.table-responsive table thead th.summary-strip-item,
table tr th.summary-strip-item,
.table-responsive table tr th.summary-strip-item,
th.summary-strip-item,
tr.summary-strip-item th,
.summary-strip-item {
    background-color: #059669 !important;
    background-image: none !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-align: center !important;
    padding: 0.5rem 0.75rem !important;
    border: none !important;
    letter-spacing: 0.02em;
}

table thead th.summary-strip-dayinout,
.table thead th.summary-strip-dayinout,
.table-responsive table thead th.summary-strip-dayinout,
table tr th.summary-strip-dayinout,
.table-responsive table tr th.summary-strip-dayinout,
th.summary-strip-dayinout,
tr.summary-strip-dayinout th,
.summary-strip-dayinout {
    background-color: #7C3AED !important;
    background-image: none !important;
    color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-align: center !important;
    padding: 0.5rem 0.75rem !important;
    border: none !important;
    letter-spacing: 0.02em;
}

@media print {

    table thead th.summary-strip-party,
    .table thead th.summary-strip-party,
    .table-responsive table thead th.summary-strip-party,
    table tr th.summary-strip-party,
    .table-responsive table tr th.summary-strip-party,
    th.summary-strip-party,
    tr.summary-strip-party th,
    .summary-strip-party,
    table thead th.summary-strip-lot,
    .table thead th.summary-strip-lot,
    .table-responsive table thead th.summary-strip-lot,
    table tr th.summary-strip-lot,
    .table-responsive table tr th.summary-strip-lot,
    th.summary-strip-lot,
    tr.summary-strip-lot th,
    .summary-strip-lot,
    table thead th.summary-strip-item,
    .table thead th.summary-strip-item,
    .table-responsive table thead th.summary-strip-item,
    table tr th.summary-strip-item,
    .table-responsive table tr th.summary-strip-item,
    th.summary-strip-item,
    tr.summary-strip-item th,
    .summary-strip-item,
    table thead th.summary-strip-dayinout,
    .table thead th.summary-strip-dayinout,
    .table-responsive table thead th.summary-strip-dayinout,
    table tr th.summary-strip-dayinout,
    .table-responsive table tr th.summary-strip-dayinout,
    th.summary-strip-dayinout,
    tr.summary-strip-dayinout th,
    .summary-strip-dayinout {
        background-color: #f1f4f8 !important;
        color: #000000 !important;
        border: 1px solid #000000 !important;
        font-size: 10pt !important;
        font-weight: 700 !important;
        text-align: left !important;
        padding: 3px 6px !important;
    }
}

/* ===================== FILTER PILLS / VOUCHER TYPE FILTER TAGS ===================== */
.filter-pill {
    cursor: pointer;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 3px;
    border: 1px solid #ced4da;
    background-color: #ffffff;
    color: #495057;
    margin-right: 4px;
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    line-height: 1.4;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    user-select: none;
    text-decoration: none;
}

.filter-pill:hover {
    background-color: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
}

.filter-pill.active {
    background-color: var(--mod-accent, #2c3e50) !important;
    color: #ffffff !important;
    border-color: var(--mod-accent, #2c3e50) !important;
    font-weight: 600;
}

/* ===================== FORM CONTROLS & SELECT2 (FLAT, NON-ROUND, CRISP RECTANGULAR) ===================== */
/* Form Labels - Clean Inter Font, Crisp & Legible */
label,
.form-label,
.col-form-label,
.form-check-label,
.saas-search-label,
.col-form-label-sm,
.fw-semibold {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

label,
.form-label,
.col-form-label,
.form-check-label,
.saas-search-label,
.col-form-label-sm {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.form-control,
.form-select,
input.form-control,
select.form-select,
select,
textarea.form-control {
    border-radius: var(--theme-control-radius) !important;
    border: 1px solid var(--theme-border-strong);
    color: var(--theme-text-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 0.875rem;
    font-weight: 600;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: none !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-weight: 500;
    color: #94a3b8;
    opacity: 0.9;
}

.form-control:not(textarea):not([type="file"]),
.form-select,
select {
    height: var(--theme-control-height);
    line-height: var(--theme-control-line-height);
    padding: 0.375rem 0.75rem;
}

.form-control:focus,
.form-select:focus,
select:focus,
textarea.form-control:focus {
    background-color: #FFFFFF !important;
    color: var(--theme-text-dark) !important;
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 2px var(--theme-primary-light-20) !important;
    outline: none;
}

.form-control:focus[readonly],
.form-control:focus:disabled,
.form-select:focus:disabled {
    background-color: #F1F5F9 !important;
    color: var(--theme-text-muted) !important;
    box-shadow: none !important;
}

/* Table Controls: Flush, Non-Round Rectangular (Zero Gaps in Cells) */
table .form-control,
table .form-select,
table select,
table input,
table .select2-container .select2-selection,
.table .form-control,
.table .form-select,
.table select,
.table input,
.table .select2-container .select2-selection,
.modern-table .form-control,
.modern-table .form-select,
.modern-table .select2-selection,
.responsive-items-table .form-control,
.responsive-items-table .form-select,
.responsive-items-table .select2-selection {
    border-radius: 0px !important;
}

/* Select2 Customization - Crisp Non-Round */
.select2-container {
    width: 100% !important;
    max-width: 100% !important;
}

.select2-container,
.select2-container *,
.select2-selection__rendered,
.select2-results__option {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.875rem;
}

:is(.select2-container--default, .select2-container--bootstrap-5) .select2-selection--single,
:is(.select2-container--default, .select2-container--bootstrap-5) .select2-selection--multiple {
    border-radius: var(--theme-control-radius) !important;
    border-color: var(--theme-border-strong) !important;
    box-shadow: none !important;
    box-sizing: border-box;
    height: var(--theme-control-height);
    min-height: var(--theme-control-height);
    display: flex;
    align-items: center;
}

:is(.select2-container--default, .select2-container--bootstrap-5) .select2-selection--single .select2-selection__rendered {
    color: var(--theme-text-dark);
    line-height: var(--theme-control-line-height);
    padding-left: 0.75rem;
    padding-right: 2rem;
    font-weight: 600;
}

:is(.select2-container--default, .select2-container--bootstrap-5).select2-container--focus .select2-selection--single,
:is(.select2-container--default, .select2-container--bootstrap-5).select2-container--focus .select2-selection--multiple,
:is(.select2-container--default, .select2-container--bootstrap-5).select2-container--open .select2-selection--single,
:is(.select2-container--default, .select2-container--bootstrap-5).select2-container--open .select2-selection--multiple {
    background-color: #FFFFFF !important;
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 2px var(--theme-primary-light-20) !important;
}

.select2-dropdown {
    border-color: var(--theme-border-strong) !important;
    border-radius: 2px !important;
    box-shadow: var(--theme-shadow-lg) !important;
    max-width: 100% !important;
    overflow-x: hidden;
}

:is(.select2-container--default, .select2-container--bootstrap-5) .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--theme-primary) !important;
    color: #FFFFFF !important;
}

:is(.select2-container--default, .select2-container--bootstrap-5) .select2-results__option--selected {
    background-color: var(--theme-primary-lighter) !important;
    color: var(--theme-primary-dark) !important;
}

/* Input Group Styling - Merged Flush Controls (Zero Odd Curves) */
.input-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
}

.input-group .input-group-text {
    background-color: #F8FAFC;
    border-color: var(--theme-border-strong);
    color: var(--theme-text-muted);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--theme-control-radius);
}

.input-group .theme-btn,
.input-group .btn {
    white-space: nowrap;
    border-radius: var(--theme-control-radius);
}

.input-group>.select2-container {
    width: 1% !important;
    flex: 1 1 auto;
}

.input-group>:not(:first-child):not(.dropdown-menu) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group>:not(:last-child):not(.dropdown-toggle) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group>.select2-container:not(:first-child) .select2-selection--single {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group>.select2-container:not(:last-child) .select2-selection--single {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Number inputs without browser spin buttons */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* ===================== CARDS & PANELS ===================== */
.card {
    background-color: #FFFFFF;
    border: 1px solid var(--theme-border);
    border-radius: 2px;
    box-shadow: none;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--theme-border);
    font-weight: 600;
    padding: 0.75rem 1rem;
    color: #212529;
}

.entry-section-title {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    background: var(--theme-primary-subtle) !important;
    color: #212529 !important;
    border: 1px solid rgba(22, 142, 137, 0.22);
    border-left: 4px solid var(--theme-primary);
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 2px;
    padding: 0.45rem 0.85rem !important;
    margin-bottom: 0.85rem;
}

.entry-section-title .fa {
    color: var(--theme-primary);
}

/* ===================== DAY INWARD / OUTWARD DAY SUMMARY ===================== */
.day-summary-card {
    background: var(--theme-bg-surface, #ffffff);
    border: 1px solid var(--theme-border-strong, #ced4da);
    border-radius: 2px;
    box-shadow: none;
    overflow: hidden;
}

.day-summary-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: var(--table-header-bg, #eef1f4);
    border-bottom: 1px solid var(--table-header-border, #dee2e6);
    border-left: 3px solid var(--theme-primary);
}

.day-summary-title-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.1rem;
}

.day-summary-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--theme-text-dark, #212529);
    line-height: 1.25;
}

.day-summary-title .fa {
    color: var(--theme-primary);
    font-size: 1rem;
}

.day-summary-subtitle {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--theme-text-muted, #6c757d);
}

.day-summary-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.day-summary-metric {
    min-width: 128px;
    padding: 0.4rem 0.7rem;
    border-radius: 2px;
    background: var(--theme-bg-surface, #ffffff);
    border: 1px solid var(--theme-border-strong, #ced4da);
}

.day-summary-metric-primary {
    border-color: #cfe2ff;
    background: var(--theme-primary-subtle);
}

.day-summary-metric-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--theme-text-muted, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.day-summary-metric-value {
    display: block;
    margin-top: 1px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--theme-text-dark, #212529);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.day-summary-metric-primary .day-summary-metric-value {
    color: var(--theme-primary-dark);
}

.day-summary-card-body {
    padding: 0.75rem;
    background: var(--theme-bg-body, #f4f6f8);
}

.day-summary-group {
    height: 100%;
    background: var(--theme-bg-surface, #ffffff);
    border: 1px solid var(--theme-border-strong, #ced4da);
    border-radius: 2px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.day-summary-group-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid var(--table-header-border, #dee2e6);
    background: var(--table-header-bg, #eef1f4);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--table-header-color, #343a40);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.day-summary-group-head .fa,
.day-summary-group-head .theme-text {
    color: var(--theme-primary) !important;
    width: 1em;
    text-align: center;
}

.day-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.25rem 0.35rem 0.45rem;
}

.day-summary-list-compact {
    gap: 0;
}

.day-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.35rem 0.45rem;
    border-radius: 0;
    font-size: 0.875rem;
    border-bottom: 1px solid #f1f3f5;
}

.day-summary-row:last-child {
    border-bottom: none;
}

.day-summary-row span {
    color: var(--theme-text-muted, #6c757d);
    font-weight: 500;
    min-width: 0;
}

.day-summary-row strong {
    color: var(--theme-text-dark, #212529);
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.day-summary-row-accent {
    margin-top: 0.15rem;
    background: var(--theme-primary-subtle);
    border: 1px solid #cfe2ff;
    border-radius: 2px;
    border-bottom: 1px solid #cfe2ff;
}

.day-summary-row-accent span,
.day-summary-row-accent strong {
    color: var(--theme-primary-dark);
    font-weight: 700;
}

.day-summary-item-breakdown {
    margin: 0 0.35rem 0.45rem;
    padding: 0.45rem 0.4rem 0.35rem;
    border-top: 1px dashed var(--theme-border-strong, #ced4da);
}

.day-summary-breakdown-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--theme-text-muted, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}

.day-summary-item-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.day-summary-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.45rem;
    border-radius: 2px;
    background: #f8f9fa;
    border: 1px solid var(--theme-border, #e9ecef);
    font-size: 0.875rem;
}

.day-summary-item-name {
    color: #495057;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.day-summary-item-row strong {
    color: var(--theme-text-dark, #212529);
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.day-summary-item-empty {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.15rem;
}

@media (max-width: 767.98px) {
    .day-summary-card-header {
        padding: 0.55rem 0.7rem;
    }

    .day-summary-metrics {
        width: 100%;
    }

    .day-summary-metric {
        min-width: calc(50% - 0.25rem);
        flex: 1 1 auto;
    }

    .day-summary-card-body {
        padding: 0.55rem;
    }
}

/* Action Bars & Search Filter Rows */
.saas-search-label {
    white-space: nowrap;
    text-align: right;
    font-weight: 600;
    font-size: 0.875rem;
    color: #334155;
}

.ui-action-bar {
    background-color: #F8FAFC;
    border: 1px solid var(--theme-border);
    border-radius: 2px;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
}

/* ===================== DAYBOARD & OPERATIONAL MODULES ===================== */
.basket-tab-btn {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0;
    border-radius: 2px;
    transition: all 0.15s ease;
    cursor: pointer;
    background-color: #FFFFFF;
    border: 1.5px solid var(--basket-border, var(--theme-border));
    color: #0F172A;
    height: 40px !important;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    box-shadow: none;
}

.basket-tab-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--theme-shadow-sm);
}

.basket-tab-btn.active-basket {
    background-color: var(--basket-active-bg, var(--theme-primary-lighter)) !important;
    border-color: var(--basket-color, var(--theme-primary)) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.basket-left-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    height: 100%;
    border-right: 1.5px solid var(--basket-border, var(--theme-border));
    background-color: var(--basket-soft-bg, #FFFFFF);
    color: var(--basket-color, var(--theme-primary));
    font-size: 0.95rem;
    font-weight: 700;
}

.basket-middle-info {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0F172A;
    white-space: nowrap;
    gap: 6px;
}

.basket-checkout-block {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    height: 100%;
    border-left: 1.5px solid var(--basket-border, var(--theme-border));
    background-color: var(--basket-soft-bg, #FFFFFF);
    color: var(--basket-color, var(--theme-primary));
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.15s ease;
}

.basket-checkout-block:hover {
    background-color: var(--basket-color, var(--theme-primary)) !important;
    color: #FFFFFF !important;
}

/* ===================== ACTIVE LOT STOCK DRAWER ===================== */
.lot-drawer-trigger {
    position: fixed;
    right: 0;
    top: 220px;
    z-index: 1045;
    background-color: var(--theme-primary);
    color: #FFFFFF;
    border: 1px solid var(--theme-primary-dark);
    border-right: none;
    border-radius: 2px 0 0 2px;
    box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.12);
    padding: 8px 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.15s ease;
}

.lot-drawer-trigger:hover {
    transform: translateX(-3px);
}

.drawer-trigger-icon {
    font-size: 1.1rem;
    color: #ffffff;
}

.drawer-trigger-text {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    line-height: 1;
    margin: 3px 0;
}

.lot-drawer-backdrop {
    background: rgba(15, 23, 42, 0.4);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.lot-drawer-backdrop.backdrop-open {
    opacity: 1;
    visibility: visible;
}

.lot-drawer-panel {
    right: -390px;
    width: 375px;
    max-width: 90vw;
    z-index: 1055;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background-color: #FFFFFF;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
}

.lot-drawer-panel.drawer-open {
    right: 0;
}

.lot-drawer-header {
    background-color: var(--theme-primary) !important;
    border-bottom: 1px solid var(--theme-primary-dark);
}

.theme-thead th {
    background-color: var(--theme-primary-lighter) !important;
    color: var(--theme-primary-dark);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 8px;
    border-bottom: 2px solid var(--theme-border);
    white-space: nowrap;
}

.lot-stock-table tbody tr {
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.lot-stock-table tbody tr:hover {
    background-color: var(--theme-primary-lighter) !important;
}

.theme-panel-footer {
    background-color: var(--theme-primary-lighter);
    color: var(--theme-primary-dark);
    border: 1px solid rgba(var(--theme-primary-rgb), 0.25);
}

.lot-stock-table-wrap {
    overflow-y: auto;
    max-height: calc(100vh - 170px);
}

.lot-stock-table-wrap::-webkit-scrollbar {
    width: 5px;
}

.lot-stock-table-wrap::-webkit-scrollbar-thumb {
    background-color: var(--theme-primary);
    border-radius: 4px;
}

.lot-stock-table-wrap::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.lot-picked-flash {
    animation: lotPickedFlashAnim 0.8s ease-in-out;
}

@keyframes lotPickedFlashAnim {
    0% {
        background-color: var(--theme-primary-lighter);
        box-shadow: 0 0 0 3px var(--theme-primary-light);
    }

    50% {
        background-color: #cfe2ff;
        box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.25);
    }

    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

/* ===================== PAGINATION & MISC ===================== */
.page-link {
    background-color: #FFFFFF !important;
    color: var(--theme-primary-dark) !important;
    border-color: var(--theme-border-strong) !important;
    font-weight: 600;
    border-radius: 2px !important;
    margin: 0 2px;
}

.page-item.active .page-link {
    background-color: var(--theme-primary) !important;
    color: #FFFFFF !important;
    border-color: var(--theme-primary) !important;
}

/* DataTables: info inset, length width, grouped centered pager */
.dt-container .dt-info,
.dataTables_wrapper .dataTables_info {
    padding-left: 12px !important;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
}

.dt-container .dt-length,
.dataTables_wrapper .dataTables_length {
    padding-top: 0;
    padding-right: 12px;
    padding-bottom: 0;
    margin: 0;
}

.dt-container>.row.mb-2,
.dt-container>.row.align-items-center {
    margin-bottom: 0.35rem !important;
    margin-top: 0 !important;
}

.dt-container .dt-length select,
.dataTables_wrapper .dataTables_length select,
.dt-container .dt-input,
.dt-container .dt-length .form-select {
    min-width: 7rem !important;
    width: 7rem !important;
    max-width: 7rem;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 1.6rem 0 0.45rem !important;
    font-size: 13px !important;
    font-weight: 600;
    line-height: 26px;
    text-align: left;
}

.dt-container>.row.mt-3,
.dt-container .row:has(.dt-paging) {
    margin-top: 0.25rem !important;
}

.dt-container .dt-paging,
.dataTables_wrapper .dataTables_paginate {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    text-align: center !important;
    padding: 0;
    margin: 0 !important;
}

.dt-container .pagination,
.dataTables_wrapper .pagination {
    display: inline-flex;
    justify-content: center;
    margin: 0 auto !important;
    gap: 0;
}

.dt-container .pagination .page-link,
.dataTables_wrapper .pagination .page-link {
    min-width: 36px;
    height: 36px;
    margin: 0 !important;
    margin-left: -1px !important;
    padding: 0 8px !important;
    border-radius: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.dt-container .pagination .page-item:first-child .page-link,
.dataTables_wrapper .pagination .page-item:first-child .page-link {
    border-top-left-radius: 2px !important;
    border-bottom-left-radius: 2px !important;
    margin-left: 0 !important;
}

.dt-container .pagination .page-item:last-child .page-link,
.dataTables_wrapper .pagination .page-item:last-child .page-link {
    border-top-right-radius: 2px !important;
    border-bottom-right-radius: 2px !important;
}

.table-pager {
    background-color: #F8FAFC;
    padding: 8px;
    border-radius: 2px;
    border: 1px solid var(--theme-border);
}

.table-pager table tr td a {
    background-color: var(--theme-primary);
    color: #FFFFFF !important;
    padding: 4px 10px !important;
    margin: 2px !important;
    border-radius: 2px;
    font-weight: 600;
}

.table-pager table tr td span {
    background-color: #FFFFFF;
    color: var(--theme-primary-dark);
    padding: 4px 10px !important;
    margin: 2px !important;
    border-radius: 2px;
    border: 1px solid var(--theme-border);
    font-weight: 700;
}

/* ===================== PUBLIC SITE & AUTH ===================== */
.navbar-public {
    background-color: #FFFFFF !important;
    border-bottom: 1px solid var(--theme-border);
    box-shadow: none;
}

.navbar-public .navbar-brand {
    font-weight: 800;
    color: #212529 !important;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.navbar-public .nav-link {
    color: #495057 !important;
    font-weight: 600;
    font-size: 0.875rem;
    margin: 0 0.15rem;
    padding: 0.45rem 0.7rem !important;
    border-radius: 2px;
}

.navbar-public .nav-link:hover,
.navbar-public .nav-link:focus {
    color: var(--theme-primary) !important;
    background-color: #f4f6f8;
}

.navbar-public .btn-nav-login,
.navbar-public .btn {
    border-radius: 2px !important;
}

.navbar-public .navbar-toggler {
    border: 1px solid var(--theme-border-strong);
    border-radius: 2px;
}

.public-footer {
    background-color: #FFFFFF;
    border-top: 1px solid var(--theme-border);
    padding: 1.5rem 0;
    color: var(--theme-text-muted);
    font-size: 0.875rem;
}

.site-hero {
    background-color: #ffffff;
    border-bottom: 1px solid var(--theme-border);
}

.site-band {
    background-color: #f4f6f8;
    border-bottom: 1px solid var(--theme-border);
}

.site-band-white {
    background-color: #ffffff;
}

.site-kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--theme-primary-dark);
    background: #e7f1ff;
    border: 1px solid #b6d4fe;
    padding: 0.25rem 0.65rem;
    margin-bottom: 0.75rem;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    color: #212529;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.site-lead {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 0;
}

.site-preview {
    border: 1px solid var(--theme-border);
    background: #fff;
    padding: 1.15rem;
    text-align: left;
}

.site-stat {
    border: 1px solid var(--theme-border);
    background: #f8f9fa;
    padding: 0.75rem;
}

.site-step {
    border: 1px solid var(--theme-border);
    background: #fff;
    padding: 1rem 0.9rem;
    height: 100%;
}

.site-step-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--theme-primary);
    margin-bottom: 0.35rem;
}

.site-feature {
    border: 1px solid var(--theme-border);
    background: #fff;
    padding: 1.15rem;
    height: 100%;
}

.site-feature-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f8;
    color: var(--theme-primary);
    border: 1px solid var(--theme-border);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.site-plan {
    border: 1px solid var(--theme-border);
    background: #fff;
    padding: 1.35rem 1.1rem;
    height: 100%;
    text-align: center;
}

.site-plan-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--theme-primary);
    margin: 0.75rem 0;
}

.site-note {
    border: 1px solid var(--theme-border);
    background: #fff;
    padding: 1.15rem 1.25rem;
    height: 100%;
}

.site-cta {
    background: #f4f6f8;
    border-top: 1px solid var(--theme-border);
    text-align: center;
}

.hover-shadow:hover {
    background-color: #f8f9fa;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
    padding: 32px 15px;
    background-color: var(--theme-bg-body);
}

.login-container .card,
.auth-status-panel {
    width: 100%;
    max-width: 560px;
    border: 1px solid var(--theme-border) !important;
    border-radius: 2px !important;
    background: #fff;
    box-shadow: none !important;
}

.auth-split {
    min-height: calc(100vh - 140px);
}

.auth-split-info {
    background: #f4f6f8;
    border-right: 1px solid var(--theme-border);
}

.auth-split-form {
    background: #fff;
}

.auth-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e7f1ff;
    color: var(--theme-primary);
    border: 1px solid #b6d4fe;
    margin: 0 auto 1rem auto;
    font-size: 1.25rem;
}

.auth-feature-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--theme-border);
    color: var(--theme-primary);
}

.register-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
    padding: 32px 15px;
    background-color: var(--theme-bg-body);
}

.register-card {
    width: 100%;
    max-width: 1000px;
    border-radius: 2px !important;
    box-shadow: none !important;
    border: 1px solid var(--theme-border) !important;
    background-color: #FFFFFF;
}

.register-card .form-label,
.login-container .form-label,
.auth-split-form .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 0.35rem;
}

.section-title {
    color: #343a40;
    font-size: 1.05rem;
    font-weight: 700;
    border-bottom: 1px solid var(--theme-border);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.org-code-box {
    background: #f4f6f8;
    border: 1px solid var(--theme-border);
    padding: 1.25rem;
}

.org-code-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.12em;
    color: #212529;
    font-weight: 700;
}

/* Bootstrap button radius aligned with ERP controls */
.btn,
.btn-primary,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger {
    border-radius: 2px;
}

.modal-content {
    border-radius: 2px;
    border: 1px solid var(--theme-border);
}

.alert {
    border-radius: 2px;
}

/* Select2 font matches page (already Inter) — keep rectangular */
.select2-container .select2-selection--single .select2-selection__rendered,
.select2-results__option {
    font-size: 0.875rem !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-weight: 600 !important;
}

/* DateTime picker color alignment (loaded after this file on some pages; duplicated with !important) */
.cal-nav-btn:hover {
    color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
}

.cal-select:focus,
.cal-time-input:focus {
    color: #212529 !important;
    border-color: var(--theme-primary) !important;
}

.cal-btn-primary,
.cal-today-btn:hover,
.cal-today-btn-mini:hover {
    background-color: var(--theme-primary) !important;
    border-color: var(--theme-primary) !important;
    color: #fff !important;
}

.cal-today-btn,
.cal-today-btn-mini {
    color: var(--theme-primary) !important;
    background-color: #e7f1ff !important;
    border-color: var(--theme-primary) !important;
    border-radius: 2px !important;
}

/* Date picker: isolate from ERP tables; fit 7 days; stay on small screens */
#calBorder {
    width: 280px !important;
    max-width: calc(100vw - 16px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    z-index: 5000 !important;
    padding: 3px !important;
    background-color: #F8FAFC !important;
}

#calBorder table,
#calBorder table.table {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    table-layout: fixed !important;
}

#calBorder tr[style*="display:flex"] {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
}

#calBorder>span {
    padding: 0 !important;
}

#calBorder .cal-close-btn {
    margin-top: 2px !important;
    margin-bottom: 0 !important;
}

#calBorder table table {
    border-collapse: separate !important;
    border-spacing: 2px 2px !important;
}

#calBorder table tr th,
#calBorder table th,
#calBorder table td {
    padding: 3px 1px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-width: 0 !important;
    border: none !important;
    border-bottom: none !important;
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

#calBorder .calTD {
    width: 14.28% !important;
    overflow: hidden !important;
    padding: 3px 1px !important;
}

#calBorder select,
#calBorder .cal-select,
#calBorder .cal-time-input {
    height: 28px !important;
    min-height: 28px !important;
    width: auto !important;
    max-width: 108px !important;
    min-width: 0 !important;
    padding: 0 4px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    color: #212529 !important;
    background-color: #ffffff !important;
}

#calBorder select option,
#calBorder .cal-select option {
    color: #212529 !important;
    background-color: #ffffff !important;
}

@media (max-width: 400px) {
    #calBorder {
        width: calc(100vw - 16px) !important;
        padding: 3px !important;
    }

    #calBorder .cal-select,
    #calBorder select {
        max-width: 86px !important;
        font-size: 12px !important;
        height: 26px !important;
        min-height: 26px !important;
    }

    #calBorder .calTD {
        font-size: 11px !important;
        padding: 3px 1px !important;
    }
}

.custdatetime .form-control {
    border-radius: 2px 0 0 2px !important;
}

.custdatetime .input-group-text {
    border-radius: 0 2px 2px 0 !important;
}

.cust-btn {
    border-radius: 2px !important;
}

/* Readable admin nav on smaller screens */
@media (max-width: 991.98px) {
    .admin-header-bar {
        padding: 0.6rem 0.85rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .admin-navbar {
        padding: 0.25rem 0.5rem !important;
    }

    .admin-navbar .navbar-nav {
        align-items: stretch !important;
        width: 100%;
        gap: 2px;
        padding: 0.35rem 0 0.6rem;
    }

    .admin-navbar .nav-link {
        width: 100%;
        height: auto;
        min-height: 38px;
        justify-content: flex-start;
        font-size: 0.9rem !important;
    }

    .admin-navbar .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        box-shadow: none;
        border: 1px solid var(--theme-border);
        margin: 0 0 0.35rem;
    }

    .nav-mega-2,
    .nav-mega-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .site-title {
        font-size: 1.55rem;
    }

    .auth-split-info {
        border-right: none;
        border-bottom: 1px solid var(--theme-border);
    }
}

@media (max-width: 575.98px) {
    .admin-main-container {
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
    }

    .user-name-text {
        max-width: 72px;
    }

    .btn-group {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   GLOBAL PRINT STYLES — Zero grey background, pure white A4 print baseline
   ========================================================================== */
@media print {

    *,
    *::before,
    *::after {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    html,
    body,
    .admin-main-container,
    .container-fluid,
    .main-content,
    .content-wrapper,
    div,
    section,
    article {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #000000 !important;
    }

    .admin-main-container {
        min-height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    table,
    tbody,
    thead,
    tfoot,
    tr,
    th,
    td,
    .table,
    .table-sm,
    .table-bordered,
    .table-hover,
    .table-striped,
    .table-light,
    .table-secondary,
    .table-success,
    .table-danger,
    .table-warning,
    .table-info,
    .table-active,
    .bg-light,
    .bg-white,
    .bg-secondary,
    .bg-success,
    .bg-danger,
    .bg-warning,
    .bg-info,
    .bg-dark,
    .theme-bg-lighter,
    .theme-bg-lightest,
    .theme-bg-soft,
    .theme-bg-primary {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #000000 !important;
    }

    .text-success,
    .text-danger,
    .text-primary,
    .text-warning,
    .text-info,
    .text-muted,
    .text-secondary,
    .theme-text-color {
        color: #000000 !important;
    }

    .admin-top-chrome,
    .admin-header-bar,
    .admin-navbar,
    .admin-footer,
    footer,
    nav,
    .no-print,
    .no-print *,
    #searchForm,
    .alert,
    .dt-container .dt-length,
    .dt-container .dt-paging,
    .dt-container .dt-info,
    .dt-container .dt-search,
    .dt-container>.row,
    .dt-length,
    .dt-paging,
    .dt-info,
    .dt-search,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_paginate,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_length,
    .dataTables_paginate,
    .dataTables_info,
    .dataTables_filter,
    .pagination,
    .pagination *,
    .page-item,
    .page-link,
    .dt-paging-button,
    i,
    .fa,
    .svg {
        display: none !important;
    }
}