/**
 * Muchkund Engineering - Unified Admin Panel Stylesheet
 * Brand Identity & Responsive UI System
 */

:root {
    --navy: #171D32;
    --navy-mid: #222B4A;
    --navy-pale: #F2F5FF;
    --gold: #EE8022;
    --gold-light: #EF984C;
    --gold-pale: #FFF7F0;
    --gold-border: rgba(238, 128, 34, 0.28);
    --text-dark: #171D32;
    --text-mid: #3A3D4E;
    --text-light: #60676B;
    --bg-page: #F8F9FA;
    --border-color: #EAE6DF;
    
    --success: #27AE60;
    --success-pale: #E8F8F0;
    --warning: #F39C12;
    --warning-pale: #FEF5E7;
    --danger: #E74C3C;
    --danger-pale: #FDECEA;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif !important;
    background-color: var(--bg-page);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

input, select, textarea, button {
    font-family: 'DM Sans', sans-serif;
    color: var(--text-dark);
}

/* ==========================================================================
   1. DateRangePicker Theming
   ========================================================================== */
.daterangepicker {
    border-radius: 14px !important;
    box-shadow: 0 12px 35px rgba(23, 29, 50, 0.15) !important;
    font-family: 'DM Sans', sans-serif !important;
    border: 1px solid var(--border-color) !important;
    padding: 8px !important;
}

.daterangepicker .ranges {
    display: none !important;
}

.daterangepicker td.in-range {
    background-color: var(--navy-pale) !important;
    color: var(--navy) !important;
}

.daterangepicker td.active,
.daterangepicker td.active:hover,
.daterangepicker td.start-date,
.daterangepicker td.end-date {
    background-color: var(--gold) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

.daterangepicker .drp-buttons .btn {
    border-radius: 8px !important;
    padding: 6px 16px !important;
    font-weight: 600 !important;
    font-size: 12.5px !important;
}

.daterangepicker .applyBtn {
    background-color: var(--gold) !important;
    border-color: var(--gold) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   2. Sidebar Layout
   ========================================================================== */
.sidebar {
    width: 240px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: 62px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #F0EDE8;
}

.sidebar-header img,
.sidebar-brand-logo {
    max-height: 38px;
    max-width: 185px;
    object-fit: contain;
}

.sidebar-menu {
    flex: 1;
    padding: 18px 12px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.sidebar-menu:hover {
    scrollbar-color: rgba(238, 128, 34, 0.25) transparent;
}

.menu-section {
    margin-bottom: 18px;
}

.menu-label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 8px;
    padding-left: 10px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-mid);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    gap: 10px;
    margin-bottom: 4px;
}

.menu-item:hover {
    background-color: var(--bg-page);
    color: var(--navy);
}

.menu-item.active {
    background: linear-gradient(90deg, #FFF7ED 0%, #FFFFFF 100%);
    color: #EA580C;
    font-weight: 700;
    border-left: 3.5px solid var(--gold);
}

.menu-item-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: #FFF7ED !important;
    color: #EA580C !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.menu-icon-dashboard,
.menu-icon-machine,
.menu-icon-parts,
.menu-icon-creation,
.menu-icon-requirement,
.menu-icon-vendor,
.menu-icon-stock,
.menu-icon-order {
    background: #FFF7ED !important;
    color: #EA580C !important;
}

.menu-item:hover .menu-item-icon {
    transform: scale(1.08);
}

.menu-item.active .menu-item-icon {
    background: var(--gold) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(238, 128, 34, 0.35);
}

.menu-item-text {
    font-size: 13.5px;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(23, 29, 50, 0.4);
    backdrop-filter: blur(3px);
    z-index: 95;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   3. Main Container & Topbar
   ========================================================================== */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
    min-width: 0;
}

.header {
    height: 62px;
    background: #ffffff;
    border-bottom: 1px solid #F0EDE8;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 50;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-toggle-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--navy);
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar-toggle-btn:hover {
    background: var(--bg-page);
}

.header-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
}

.user-nav {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    background: none;
    padding: 2px;
    border-radius: 50%;
    position: relative;
    outline: none;
}

.profile-img-container {
    position: relative;
    width: 36px;
    height: 36px;
}

.default-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #EAE6DF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px var(--gold-border);
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid #ffffff;
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 240px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(238, 128, 34, 0.15);
    box-shadow: 0 10px 30px rgba(23, 29, 50, 0.10);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.profile-dropdown.show {
    display: block;
}

.dropdown-header {
    padding: 14px 18px;
    background: #FAFAF8;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-header-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #EAE6DF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.dropdown-info {
    display: flex;
    flex-direction: column;
}

.dropdown-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-dark);
}

.dropdown-role {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
}

.dropdown-divider {
    height: 1px;
    background: #F0EDE8;
}

.dropdown-menu-list {
    list-style: none;
    padding: 6px;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mid);
    text-decoration: none;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-link:hover {
    background: var(--bg-page);
    color: var(--navy);
}

.dropdown-link.logout-btn {
    color: var(--danger);
}

.dropdown-link.logout-btn:hover {
    background: var(--danger-pale);
    color: var(--danger);
}

/* ==========================================================================
   4. Content Scroll & Common Card UI
   ========================================================================== */
.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    background: var(--bg-page);
}

.welcome-row, .welcome-section {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.welcome-row h1, .welcome-title-box h1 {
    font-family: 'DM Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.welcome-row p, .welcome-title-box p {
    font-size: 13.5px;
    color: var(--text-light);
}

.content-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    padding: 20px 22px;
    box-shadow: 0 1px 4px rgba(23, 29, 50, 0.04);
}

.card-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 14px;
    flex-wrap: wrap;
}

/* ==========================================================================
   5. Buttons System
   ========================================================================== */
.btn-action {
    height: 35px;
    padding: 0 15px;
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: none;
    background: #0F172A !important;
    color: #ffffff !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
    text-decoration: none;
    white-space: nowrap;
}

.btn-action svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.btn-action:hover {
    background: #000000 !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}

.btn-action.btn-orange {
    background: linear-gradient(135deg, #F97316 0%, #EA580C 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.24);
    border: none !important;
}

.btn-action.btn-orange:hover {
    background: linear-gradient(135deg, #EA580C 0%, #C2410C 100%) !important;
    box-shadow: 0 3px 12px rgba(234, 88, 12, 0.32);
    transform: translateY(-1px);
}

.btn-action.btn-secondary {
    background: #ffffff !important;
    border: 1.5px solid #CBD5E1 !important;
    color: #334155 !important;
    box-shadow: none;
    font-weight: 600;
    padding: 0 13px;
    font-size: 12.5px;
}

.btn-action.btn-secondary:hover {
    background: #F8FAFC !important;
    color: #0F172A !important;
    border-color: #94A3B8 !important;
}

.btn-primary {
    background: #0F172A !important;
    color: #ffffff !important;
    border: none;
    border-radius: 7px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #000000 !important;
    transform: translateY(-1px);
}

.btn-table-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    border: 1px solid #E0DDD5;
    background: #ffffff;
    color: var(--text-mid);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-table-icon:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: var(--gold-pale);
}

.btn-table-icon.btn-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-pale);
}

.btn-action-sm {
    height: 27px;
    padding: 0 8px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn-action-sm svg {
    width: 11.5px;
    height: 11.5px;
    flex-shrink: 0;
}

.btn-edit-sm {
    background: #FFFBEB !important;
    border: 1px solid #FDE68A !important;
    color: #92400E !important;
}

.btn-edit-sm:hover {
    background: #D97706 !important;
    border-color: #D97706 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(217, 119, 6, 0.22);
}

.btn-delete-sm {
    background: #FFF1F2 !important;
    border: 1px solid #FECDD3 !important;
    color: #9F1239 !important;
}

.btn-delete-sm:hover {
    background: #E11D48 !important;
    border-color: #E11D48 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(225, 29, 72, 0.22);
}

.btn-view-sm {
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    color: #1E293B !important;
}

.btn-view-sm:hover {
    background: #0F172A !important;
    border-color: #0F172A !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.22);
}

.badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 700;
    background: #F1F5F9;
    color: #334155;
    border: 1px solid #E2E8F0;
}

.badge-count-emerald {
    background: #ECFDF5 !important;
    color: #065F46 !important;
    border: 1px solid #A7F3D0 !important;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

/* Type Toggle / Segmented Pill */
.type-segmented-control {
    display: flex;
    background: #F1F0EC;
    padding: 3px;
    border-radius: 8px;
    gap: 4px;
    margin-bottom: 18px;
}

.type-segmented-btn {
    flex: 1;
    padding: 7px 14px;
    border-radius: 7px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-mid);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.type-segmented-btn.active {
    background: #ffffff;
    color: var(--navy);
    box-shadow: 0 1px 4px rgba(23, 29, 50, 0.08);
}

/* Searchable Select Filter / Dropdown */
.searchable-select-wrapper {
    position: relative;
    width: 100%;
}

.searchable-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 210px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(23, 29, 50, 0.12);
    z-index: 10002;
    display: none;
}

.searchable-select-dropdown.show {
    display: block;
}

.searchable-select-item {
    padding: 9px 13px;
    font-size: 13px;
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid #FAF9F6;
}

.searchable-select-item:hover,
.searchable-select-item.selected {
    background: var(--navy-pale);
    color: var(--navy);
}

/* Custom Filter Dropdown (Vehicle Type / Vendor / Status Popover Style) */
.custom-filter-dropdown-wrap {
    position: relative;
    display: inline-block;
}

.custom-filter-trigger {
    height: 35px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 7px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.custom-filter-trigger:hover {
    border-color: #94A3B8;
    background: #FAFAFA;
}

.custom-filter-trigger.active {
    border-color: #EA580C;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12);
}

.custom-filter-trigger.active .filter-trigger-arrow {
    transform: rotate(180deg);
}

.filter-trigger-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 230px;
}

.filter-trigger-arrow {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: #64748B;
}

.custom-filter-panel {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 220px;
    width: max-content;
    max-width: 340px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    padding: 8px;
    z-index: 10005;
    display: none;
    box-sizing: border-box;
}

.custom-filter-panel.show {
    display: block;
    animation: filterDropdownFade 0.15s ease-out;
}

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

.custom-filter-search-box {
    margin-bottom: 6px;
    position: relative;
}

.custom-filter-search-input {
    width: 100%;
    height: 34px;
    padding: 6px 10px;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    font-size: 13px;
    color: #0F172A;
    outline: none;
    background: #FFFFFF;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-filter-search-input:focus {
    border-color: #EA580C;
    box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.15);
}

.custom-filter-options-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.custom-filter-option {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1E293B;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-filter-option:hover {
    background: #F1F5F9;
    color: #0F172A;
}

.custom-filter-option.selected {
    background: #FFF7ED !important;
    color: #C2410C !important;
    font-weight: 700 !important;
}

.custom-filter-options-list::-webkit-scrollbar {
    width: 5px;
}
.custom-filter-options-list::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
.custom-filter-options-list::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Universal Dropdown Arrow Fix for All Select Elements */
select, .modal-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 14px 14px !important;
    padding-right: 34px !important;
    cursor: pointer;
}

/* View Drawer Meta Summary */
.view-meta-banner {
    background: #FAFAF8;
    border: 1px solid #EAE6DF;
    border-radius: 11px;
    padding: 14px 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.view-meta-title {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--navy);
}

.view-meta-sub {
    font-size: 12.5px;
    color: var(--text-light);
    margin-top: 2px;
}

.view-subparts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.view-subparts-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subpart-spec-pill {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    background: #F3F4F6;
    color: #4B5563;
    margin-right: 4px;
    margin-bottom: 2px;
}

.table-col-actions-wide {
    text-align: center;
    width: 200px;
}

.table-text-muted {
    color: var(--text-light);
}

.table-cell-spec {
    font-size: 12.5px;
    color: var(--text-dark);
}

/* ==========================================================================
   6. Search Bar System (Used by search-bar.blade.php)
   ========================================================================== */
.action-bar {
    width: 100%;
}

.search-form {
    display: flex;
    gap: 9px;
    flex: 1;
    align-items: center;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.search-input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    height: 35px;
    padding-left: 36px;
    padding-right: 12px;
    border: 1.5px solid #E0DDD5;
    border-radius: 7px;
    background: #FAFAF8;
    font-size: 12.5px;
    color: var(--text-dark);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(238, 128, 34, 0.12);
    background: #ffffff;
}

.btn-reset-filter {
    height: 35px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 13px;
    background: #ffffff;
    color: var(--text-mid);
    border: 1.5px solid var(--border-color);
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
}

.btn-reset-filter:hover {
    background: #FAFAF8;
    color: var(--navy);
    border-color: #D1CDC4;
    transform: translateY(-1px);
}

/* ==========================================================================
   7. Tables & Status Badges
   ========================================================================== */
.machine-table, .custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table-responsive-wrapper {
    overflow-x: auto;
    width: 100%;
}

.table-col-num {
    width: 60px;
    font-weight: 600;
    color: var(--text-light);
    font-size: 13px;
    text-align: center;
}

.table-col-status {
    width: 110px;
    text-align: center;
}

.table-col-date {
    width: 165px;
    color: var(--text-light);
    font-size: 12.5px;
}

.table-col-action {
    text-align: center;
    width: 160px;
}

.table-col-status .status-toggle-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

.table-col-action .table-actions-group,
.table-col-actions-wide .table-actions-group {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    gap: 5px !important;
}

.table-cell-desc {
    color: var(--text-mid);
    max-width: 320px;
    font-size: 13px;
}

.table-cell-date {
    color: var(--text-light);
    font-size: 12.5px;
}

.machine-table tr.no-search-results td,
.custom-table tr.no-search-results td,
.machine-table tr.no-records-row td,
.custom-table tr.no-records-row td,
.table-empty-cell {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 40px 20px !important;
    color: var(--text-light);
    width: 100% !important;
}

.table-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    margin: 0 auto;
}

.table-empty-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}

.table-empty-subtitle {
    font-size: 13px;
    margin: 0;
    color: var(--text-light);
}

.machine-table th, .custom-table th {
    padding: 13px 18px;
    background: #FAFAF8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-light);
    border-bottom: 1.5px solid #F0EDE8;
    text-align: center;
}

.machine-table td, .custom-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #F0EDE8;
    font-size: 14px;
    color: var(--text-dark);
    vertical-align: middle;
}

.machine-table tr:hover td, .custom-table tr:hover td {
    background-color: #FCFBF9;
}

.machine-name-title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14.5px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.status-badge.active {
    background: #E8F8F0;
    color: #27AE60;
}

.status-badge.inactive {
    background: #FDECEA;
    color: #E74C3C;
}

.status-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

/* Table Empty State & Search Results Centering */
.no-records-row td,
.no-search-results td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 40px 20px !important;
    width: 100% !important;
}

/* Modern Status Toggle Switch */
.status-toggle-wrapper {
    display: inline-flex;
    align-items: center;
    user-select: none;
}

.status-switch-btn {
    position: relative;
    width: 38px;
    height: 21px;
    background-color: #CBD5E1;
    border-radius: 21px;
    transition: background-color 0.25s ease;
    display: inline-block;
    vertical-align: middle;
    cursor: pointer;
    border: none;
    padding: 2px;
    outline: none;
}

.status-switch-btn::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 17px;
    height: 17px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-switch-btn.active {
    background-color: #27AE60;
}

.status-switch-btn.active::after {
    transform: translateX(17px);
}

.status-label-text {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    min-width: 48px;
}

.status-label-text.active {
    color: #27AE60;
}

.status-label-text.inactive {
    color: #E74C3C;
}

.table-actions-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

/* ==========================================================================
   8. Side Drawer Form System (Width: 50%, Slide From Right)
   ========================================================================== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(23, 29, 50, 0.45);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.show {
    opacity: 1;
    visibility: visible;
}

.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 60% !important;
    max-width: 60% !important;
    height: 100vh;
    background: #ffffff;
    z-index: 10001;
    box-shadow: -10px 0 45px rgba(23, 29, 50, 0.15);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.drawer-overlay.show .drawer-panel {
    transform: translateX(0);
}

.drawer-header {
    padding: 16px 24px;
    border-bottom: 1px solid #F0EDE8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FAFAF8;
    flex-shrink: 0;
}

.drawer-title-box {
    display: flex;
    align-items: center;
    gap: 11px;
}

.drawer-icon-container {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--gold-pale);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--navy);
}

.drawer-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    padding: 2px;
}

.drawer-close:hover {
    color: var(--danger);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden !important;
    padding: 22px 24px;
}

.drawer-footer {
    padding: 14px 24px;
    border-top: 1px solid #F0EDE8;
    background: #FAFAF8;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* ==========================================================================
   9. Modal Form Controls & Modals
   ========================================================================== */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(23, 29, 50, 0.45);
    backdrop-filter: blur(4px);
    z-index: 50000 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.custom-modal-overlay.show {
    display: flex;
}

.custom-modal-box {
    background: #ffffff;
    border-radius: 14px;
    border: 1.5px solid var(--border-color);
    width: 100%;
    max-width: 430px;
    box-shadow: 0 14px 40px rgba(23, 29, 50, 0.15);
    overflow: hidden;
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.custom-modal-header {
    padding: 15px 20px;
    background: #FAFAF8;
    border-bottom: 1px solid #F0EDE8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-modal-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-modal-icon-container {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: var(--gold-pale);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-modal-title {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--navy);
}

.custom-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
}

.custom-modal-close:hover {
    color: var(--danger);
}

.custom-modal-body {
    padding: 20px;
}

.custom-modal-footer {
    padding: 13px 20px;
    background: #FAFAF8;
    border-top: 1px solid #F0EDE8;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.modal-body-group, .modal-form-group {
    margin-bottom: 16px;
}

.modal-body-label, .modal-form-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--navy);
    margin-bottom: 6px;
}

.modal-input, .modal-form-control, .modal-select {
    width: 100%;
    height: 38px;
    padding: 9px 13px;
    border: 1.5px solid #E0DDD5;
    border-radius: 8px;
    background: #FAFAF8;
    font-size: 13.5px;
    font-family: 'DM Sans', sans-serif !important;
    color: var(--text-dark);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

textarea.modal-input,
.modal-textarea {
    height: auto !important;
    min-height: 140px !important;
    padding: 12px 14px !important;
    line-height: 1.5 !important;
    resize: vertical;
}

.modal-input:focus, .modal-form-control:focus, .modal-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(238, 128, 34, 0.12);
    background: #ffffff;
}

.modal-input-wrapper {
    position: relative;
}

.modal-eye-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    display: flex;
    align-items: center;
}

.modal-eye-toggle:hover {
    color: var(--navy);
}

/* ==========================================================================
   10. Pagination Styling
   ========================================================================== */
.custom-pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 6px 0;
    gap: 14px;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-light);
}

.pagination-info .font-semibold {
    font-weight: 700;
    color: var(--text-dark);
}

.pagination-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border-radius: 7px;
    border: 1.5px solid #EAE6DF;
    background: #ffffff;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-mid);
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-item:hover .page-link {
    border-color: var(--gold);
    color: var(--gold);
}

.page-item.active .page-link {
    background: var(--navy);
    border-color: var(--navy);
    color: #ffffff;
}

.page-item.disabled .page-link {
    opacity: 0.45;
    pointer-events: none;
    background: #FAFAF8;
}

/* ==========================================================================
   11. Login Page Styling
   ========================================================================== */
body.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

body.login-body::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    border: 1px solid rgba(238, 128, 34, 0.12);
    top: -200px;
    right: -200px;
    z-index: 1;
    pointer-events: none;
}

body.login-body::after {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    border: 1px solid rgba(23, 29, 50, 0.06);
    bottom: -150px;
    left: -150px;
    z-index: 1;
    pointer-events: none;
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    padding: 38px 34px;
    box-shadow: 0 16px 45px rgba(23, 29, 50, 0.08), 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1.5px solid var(--border-color);
    position: relative;
    z-index: 10;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.header-logo img {
    max-height: 48px;
    max-width: 240px;
    object-fit: contain;
}

.welcome-text {
    text-align: center;
    margin-bottom: 28px;
}

.welcome-text h1 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: var(--navy);
    margin-bottom: 6px;
}

.welcome-text p {
    color: var(--text-light);
    font-size: 13.5px;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-mid);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.prefix {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    border-right: 1.5px solid #E4E6EC;
    padding-right: 12px;
    height: 20px;
    display: flex;
    align-items: center;
}

.form-control {
    width: 100%;
    height: 48px;
    border: 1.5px solid #E4E6EC;
    border-radius: 14px;
    background: #FAFAF8;
    color: var(--text-dark);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    padding-left: 70px;
    padding-right: 16px;
    outline: none;
    transition: all 0.2s ease;
}

.form-control.no-prefix {
    padding-left: 16px;
    padding-right: 48px;
}

.form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(238, 128, 34, 0.12);
    background: #ffffff;
}

.eye-toggle-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s;
}

.eye-toggle-btn:hover {
    color: var(--navy);
}

.btn-submit {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #171D32 0%, #EE8022 100%);
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-family: 'DM Sans', sans-serif;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(238, 128, 34, 0.25);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
}

.btn-submit:hover {
    opacity: 0.96;
    transform: translateY(-1.5px);
    box-shadow: 0 12px 28px rgba(238, 128, 34, 0.32);
}

.error-message {
    color: var(--danger);
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

/* ==========================================================================
   12. Muchkund Dashboard Styling System
   ========================================================================== */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1400px) {
    .stats-overview-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 900px) {
    .stats-overview-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 580px) {
    .stats-overview-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   13. Modern SaaS Toast Notification System
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 28px;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
    width: auto;
}

.toast-card {
    background: #ffffff !important;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18), 0 10px 10px rgba(15, 23, 42, 0.08) !important;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(110%);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    min-width: 320px;
    max-width: 420px;
}

.custom-toast {
    background: #ffffff !important;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18), 0 10px 10px rgba(15, 23, 42, 0.08) !important;
    border: 1px solid #E2E8F0;
    border-left: 4px solid #EA580C;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    position: relative;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
}

.custom-toast.toast-error {
    border-left-color: #DC2626 !important;
}

.custom-toast.toast-success {
    border-left-color: #059669 !important;
}

.toast-card.toast-success {
    border-left: 4px solid #10B981;
}

.toast-card.toast-error {
    border-left: 4px solid #EF4444;
}

.toast-card.toast-warning {
    border-left: 4px solid #F59E0B;
}

.toast-card.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-card.hide {
    transform: translateX(110%);
    opacity: 0;
}

.toast-icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-icon-success {
    background: #ECFDF5;
    color: #059669;
}

.toast-icon-error {
    background: #FEF2F2;
    color: #DC2626;
}

.toast-icon-warning {
    background: #FFFBEB;
    color: #D97706;
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.25;
    margin-bottom: 2px;
    letter-spacing: -0.1px;
}

.toast-message {
    font-size: 12.5px;
    font-weight: 500;
    color: #475569;
    line-height: 1.4;
    word-break: break-word;
}

.toast-close-btn {
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-left: 4px;
    transition: color 0.15s ease;
}

.toast-close-btn:hover {
    color: #334155;
}

.header-actions-group {
    display: flex;
    align-items: center;
    gap: 9px;
}

.filter-bar-spacing {
    margin-bottom: 18px;
}

.pagination-spacing {
    margin-top: 20px;
}

.drawer-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.required-star {
    color: var(--danger);
}

.btn-submit-drawer {
    height: 38px;
    padding: 0 22px;
    font-size: 13.5px;
    border-radius: 8px;
}

.custom-modal-sm {
    max-width: 430px;
}

.modal-icon-danger {
    background: var(--danger-pale) !important;
    color: var(--danger) !important;
}

.modal-text-confirm {
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.modal-text-muted {
    font-size: 12.5px;
    color: var(--text-light);
    margin: 0;
}

.btn-modal-cancel {
    height: 36px !important;
    padding: 0 16px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    width: auto !important;
}

.btn-modal-delete {
    height: 36px !important;
    padding: 0 16px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    background: var(--danger) !important;
    color: #ffffff !important;
}

.btn-modal-save {
    height: 36px !important;
    padding: 0 16px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    width: auto !important;
    background: var(--navy) !important;
    color: #ffffff !important;
}

.login-error-alert {
    margin-bottom: 20px;
    max-width: 100%;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sidebar-brand-logo {
    max-height: 36px;
    max-width: 175px;
    object-fit: contain;
}

.d-none {
    display: none !important;
}

/* ==========================================================================
   14. Metric Stats Overview Grid (Modern Dashboard Theming)
   ========================================================================== */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(23, 29, 50, 0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(23, 29, 50, 0.08);
}

.stat-card-indigo {
    border-left: 4px solid #EA580C;
}

.stat-card-emerald {
    border-left: 4px solid #10B981;
}

.stat-card-slate {
    border-left: 4px solid #334155;
}

.stat-card-amber {
    border-left: 4px solid #F59E0B;
}

.stat-card-rose {
    border-left: 4px solid #EF4444;
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-indigo {
    background: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FED7AA;
}

.stat-icon-emerald {
    background: #ECFDF5;
    color: #059669;
}

.stat-icon-slate {
    background: #F1F5F9;
    color: #334155;
    border: 1px solid #E2E8F0;
}

.stat-icon-amber {
    background: #FFFBEB;
    color: #D97706;
}

.stat-icon-rose {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748B;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.2;
}

.stat-footnote {
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
}

.stat-footnote-indigo {
    color: #EA580C;
}

.stat-footnote-emerald {
    color: #059669;
}

.stat-footnote-slate {
    color: #475569;
}

.stat-footnote-amber {
    color: #D97706;
}

/* ==========================================================================
   15. Enhanced Parts Table Styling
   ========================================================================== */
.table-col-main-part {
    width: 30%;
}

.table-col-subparts {
    width: 32%;
}

.id-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 6px;
    background: #F1F5F9;
    color: #475569;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.3px;
}

.part-name-cell-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.part-avatar-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #FFF7ED;
    color: #EA580C;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(234, 88, 12, 0.12);
}

.part-meta-tag {
    font-size: 12px;
    color: #64748B;
    font-weight: 500;
    margin-top: 1px;
}

.subparts-cell-wrapper {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.subparts-badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-count-indigo,
.badge-count-orange {
    background: #FFF7ED !important;
    color: #C2410C !important;
    border: 1px solid #FED7AA !important;
    gap: 5px;
}

.badge-count-empty {
    background: #F1F5F9 !important;
    color: #64748B !important;
    border: 1px solid #E2E8F0 !important;
}

.subparts-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.subpart-tag-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 500;
    background: #F8FAFC;
    color: #334155;
    border: 1px solid #E2E8F0;
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subpart-more-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    background: #FFF7ED;
    color: #C2410C;
    border: 1px solid #FED7AA;
    cursor: pointer;
    font-family: inherit;
    line-height: normal;
    text-decoration: none;
    user-select: none;
    transition: all 0.15s ease-in-out;
}

.subpart-more-chip:hover,
.subpart-more-chip.is-expanded:hover {
    background: #FFEDD5;
    border-color: #FDBA74;
    color: #9A3412;
}

.subpart-more-chip.is-expanded {
    background: #FFF7ED;
    color: #C2410C;
    border: 1px solid #FED7AA;
}

.subparts-none-text {
    font-size: 11.5px;
    color: #94A3B8;
    font-style: italic;
}

.status-label-indicator {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
}

.status-label-indicator.active {
    color: #059669;
}

.status-label-indicator.active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
}

.status-label-indicator.inactive {
    color: #94A3B8;
}

.status-label-indicator.inactive::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94A3B8;
}

/* ==========================================================================
   15b. Existing Sub-Parts Live Preview Inside Drawer Form
   ========================================================================== */
.drawer-subparts-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1.5px dashed var(--border-color);
}

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

.drawer-subparts-section-title {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   15b. Fixed-Layout Drawer Sub-Parts System (Zero Horizontal Scrolling)
   ========================================================================== */
.drawer-body .modal-body-group {
    margin-bottom: 11px;
}

.drawer-body .modal-body-label {
    margin-bottom: 4px;
    font-size: 12.5px;
    font-weight: 600;
}

.drawer-body .modal-input {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
}

.drawer-body .form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 0;
}

.drawer-body .form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 0;
}

.subpart-btn-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn-subpart-submit {
    height: 38px !important;
    padding: 0 18px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    line-height: 1 !important;
}

.drawer-subparts-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1.5px dashed var(--border-color);
}

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

.drawer-subparts-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Zero Horizontal Scrolling Table Containers */
.drawer-table-container {
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 9px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100% !important;
    box-shadow: 0 1px 3px rgba(23, 29, 50, 0.04);
}

.drawer-subparts-table-wrapper,
.drawer-subparts-table-wrapper.drawer-table-container {
    max-height: 280px;
    overflow-x: auto !important;
    overflow-y: auto !important;
}

#viewDrawerOverlay .table-responsive-wrapper {
    max-height: 520px;
}

/* Sub-Parts Table inside Form Drawer (6 columns - fits 100% within 50% Drawer) */
.drawer-subparts-table {
    width: 100% !important;
    min-width: 520px !important;
    table-layout: fixed !important;
    border-collapse: collapse;
}

.drawer-subparts-table th {
    background: #F8FAFC;
    padding: 8px 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    color: #475569 !important;
    border-bottom: 2px solid #E2E8F0 !important;
    position: sticky;
    top: 0;
    z-index: 2;
    vertical-align: middle;
    text-align: left;
    white-space: nowrap !important;
}

.drawer-subparts-table td {
    padding: 7px 6px !important;
    border-bottom: 1px solid #F1F5F9 !important;
    font-size: 12px !important;
    color: var(--text-dark) !important;
    vertical-align: middle;
    text-align: left;
}

.drawer-subparts-table tr:hover td {
    background: #FCFBF9 !important;
}

.drawer-subparts-table th.table-col-num,
.drawer-subparts-table td.table-col-num {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
    padding: 6px 2px !important;
    text-align: center !important;
}

.drawer-subparts-table th.table-col-partno,
.drawer-subparts-table td.table-col-partno-cell {
    width: 85px !important;
    min-width: 80px !important;
    padding: 7px 6px !important;
    text-align: left !important;
    white-space: nowrap !important;
}

.drawer-subparts-table th.table-col-partname,
.drawer-subparts-table td.table-col-partname-cell {
    padding: 7px 6px !important;
    text-align: left !important;
}

.drawer-subparts-table th.table-col-rate,
.drawer-subparts-table td.table-col-rate-cell {
    width: 110px !important;
    min-width: 100px !important;
    max-width: 120px !important;
    padding: 7px 6px !important;
    text-align: left !important;
    white-space: nowrap !important;
}

.drawer-subparts-table th.table-col-specs,
.drawer-subparts-table td.table-col-specs-cell {
    width: 215px !important;
    min-width: 195px !important;
    max-width: 225px !important;
    padding: 7px 8px !important;
    text-align: left !important;
}

.drawer-subparts-table .specs-wrap-cell {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
}

.drawer-subparts-table th.table-col-action-sub,
.drawer-subparts-table td.table-col-action-cell {
    width: 125px !important;
    min-width: 120px !important;
    max-width: 130px !important;
    padding: 7px 4px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.drawer-subparts-table .table-actions-group {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

.drawer-subparts-table .btn-action-sm {
    height: 25px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    flex-shrink: 0 !important;
}

.drawer-subparts-table .btn-edit-sm {
    background: #FFFBEB !important;
    border: 1px solid #FCD34D !important;
    color: #B45309 !important;
}

.drawer-subparts-table .btn-edit-sm:hover {
    background: #F59E0B !important;
    border-color: #F59E0B !important;
    color: #ffffff !important;
}

.drawer-subparts-table .btn-delete-sm {
    background: #FFF1F2 !important;
    border: 1px solid #FECDD3 !important;
    color: #BE123C !important;
}

.drawer-subparts-table .btn-delete-sm:hover {
    background: #E11D48 !important;
    border-color: #E11D48 !important;
    color: #ffffff !important;
}

.drawer-subparts-table .machine-name-title {
    font-size: 12.5px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: #0F172A !important;
    word-break: break-word;
}

.drawer-subparts-table .table-col-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 2px 5px !important;
    border-radius: 4px !important;
    display: inline-block;
    color: #334155 !important;
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    white-space: nowrap !important;
}

.drawer-subparts-table .rate-val {
    font-size: 12.5px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    line-height: 1.25 !important;
}

.drawer-subparts-table .wt-val {
    font-size: 10.5px !important;
    color: #64748B !important;
    margin-top: 1px !important;
    font-weight: 500 !important;
}

.drawer-subparts-table .spec-tag {
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 2.5px 7px !important;
    border-radius: 4px !important;
    background: #F1F5F9 !important;
    color: #0F172A !important;
    border: 1px solid #CBD5E1 !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1.3 !important;
}

.drawer-subparts-table .spec-tag strong {
    font-weight: 800 !important;
    font-size: 11.5px !important;
    color: #EA580C !important;
    margin-right: 2px !important;
}

/* Table inside View Drawer (10 columns, wide view) */
#viewDrawerPanel .drawer-fixed-table,
.drawer-fixed-table {
    width: 100% !important;
    min-width: 850px !important;
    table-layout: auto !important;
    border-collapse: collapse;
}

.drawer-fixed-table th {
    background: #F8FAFC;
    padding: 10px 8px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    color: #475569 !important;
    border-bottom: 2px solid #E2E8F0 !important;
    position: sticky;
    top: 0;
    z-index: 2;
    vertical-align: middle;
    text-align: left;
    white-space: nowrap !important;
}

.drawer-fixed-table td {
    padding: 9px 8px !important;
    border-bottom: 1px solid #F1F5F9 !important;
    font-size: 12.5px !important;
    color: var(--text-dark) !important;
    vertical-align: middle;
    text-align: left;
}

.drawer-fixed-table tr:last-child td {
    border-bottom: none !important;
}

.drawer-fixed-table tr:hover td {
    background: #FCFBF9 !important;
}

/* ID Column: Strict width, centered, NEVER truncate */
.drawer-fixed-table th.table-col-num,
.drawer-fixed-table td.table-col-num {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    padding: 8px 2px !important;
    text-align: center !important;
    overflow: visible !important;
}

.drawer-fixed-table .id-badge {
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    background: #F1F5F9 !important;
    color: #475569 !important;
    border: 1px solid #CBD5E1 !important;
    display: inline-block !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

/* Part Name Column */
.drawer-fixed-table th.table-col-partname,
.drawer-fixed-table td.table-col-partname-cell {
    min-width: 140px !important;
    padding: 9px 8px !important;
    text-align: left !important;
}

.drawer-fixed-table .machine-name-title {
    font-size: 13px !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    color: #0F172A !important;
    word-break: break-word;
}

/* Part Number Column */
.drawer-fixed-table th.table-col-partno,
.drawer-fixed-table td.table-col-partno-cell {
    width: 120px !important;
    min-width: 100px !important;
    padding: 9px 8px !important;
    text-align: left !important;
    white-space: nowrap !important;
}

.drawer-fixed-table .table-col-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    padding: 2.5px 6px !important;
    border-radius: 4px !important;
    display: inline-block;
    color: #334155 !important;
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    white-space: nowrap !important;
    letter-spacing: 0.2px;
}

/* Rate Column */
.drawer-fixed-table th.table-col-rate,
.drawer-fixed-table td.table-col-rate-cell {
    width: 90px !important;
    min-width: 80px !important;
    padding: 9px 8px !important;
    text-align: left !important;
    white-space: nowrap !important;
}

/* Weight Column */
.drawer-fixed-table th.table-col-weight,
.drawer-fixed-table td.table-col-weight-cell {
    width: 85px !important;
    min-width: 80px !important;
    padding: 9px 8px !important;
    text-align: left !important;
    white-space: nowrap !important;
}

/* Spec Columns: Boring, Planning, Machining */
.drawer-fixed-table th.table-col-boring,
.drawer-fixed-table td.table-col-boring-cell,
.drawer-fixed-table th.table-col-planning,
.drawer-fixed-table td.table-col-planning-cell,
.drawer-fixed-table th.table-col-machining,
.drawer-fixed-table td.table-col-machining-cell {
    width: 95px !important;
    min-width: 85px !important;
    padding: 9px 8px !important;
    text-align: left !important;
    white-space: nowrap !important;
}

.drawer-fixed-table .rate-val {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    line-height: 1.25 !important;
}

.drawer-fixed-table .wt-val {
    font-size: 11px !important;
    color: #64748B !important;
    margin-top: 2px !important;
    font-weight: 500 !important;
}

.drawer-fixed-table .val-muted-label {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #94A3B8 !important;
}

/* Specifications Column */
.drawer-fixed-table th.table-col-specs,
.drawer-fixed-table td.table-col-specs-cell {
    width: 120px !important;
    min-width: 110px !important;
    padding: 9px 8px !important;
    text-align: left !important;
}

.drawer-fixed-table .specs-wrap-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
}

.drawer-fixed-table .spec-tag {
    font-size: 10.5px !important;
    font-weight: 600 !important;
    padding: 2px 5px !important;
    border-radius: 4px !important;
    background: #F8FAFC !important;
    color: #334155 !important;
    border: 1px solid #E2E8F0 !important;
    white-space: nowrap !important;
    display: inline-block;
    line-height: 1.2;
}

.drawer-fixed-table .spec-tag strong {
    font-weight: 700 !important;
    color: #EA580C !important;
}

/* Status Column: Strict width, centered, NEVER truncate */
.drawer-fixed-table th.table-col-status,
.drawer-fixed-table td.table-col-status-cell {
    width: 75px !important;
    min-width: 75px !important;
    max-width: 75px !important;
    text-align: center !important;
    padding: 9px 4px !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

.drawer-fixed-table .status-toggle-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.drawer-fixed-table .status-switch-btn {
    width: 32px !important;
    height: 18px !important;
    border-radius: 18px !important;
    padding: 2px !important;
    flex-shrink: 0;
}

.drawer-fixed-table .status-switch-btn::after {
    width: 14px !important;
    height: 14px !important;
    top: 2px !important;
    left: 2px !important;
}

.drawer-fixed-table .status-switch-btn.active::after {
    transform: translateX(14px) !important;
}

/* Action Column: Strict width, centered, NEVER truncate */
.drawer-fixed-table th.table-col-action,
.drawer-fixed-table td.table-col-action-cell {
    width: 145px !important;
    min-width: 140px !important;
    max-width: 150px !important;
    text-align: center !important;
    padding: 9px 8px !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

.drawer-fixed-table th.table-col-action-sub,
.drawer-fixed-table td.table-col-action-sub-cell {
    width: 145px !important;
    min-width: 140px !important;
    max-width: 150px !important;
    text-align: center !important;
    padding: 9px 8px !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

.drawer-fixed-table .table-actions-group {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

.drawer-fixed-table .btn-action-sm {
    height: 27px !important;
    padding: 0 7px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border-radius: 5px !important;
    gap: 3.5px !important;
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.drawer-fixed-table .btn-action-sm svg {
    width: 12px !important;
    height: 12px !important;
    flex-shrink: 0;
}

/* Crisp button themes */
.drawer-fixed-table .btn-edit-sm {
    background: #FFFBEB !important;
    border: 1px solid #FCD34D !important;
    color: #B45309 !important;
}

.drawer-fixed-table .btn-edit-sm:hover {
    background: #F59E0B !important;
    border-color: #F59E0B !important;
    color: #ffffff !important;
}

.drawer-fixed-table .btn-delete-sm {
    background: #FFF1F2 !important;
    border: 1px solid #FECDD3 !important;
    color: #BE123C !important;
}

.drawer-fixed-table .btn-delete-sm:hover {
    background: #E11D48 !important;
    border-color: #E11D48 !important;
    color: #ffffff !important;
}

.drawer-fixed-table .btn-view-sm {
    background: #ECFDF5 !important;
    border: 1px solid #A7F3D0 !important;
    color: #059669 !important;
}

.drawer-fixed-table .btn-view-sm:hover {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

.drawer-subparts-empty {
    padding: 22px 12px;
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
}

.table-col-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    background: #F1F5F9;
    padding: 2.5px 7px;
    border-radius: 5px;
    border: 1px solid #E2E8F0;
    display: inline-block;
    letter-spacing: 0.3px;
}

.table-num-val {
    font-weight: 600;
    color: #1E293B;
    font-size: 13px;
}

.table-spec-val {
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    background: #F8FAFC;
    padding: 2.5px 7px;
    border-radius: 5px;
    border: 1px solid #E2E8F0;
    display: inline-block;
}

.btn-cancel-inline-edit {
    height: 38px !important;
    padding: 0 16px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer;
    background: #FFFFFF !important;
    border: 1.5px solid #CBD5E1 !important;
    color: #475569 !important;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    white-space: nowrap !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

.btn-cancel-inline-edit.d-none {
    display: none !important;
}

.btn-cancel-inline-edit svg {
    flex-shrink: 0;
    color: #64748B;
    transition: color 0.2s ease;
}

.btn-cancel-inline-edit:hover {
    background: #FFF1F2 !important;
    border-color: #FECDD3 !important;
    color: #BE123C !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(190, 18, 60, 0.15);
}

.btn-cancel-inline-edit:hover svg {
    color: #BE123C;
}

.table-col-action-sub {
    width: 130px;
    text-align: right;
}

/* ==========================================================================
   16. Full Responsive Media Queries
   ========================================================================== */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(23, 29, 50, 0.15);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle-btn {
        display: flex;
    }

    .drawer-panel {
        width: 75% !important;
        max-width: 75% !important;
    }

    .stats-overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .content-scroll {
        padding: 20px 16px;
    }

    .header {
        padding: 0 16px;
    }

    .drawer-panel {
        width: 100% !important;
        max-width: 100% !important;
    }

    .card-header-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-wrapper {
        max-width: 100%;
    }

    .welcome-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   16. Machine Creation Styles (Clean & Simple 60% Form Layout)
   ========================================================================== */
.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 60% !important;
    max-width: 60% !important;
    min-width: 60% !important;
    height: 100vh;
    background: #ffffff;
    z-index: 10001;
    box-shadow: -10px 0 45px rgba(23, 29, 50, 0.15);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.drawer-overlay.show .drawer-panel {
    transform: translateX(0);
}

/* Parts Selection Container */
.parts-checklist-container {
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #FFFFFF;
    max-height: 480px;
    overflow-y: auto;
    padding: 6px 16px;
}

.main-part-block {
    padding: 12px 0;
    border-bottom: 1px solid #F1F5F9;
}

.main-part-block:last-child {
    border-bottom: none;
}

.main-part-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 36px;
}

.part-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
    color: #1E293B;
    margin: 0;
    flex: 1;
}

.part-checkbox-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #EA580C;
    cursor: pointer;
    margin: 0;
}

.inline-qty-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    height: 30px;
}

.inline-field-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748B;
}

.inline-qty-input {
    width: 60px !important;
    height: 30px !important;
    padding: 2px 6px !important;
    font-size: 13px !important;
    text-align: center;
    border: 1px solid #CBD5E1 !important;
    border-radius: 6px !important;
    background: #FFFFFF !important;
    color: #1E293B;
}

.inline-qty-input:focus,
.inline-unit-select:focus {
    border-color: #EA580C !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.15) !important;
}

.sub-parts-container {
    margin-left: 27px;
    margin-top: 6px;
    padding-left: 14px;
    border-left: 2px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sub-part-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 34px;
    padding: 0;
    box-sizing: border-box;
}

.sub-part-label {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #334155 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.sub-part-number-text {
    font-size: 11.5px;
    color: #64748B;
    font-weight: 400;
    margin-left: 4px;
}

.inline-sub-boxes {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    height: 30px;
}

.inline-field-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.inline-unit-select {
    width: 76px !important;
    height: 30px !important;
    padding: 2px 6px !important;
    font-size: 12.5px !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 6px !important;
    background: #FFFFFF !important;
    color: #1E293B;
    cursor: pointer;
}

.no-subparts-note {
    font-size: 12px;
    color: #94A3B8;
    font-style: italic;
    padding: 2px 0;
}

#viewCreationDrawerPanel,
#creationDrawerPanel {
    width: 50% !important;
    max-width: 50% !important;
    min-width: 50% !important;
}

/* =========================================================================
   Machine Creation Details Drawer (Small Text UI)
   ========================================================================= */

#viewCreationDrawerPanel .drawer-header {
    padding: 12px 20px;
}

#viewCreationDrawerPanel .drawer-title {
    font-size: 15px;
}

#viewCreationDrawerPanel .drawer-icon-container {
    width: 32px;
    height: 32px;
}

#viewCreationDrawerPanel .drawer-icon-container svg {
    width: 16px;
    height: 16px;
}

/* Overview Summary Card */
.view-detail-overview-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 9px;
    padding: 13px 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.view-detail-overview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 11px;
    border-bottom: 1px solid #F1F5F9;
}

.view-detail-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-detail-machine-icon {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    background: #FFF7ED;
    color: #EA580C;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #FFEDD5;
}

.view-detail-machine-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.25;
}

.view-detail-machine-sub {
    font-size: 11.5px;
    color: #64748B;
    margin-top: 2px;
    font-weight: 500;
}

#viewCreationDrawerPanel .status-badge {
    font-size: 11px !important;
    padding: 2px 7px !important;
}

.view-detail-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 11px;
}

.view-stat-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 7px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-stat-icon-wrap {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-indigo {
    background: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FED7AA;
}

.stat-icon-orange {
    background: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FFEDD5;
}

.view-stat-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.view-stat-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748B;
    letter-spacing: 0.2px;
}

.view-stat-number {
    font-size: 14.5px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1.2;
}

/* Section Header */
.view-section-header-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-top: 2px;
}

.view-section-title-box {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #0F172A;
}

.view-section-title-box svg {
    color: #64748B;
}

.view-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: 0.2px;
}

/* Assembly Main Parts List */
.view-assembly-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.view-assembly-main-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.view-assembly-main-header {
    background: #F8FAFC;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #E2E8F0;
    gap: 10px;
}

.view-assembly-main-title {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.view-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 4px;
    background: #FFF7ED;
    color: #EA580C;
    font-weight: 700;
    font-size: 11px;
    border: 1px solid #FED7AA;
    flex-shrink: 0;
}

.view-main-name-text {
    font-size: 12.5px;
    font-weight: 700;
    color: #0F172A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.view-assembly-header-badges {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.view-assembly-main-qty-badge {
    background: #FFF7ED;
    color: #C2410C;
    border: 1px solid #FFEDD5;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}

.view-assembly-subcount-badge {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #E2E8F0;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}

/* Sub-Parts Table Inside View Drawer */
.view-subparts-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.view-subparts-table {
    width: 100%;
    border-collapse: collapse;
}

.view-subparts-table th {
    background: #FAFAF8;
    color: #64748B;
    font-weight: 700;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 7px 12px;
    border-bottom: 1px solid #E2E8F0;
    text-align: left;
}

.view-subparts-table th.text-center,
.view-subparts-table td.text-center {
    text-align: center;
}

.view-subparts-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #F1F5F9;
    color: #1E293B;
    vertical-align: middle;
}

.view-subparts-table tr:last-child td {
    border-bottom: none;
}

.view-subparts-table tr:hover td {
    background: #FAFAFA;
}

.view-subpart-id-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    border-radius: 4px;
    background: #F8FAFC;
    color: #64748B;
    font-weight: 700;
    font-size: 10px;
    border: 1px solid #E2E8F0;
}

.view-subpart-name-text {
    font-size: 12px;
    font-weight: 600;
    color: #1E293B;
    display: block;
}

.view-subpart-badge-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    background: #F8FAFC;
    color: #0F172A;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11.5px;
    border: 1px solid #E2E8F0;
}

.view-subpart-badge-unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.view-subparts-empty-state {
    padding: 10px 14px;
    font-size: 11.5px;
    color: #94A3B8;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #FAFAFA;
}

/* ==========================================================================
   19. Vendor Management Module Styling
   ========================================================================== */
.vendor-avatar-cell {
    width: 60px;
    text-align: center;
}

.vendor-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #E2E8F0;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.vendor-avatar-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #FFF7ED;
    border: 1.5px solid #FFEDD5;
    color: #EA580C;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    vertical-align: middle;
    text-transform: uppercase;
}

.vendor-upload-container {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #F8FAFC;
    border: 1.5px dashed #CBD5E1;
    border-radius: 10px;
    margin-bottom: 6px;
}

.vendor-preview-box {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #ffffff;
    border: 2px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.vendor-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vendor-preview-placeholder {
    color: #94A3B8;
}

.vendor-upload-controls {
    flex: 1;
}

.vendor-upload-btn-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #ffffff;
    border: 1px solid #CBD5E1;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vendor-upload-btn-label:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
    color: #0F172A;
}

.vendor-upload-hint {
    font-size: 11.5px;
    color: #64748B;
    margin-top: 5px;
}

/* Inline Form Field Error States */
.modal-input.is-invalid {
    border-color: #EF4444 !important;
    background-color: #FEF2F2 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.modal-input.is-invalid:focus {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2) !important;
}

.field-error-message {
    display: none;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #DC2626;
    margin-top: 5px;
    font-weight: 500;
    line-height: 1.3;
}

.field-error-message.show {
    display: flex;
}

/* ==========================================================================
   20. Stock Management & Movement History Styling
   ========================================================================== */
.stock-qty-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.stock-qty-badge.in-stock {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.stock-qty-badge.zero-stock {
    background: #FFFBEB;
    color: #D97706;
    border: 1px solid #FDE68A;
}

.stock-pending-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.stock-pending-badge.has-pending {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #93C5FD;
}

.stock-pending-badge.zero-pending {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

.stock-min-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    background: #FAF5FF;
    color: #7E22CE;
    border: 1px solid #DDD6FE;
}

.stock-movement-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.stock-movement-in {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.stock-movement-out {
    background: #FFF1F2;
    color: #E11D48;
    border: 1px solid #FECDD3;
}

.stock-summary-card {
    background: #FAFAF8;
    border: 1px solid #EAE6DF;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.stock-summary-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}

.stock-summary-subtitle {
    font-size: 12.5px;
    color: var(--text-light);
}

.stock-history-user-cell {
    display: flex;
    align-items: center;
    gap: 9px;
}

.stock-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.stock-user-phone {
    font-size: 11.5px;
    color: #64748B;
}

.badge-subpart-parent {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    color: #64748B;
    background: #F1F5F9;
    padding: 1.5px 6px;
    border-radius: 4px;
    margin-top: 3px;
}

.table-col-stock-status {
    width: 140px !important;
    min-width: 130px !important;
}

.stock-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap !important;
    line-height: 1.4;
}

.stock-status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.stock-status-badge.in-stock {
    background: #ECFDF5 !important;
    color: #059669 !important;
    border: 1px solid #A7F3D0 !important;
}

.stock-status-badge.out-of-stock {
    background: #FFF1F2 !important;
    color: #E11D48 !important;
    border: 1px solid #FECDD3 !important;
}

.view-stat-icon-wrap.stat-icon-emerald {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.view-stat-icon-wrap.stat-icon-rose {
    background: #FFF1F2;
    color: #E11D48;
    border: 1px solid #FECDD3;
}

.view-stat-icon-wrap.stat-icon-amber {
    background: #FFFBEB;
    color: #D97706;
    border: 1px solid #FDE68A;
}

.stock-empty-history-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 10px;
}

.stock-empty-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FFEDD5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stock-empty-title {
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 5px;
}

.stock-empty-desc {
    font-size: 12px;
    color: #64748B;
    max-width: 380px;
    line-height: 1.5;
}

.stock-user-name-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.stock-user-avatar-tiny {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FFEDD5;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stock-history-qty {
    font-size: 13.5px;
    font-weight: 700;
    white-space: nowrap;
}

.stock-history-qty.qty-in {
    color: #059669;
}

.stock-history-qty.qty-out {
    color: #E11D48;
}

.stock-history-date-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #475569;
    white-space: nowrap;
}

.stock-history-date-cell svg {
    color: #94A3B8;
    flex-shrink: 0;
}

/* ==========================================================================
   21. Order Management & Receiving Styling
   ========================================================================== */
.table-col-action-orders {
    min-width: 250px !important;
    text-align: center;
}

.btn-view-indigo-sm,
.btn-view-slate-sm {
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    color: #1E293B !important;
}

.btn-view-indigo-sm:hover,
.btn-view-slate-sm:hover {
    background: #0F172A !important;
    border-color: #0F172A !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.22);
}

.btn-orange-sm {
    background: #F1F5F9 !important;
    border: 1px solid #CBD5E1 !important;
    color: #1E293B !important;
}

.btn-orange-sm:hover {
    background: #0F172A !important;
    border-color: #0F172A !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(15, 23, 42, 0.22);
}

.btn-receive-sm {
    background: #ECFDF5 !important;
    border: 1px solid #A7F3D0 !important;
    color: #065F46 !important;
}

.btn-receive-sm:hover {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(5, 150, 105, 0.22);
}

.order-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap !important;
    line-height: 1.4;
}

.order-status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.order-status-badge.given {
    background: #F8FAFC !important;
    color: #475569 !important;
    border: 1px solid #E2E8F0 !important;
}

.order-status-badge.partially_received,
.order-status-badge.partial {
    background: #FFFBEB !important;
    color: #D97706 !important;
    border: 1px solid #FDE68A !important;
}

.order-status-badge.completed {
    background: #ECFDF5 !important;
    color: #059669 !important;
    border: 1px solid #A7F3D0 !important;
}

/* Order Item Repeater Row in Form */
.order-item-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    position: relative;
    transition: all 0.2s ease;
}

.order-item-card:hover {
    border-color: #CBD5E1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.order-item-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.order-summary-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
}

.order-summary-fixed {
    margin: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-top: 1px solid #E2E8F0 !important;
    background: #F8FAFC !important;
    padding: 10px 18px !important;
    box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.04) !important;
    flex-shrink: 0 !important;
    z-index: 10;
    display: grid !important;
    grid-template-columns: 1fr 1fr 1.35fr !important;
    gap: 10px !important;
    align-items: stretch !important;
}

.summary-metric-tile {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.summary-metric-icon {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-metric-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #64748B;
    text-transform: uppercase;
}

.summary-metric-val {
    font-size: 15px;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.2;
}

.summary-metric-tile-highlight {
    background: #FFF7ED;
    border: 1px solid #FED7AA;
}

.summary-metric-icon-highlight {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    background: #FFEDD5;
    border: 1px solid #FDBA74;
    color: #EA580C;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.summary-metric-label-highlight {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #C2410C;
    text-transform: uppercase;
}

.summary-metric-val-amount {
    color: #EA580C;
    font-size: 16px;
    font-weight: 800;
}

.table-col-action-sub,
.table-col-action-sub-cell {
    width: 140px !important;
    min-width: 140px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.drawer-fixed-table {
    width: 100% !important;
    table-layout: fixed !important;
}

/* Dedicated Receive Sub-parts Table (Auto Layout, Never Truncates) */
.receive-items-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
    border-collapse: collapse;
}

.receive-items-table th {
    background: #F8FAFC !important;
    padding: 10px 12px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #475569 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #E2E8F0 !important;
    vertical-align: middle;
}

.receive-items-table td {
    padding: 12px !important;
    border-bottom: 1px solid #F1F5F9 !important;
    font-size: 13px !important;
    vertical-align: middle;
}

.receive-items-table tr:hover td {
    background: #F8FAFC !important;
}

input[type="date"] {
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

.order-summary-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
}

.order-summary-val {
    font-size: 15px;
    font-weight: 700;
    color: #0F172A;
}

.order-receive-row {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr;
    gap: 12px;
    align-items: center;
}

/* ==========================================================================
   22. Vendor Order History Drawer Styling
   ========================================================================== */
.table-col-action-vendor {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 260px !important;
    text-align: center;
}

.badge-main-part {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.badge-pending-qty {
    display: inline-block;
    padding: 2px 8px;
    background: #FFF1F2;
    border: 1px solid #FECDD3;
    color: #E11D48;
    border-radius: 12px;
    font-weight: 700;
    font-size: 11.5px;
    white-space: nowrap;
}

.badge-completed-qty {
    display: inline-block;
    padding: 2px 8px;
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #059669;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11.5px;
    white-space: nowrap;
}

.vorder-filter-btn {
    padding: 4px 12px;
    border-radius: 18px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #CBD5E1;
    background: #FFFFFF;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.vorder-filter-btn:hover {
    background: #F8FAFC;
    color: #0F172A;
}

.vorder-filter-btn.active {
    background: #0F172A;
    border-color: #0F172A;
    color: #FFFFFF;
}

.vorder-filter-btn.active .vorder-tab-badge {
    background: #334155;
    color: #F8FAFC;
}

.vorder-tab-badge {
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    background: #F1F5F9;
    color: #475569;
}

.vorder-tab-badge-pending {
    background: #FEE2E2;
    color: #DC2626;
}

.vorder-alert-box {
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 500;
    margin-top: 12px;
}

.vorder-alert-warning {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    color: #92400E;
}

.vorder-alert-success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
}

/* ==========================================================================
   21. Main Parts & Sub Parts Hierarchical Table System & Badges
   ========================================================================== */
.badge-part-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-part-type .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-type-main {
    background: #FFF7ED;
    color: #EA580C;
    border: 1px solid #FED7AA;
}

.badge-type-main .badge-dot {
    background: #EA580C;
}

.badge-type-sub {
    background: #FAF5FF;
    color: #7E22CE;
    border: 1px solid #DDD6FE;
}

.badge-type-sub .badge-dot {
    background: #7E22CE;
}

.flat-part-row {
    background: #FFFFFF;
    transition: background-color 0.15s ease;
}

.flat-part-row:hover {
    background: #F8FAFC;
}

.parent-part-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #F8FAFC;
    color: #475569;
    border: 1px solid #E2E8F0;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
}

.rate-cell-val {
    color: #059669;
    font-weight: 700;
    font-size: 13px;
}

.weight-cell-val {
    color: #334155;
    font-weight: 600;
    font-size: 12.5px;
}

.min-stock-badge-cell {
    display: inline-block;
    background: #FAF5FF;
    color: #7E22CE;
    border: 1px solid #DDD6FE;
    font-weight: 700;
    font-size: 11.5px;
    padding: 2px 8px;
    border-radius: 6px;
    line-height: 1.3;
}

.part-number-code {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 600;
    color: #475569;
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #E2E8F0;
    letter-spacing: 0.3px;
}

.table-cell-spec {
    font-size: 12px;
    font-weight: 500;
    color: #334155;
    background: #F8FAFC;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #E2E8F0;
    display: inline-block;
    white-space: nowrap;
}

/* High-contrast, clear Min Stock indicator */
.min-stock-sub-hint,
.min-stock-val {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #1E293B !important;
    margin-top: 3px !important;
    line-height: 1.35 !important;
}

.min-stock-sub-hint .min-stock-label,
.min-stock-val .min-stock-label {
    color: #334155 !important;
    font-weight: 600 !important;
}

.min-stock-sub-hint .min-stock-num,
.min-stock-val .min-stock-num {
    color: #0F172A !important;
    font-weight: 700 !important;
}

/* ==========================================================================
   Expanded View Drawer for Main Part Details (Spacious Responsive Width)
   ========================================================================== */
#viewDrawerOverlay #viewDrawerPanel,
#viewDrawerPanel {
    width: 70% !important;
    max-width: 70% !important;
    min-width: 70% !important;
}

#viewDrawerOverlay .table-responsive-wrapper {
    max-height: calc(100vh - 210px) !important;
    overflow-x: auto !important;
}

@media (max-width: 1200px) {
    #viewDrawerOverlay #viewDrawerPanel,
    #viewDrawerPanel {
        width: 92% !important;
        max-width: 92% !important;
        min-width: 92% !important;
    }
}

@media (max-width: 768px) {
    #viewDrawerOverlay #viewDrawerPanel,
    #viewDrawerPanel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }
}

/* ==========================================================================
   Parts Add/Edit Form Drawer (65% Desktop Width)
   ========================================================================== */
#partsDrawerOverlay #partsDrawerPanel,
#partsDrawerPanel {
    width: 65% !important;
    max-width: 65% !important;
    min-width: 65% !important;
}

@media (max-width: 1200px) {
    #partsDrawerOverlay #partsDrawerPanel,
    #partsDrawerPanel {
        width: 75% !important;
        max-width: 75% !important;
        min-width: 75% !important;
    }
}

@media (max-width: 768px) {
    #partsDrawerOverlay #partsDrawerPanel,
    #partsDrawerPanel {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }
}


