/**
 * Enterprise Manufacturing ERP - Core Styling & Precision Theme Engine
 * Synced Typography: Inter (UI) + JetBrains Mono (Financial & Numbers)
 * High-Density Professional DataGrids & Enterprise Controls
 */

/* ==========================================================================
   1. Dynamic Theme Palettes (5 Themes)
   ========================================================================== */

:root, [data-theme="theme-titanium"] {
    --primary: #334155;
    --primary-hover: #1e293b;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --sidebar-bg: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #6366f1;
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --grid-border: #e2e8f0;
    --row-alt: #fbfcfe;
    --row-hover: rgba(99, 102, 241, 0.06);
    --bg-alt: #f1f5f9;
}

[data-theme="theme-blue"] {
    --primary: #1e40af;
    --primary-hover: #1d4ed8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #3b82f6;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --grid-border: #cbd5e1;
    --row-alt: #f8fafc;
    --row-hover: rgba(59, 130, 246, 0.06);
    --bg-alt: #e2e8f0;
}

[data-theme="theme-green"] {
    --primary: #065f46;
    --primary-hover: #047857;
    --accent: #10b981;
    --accent-hover: #059669;
    --sidebar-bg: #064e3b;
    --sidebar-text: #a7f3d0;
    --sidebar-active: #10b981;
    --body-bg: #f0fdf4;
    --card-bg: #ffffff;
    --text-main: #064e3b;
    --text-muted: #4b5563;
    --grid-border: #d1fae5;
    --row-alt: #f7fef9;
    --row-hover: rgba(16, 185, 129, 0.06);
    --bg-alt: #dcfce7;
}

[data-theme="theme-orange"] {
    --primary: #b45309;
    --primary-hover: #d97706;
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --sidebar-bg: #1c1917;
    --sidebar-text: #d6d3d1;
    --sidebar-active: #f59e0b;
    --body-bg: #fafaf9;
    --card-bg: #ffffff;
    --text-main: #1c1917;
    --text-muted: #78716c;
    --grid-border: #e7e5e4;
    --row-alt: #fffdf7;
    --row-hover: rgba(245, 158, 11, 0.06);
    --bg-alt: #f5f5f4;
}

[data-theme="theme-black"] {
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --sidebar-bg: #090d16;
    --sidebar-text: #94a3b8;
    --sidebar-active: #38bdf8;
    --body-bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --grid-border: #334155;
    --row-alt: #131c31;
    --row-hover: rgba(56, 189, 248, 0.09);
    --bg-alt: #1e293b;
}

/* ==========================================================================
   2. Global Typography & Core Reset (Synced Inter + JetBrains Mono)
   ========================================================================== */

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

html {
    font-size: 14px; /* Standardize baseline for high-density enterprise software */
}

body {
    background-color: var(--body-bg);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.015em;
    margin-top: 0;
}

h1 { font-size: 1.35rem; }
h2 { font-size: 1.20rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.92rem; }
h5 { font-size: 0.85rem; }
h6 { font-size: 0.78rem; }

p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 10px;
}

/* Global Monospaced & Tabular Numbers */
code, kbd, pre, samp,
.mono-num,
.tabular-nums,
[style*="Roboto Mono"],
[style*="monospace"] {
    font-family: 'JetBrains Mono', 'Roboto Mono', SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace !important;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "cv01" 1;
}

code {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.78rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme="theme-black"] code {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   3. Sidebar Navigation & Layout Structure
   ========================================================================== */

.erp-sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--grid-border);
    transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 100;
}

.erp-brand {
    height: 62px;
    padding: 0 12px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: padding 0.22s ease, justify-content 0.22s ease;
}

.erp-brand .brand-icon {
    font-size: 1.15rem;
    color: var(--accent);
    margin-right: 10px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.erp-brand .brand-logo-img {
    height: 48px;
    max-width: 200px;
    object-fit: contain;
    border-radius: 4px;
    transition: all 0.22s ease;
}

.erp-brand .brand-text {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.erp-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-grow: 1;
}

.erp-menu > li {
    position: relative;
}

.erp-menu > li > a {
    display: flex;
    align-items: center;
    padding: 9px 18px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 500;
    transition: background-color 0.12s ease, color 0.12s ease, border-left-color 0.12s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.erp-menu > li > a:hover,
.erp-menu > li.active > a {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-left-color: var(--sidebar-active);
}

.erp-menu > li.has-submenu.open > a {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.erp-menu a i.menu-icon {
    width: 20px;
    font-size: 1.02rem;
    margin-right: 11px;
    text-align: center;
    flex-shrink: 0;
}

.erp-menu a .menu-text {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erp-menu a .arrow-icon {
    font-size: 0.75rem;
    opacity: 0.65;
    margin-left: auto;
    width: 14px;
    text-align: right;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.erp-menu > li.has-submenu.open > a .arrow-icon {
    transform: rotate(90deg);
    opacity: 1;
    color: var(--sidebar-active);
}

/* ==========================================================================
   Submenu Accordion
   ========================================================================== */

.erp-submenu {
    list-style: none;
    margin: 0;
    padding: 3px 0 6px 0;
    background-color: rgba(0, 0, 0, 0.18);
    display: none;
}

.erp-menu > li.has-submenu.open > .erp-submenu {
    display: block;
}

.erp-submenu li a {
    display: flex;
    align-items: center;
    padding: 7px 18px 7px 36px;
    font-size: 0.91rem;
    color: var(--sidebar-text);
    text-decoration: none;
    opacity: 0.82;
    transition: all 0.12s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.erp-submenu li a:hover {
    opacity: 1;
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.06);
    border-left-color: rgba(255, 255, 255, 0.35);
}

.erp-submenu li.active-sub a {
    opacity: 1;
    color: var(--sidebar-active);
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.08);
    border-left-color: var(--sidebar-active);
}

.erp-submenu li a .sub-dot {
    font-size: 0.38rem;
    width: 12px;
    margin-right: 9px;
    text-align: center;
    opacity: 0.8;
}

/* ==========================================================================
   Collapsed Sidebar State
   ========================================================================== */

body.sidebar-collapsed .erp-sidebar,
html.sidebar-collapsed .erp-sidebar {
    width: 68px;
}

body.sidebar-collapsed .erp-brand,
html.sidebar-collapsed .erp-brand {
    padding: 0;
    justify-content: center;
}

body.sidebar-collapsed .erp-brand .brand-icon,
html.sidebar-collapsed .erp-brand .brand-icon {
    margin-right: 0;
}

body.sidebar-collapsed .erp-brand .brand-logo-img,
html.sidebar-collapsed .erp-brand .brand-logo-img {
    height: 34px;
    max-width: 48px;
    object-fit: cover;
    object-position: left;
}

body.sidebar-collapsed .erp-brand .brand-text,
html.sidebar-collapsed .erp-brand .brand-text,
body.sidebar-collapsed .erp-menu .menu-text,
html.sidebar-collapsed .erp-menu .menu-text,
body.sidebar-collapsed .erp-menu .arrow-icon,
html.sidebar-collapsed .erp-menu .arrow-icon {
    display: none !important;
}

body.sidebar-collapsed .erp-menu > li > a,
html.sidebar-collapsed .erp-menu > li > a {
    padding: 11px 0;
    justify-content: center;
    text-align: center;
}

body.sidebar-collapsed .erp-menu > li > a i.menu-icon,
html.sidebar-collapsed .erp-menu > li > a i.menu-icon {
    margin-right: 0;
    font-size: 1.15rem;
    width: auto;
}

body.sidebar-collapsed .erp-submenu,
html.sidebar-collapsed .erp-submenu {
    display: none !important;
}

/* Flyout Submenu on Hover when Collapsed */
body.sidebar-collapsed .erp-menu > li.has-submenu:hover > .erp-submenu {
    display: block !important;
    position: absolute;
    left: 68px;
    top: 0;
    min-width: 220px;
    background: var(--sidebar-bg);
    border: 1px solid var(--grid-border);
    border-left: none;
    border-radius: 0 6px 6px 0;
    box-shadow: 4px 6px 18px rgba(0, 0, 0, 0.35);
    z-index: 1000;
    padding: 6px 0;
}

body.sidebar-collapsed .erp-menu > li.has-submenu:hover > .erp-submenu li a {
    padding: 8px 16px;
    justify-content: flex-start;
    text-align: left;
}

/* ==========================================================================
   Main Content & Top Header
   ========================================================================== */

.erp-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.22s ease;
}

.erp-header {
    height: 56px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--grid-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.erp-sidebar-toggle {
    background: transparent;
    border: 1px solid var(--grid-border);
    color: var(--text-main);
    width: 34px;
    height: 34px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.erp-sidebar-toggle:hover {
    background-color: var(--bg-alt);
    color: var(--primary);
    border-color: var(--primary);
}

.erp-content {
    padding: 20px 24px;
    flex-grow: 1;
    overflow-x: auto;
}

/* ==========================================================================
   4. High-Density Enterprise Precision DataGrids & Tables (.erp-datagrid & .erp-table)
   ========================================================================== */

.erp-table-container,
.erp-card {
    background-color: var(--card-bg);
    border: 1px solid var(--grid-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
}

.erp-card {
    padding: 18px 20px;
}

.erp-table-container > div[style*="overflow-x"],
.erp-card > div[style*="overflow-x"],
div[style*="overflow-x: auto"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Modern thin scrollbar */
div[style*="overflow-x: auto"]::-webkit-scrollbar,
.erp-table-container::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
div[style*="overflow-x: auto"]::-webkit-scrollbar-track,
.erp-table-container::-webkit-scrollbar-track {
    background: var(--body-bg);
}
div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb,
.erp-table-container::-webkit-scrollbar-thumb {
    background: var(--grid-border);
    border-radius: 3px;
}
div[style*="overflow-x: auto"]::-webkit-scrollbar-thumb:hover,
.erp-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Unify both .erp-datagrid and .erp-table under professional dense styling */
.erp-datagrid,
.erp-table,
.super-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem; /* ~13px compact professional size */
    line-height: 1.42;
    color: var(--text-main);
    text-align: left;
}

/* Table Headers */
.erp-datagrid thead th,
.erp-table thead th,
.super-table thead th {
    background-color: var(--body-bg);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem !important; /* ~11.5px crisp, clean header */
    letter-spacing: 0.04em;
    padding: 8px 10px !important;
    border-bottom: 2px solid var(--grid-border);
    border-right: 1px solid var(--grid-border);
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: left;
    white-space: nowrap;
}

.erp-datagrid thead th:last-child,
.erp-table thead th:last-child,
.super-table thead th:last-child {
    border-right: none;
}

/* Table Rows & Striping */
.erp-datagrid tbody tr,
.erp-table tbody tr,
.super-table tbody tr {
    transition: background-color 0.12s ease;
}

.erp-datagrid tbody tr:nth-child(even),
.erp-table tbody tr:nth-child(even),
.super-table tbody tr:nth-child(even) {
    background-color: var(--row-alt);
}

.erp-datagrid tbody tr:hover,
.erp-table tbody tr:hover,
.super-table tbody tr:hover {
    background-color: var(--row-hover);
    box-shadow: inset 3px 0 0 var(--accent);
}

/* Table Cells */
.erp-datagrid td,
.erp-table td,
.super-table td {
    padding: 6px 10px !important; /* Dense, compact cell padding to stop awkward column sprawling */
    border-bottom: 1px solid var(--grid-border);
    border-right: 1px solid var(--grid-border);
    color: var(--text-main);
    vertical-align: middle;
    font-size: 0.8125rem !important;
}

.erp-datagrid td:last-child,
.erp-table td:last-child,
.super-table td:last-child {
    border-right: none;
}

.erp-datagrid td strong,
.erp-table td strong,
.super-table td strong {
    font-weight: 600;
}

.erp-datagrid td small,
.erp-table td small,
.super-table td small {
    font-size: 0.725rem !important;
    line-height: 1.25;
}

/* Numeric & Monospace Cells */
.erp-datagrid td .tabular-nums,
.erp-table td .tabular-nums,
.super-table td .tabular-nums,
td.tabular-nums,
td.mono-num {
    font-size: 0.8125rem !important;
    white-space: nowrap !important;
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace !important;
}

.mono-num {
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace !important;
    font-weight: 500;
    text-align: right;
    letter-spacing: -0.3px;
    font-variant-numeric: tabular-nums;
}

/* Protect Dates, Badges, and Action Groups from Breaking Across Rows */
.nowrap,
td[style*="text-align: center"],
th[style*="text-align: center"],
td[style*="text-align: right"],
th[style*="text-align: right"],
td > div[style*="inline-flex"],
td > div[style*="display: flex"],
td:has(> .erp-badge),
td:has(> .mono-num),
td:has(> .tabular-nums) {
    white-space: nowrap;
}

/* ==========================================================================
   5. Compact Button Hierarchy (.erp-btn)
   ========================================================================== */

.erp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    line-height: 1.3;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: 'Inter', -apple-system, sans-serif;
}

.erp-btn i {
    font-size: 0.72rem;
}

.erp-btn-primary {
    background-color: var(--accent);
    color: #ffffff !important;
    border-color: var(--accent);
}

.erp-btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.erp-btn-secondary {
    background-color: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

.erp-btn-secondary i,
.erp-btn-secondary span {
    color: inherit;
}

.erp-btn-secondary:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.erp-btn-secondary:hover i,
.erp-btn-secondary:hover span {
    color: inherit;
}

.erp-btn-secondary:focus,
.erp-btn-secondary:active {
    background-color: #cbd5e1;
    color: #0f172a;
    border-color: #64748b;
}

[data-theme="theme-black"] .erp-btn-secondary,
.super-header .erp-btn-secondary,
.super-card .erp-btn-secondary,
.super-table .erp-btn-secondary,
.login-box .erp-btn-secondary {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-theme="theme-black"] .erp-btn-secondary:hover,
.super-header .erp-btn-secondary:hover,
.super-card .erp-btn-secondary:hover,
.super-table .erp-btn-secondary:hover,
.login-box .erp-btn-secondary:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

.erp-btn-success {
    background-color: #10b981;
    color: #ffffff !important;
    border-color: #10b981;
}

.erp-btn-success:hover {
    background-color: #059669;
    border-color: #059669;
}

.erp-btn-danger {
    background-color: #ef4444;
    color: #ffffff !important;
    border-color: #ef4444;
}

.erp-btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
}

.erp-btn-warning {
    background-color: #f59e0b;
    color: #ffffff !important;
    border-color: #f59e0b;
}

.erp-btn-warning:hover {
    background-color: #d97706;
    border-color: #d97706;
}

/* ==========================================================================
   6. Clean Status Badges (.erp-badge)
   ========================================================================== */

.erp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px !important;
    border-radius: 4px;
    font-size: 0.6875rem !important; /* 11px */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    line-height: 1.35;
    font-family: 'Inter', -apple-system, sans-serif;
}

.badge-success { background-color: #dcfce7; color: #166534; }
.badge-primary { background-color: #dbeafe; color: #1e40af; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-danger  { background-color: #fee2e2; color: #991b1b; }
.badge-secondary{ background-color: #f1f5f9; color: #475569; }
.badge-dark    { background-color: #334155; color: #ffffff; }

[data-theme="theme-black"] .badge-success { background-color: rgba(16, 185, 129, 0.2); color: #34d399; }
[data-theme="theme-black"] .badge-primary { background-color: rgba(59, 130, 246, 0.2); color: #60a5fa; }
[data-theme="theme-black"] .badge-warning { background-color: rgba(245, 158, 11, 0.2); color: #fbbf24; }
[data-theme="theme-black"] .badge-danger  { background-color: rgba(239, 68, 68, 0.2); color: #f87171; }
[data-theme="theme-black"] .badge-secondary{ background-color: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
[data-theme="theme-black"] .badge-dark    { background-color: rgba(255, 255, 255, 0.1); color: #f8fafc; }

/* ==========================================================================
   7. Form Inputs & Controls
   ========================================================================== */

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.8125rem;
    color: var(--text-main);
    background-color: var(--card-bg);
    border: 1px solid var(--grid-border);
    border-radius: 5px;
    padding: 6px 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    box-sizing: border-box;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: inline-block;
}

/* Touch Targets for Kiosk Floor Terminal */
.touch-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* ==========================================================================
   Grid Search Toolbar Component (Requirement 20)
   ========================================================================== */
.erp-grid-search-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    background: var(--bg-alt);
    border: 1px solid var(--grid-border);
    border-radius: 6px;
    flex-wrap: wrap;
}

.erp-grid-search-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 480px;
}

.erp-grid-search-input-wrapper {
    position: relative;
    flex: 1;
}

.erp-grid-search-input-wrapper i.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.82rem;
    pointer-events: none;
}

.erp-grid-search-input {
    width: 100%;
    padding: 7px 12px 7px 32px !important;
    border-radius: 5px !important;
    border: 1px solid var(--grid-border) !important;
    font-size: 0.82rem !important;
    background: var(--card-bg) !important;
    color: var(--text-main) !important;
}

.erp-grid-search-btn {
    padding: 7px 14px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    border-radius: 5px !important;
    white-space: nowrap !important;
}

.erp-grid-clear-btn {
    padding: 7px 12px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    border-radius: 5px !important;
    white-space: nowrap !important;
}

.erp-grid-search-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.erp-grid-search-badge {
    background: var(--card-bg);
    border: 1px solid var(--grid-border);
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

/* ==========================================================================
   Global Print Optimization Rules (Clean Print / Zero Sidebar)
   ========================================================================== */
@media print {
    aside.erp-sidebar,
    .erp-sidebar,
    header.erp-header,
    .erp-header,
    .erp-topbar,
    .subnav-container,
    .erp-subnav,
    .erp-breadcrumb,
    .erp-footer,
    .doc-action-bar,
    .doc-no-print,
    .no-print,
    .erp-btn,
    .btn,
    button:not(.allow-print) {
        display: none !important;
    }

    body,
    html {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .erp-layout,
    .erp-main,
    .erp-container,
    .erp-table-container,
    .erp-card {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
        background: transparent !important;
    }

    @page {
        size: A4 portrait;
        margin: 10mm;
    }
}
