
        /* ─── RESET & BASE ─── */
        *,
        *::before,
        *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }
        :root {
            --navy: #0b1a33;
            --navy-light: #1a2d4a;
            --accent: #2a8bf2;
            --accent-hover: #1a6fd0;
            --accent-light: #e8f0fe;
            --green: #0f9d58;
            --green-light: #e6f7ed;
            --red: #d93025;
            --red-light: #fce8e6;
            --orange: #f9ab00;
            --orange-light: #fef7e0;
            --purple: #7c3aed;
            --purple-light: #ede9fe;
            --teal: #0d9488;
            --teal-light: #ccfbf1;
            --gray: #5f6368;
            --gray-light: #f1f3f4;
            --gray-border: #dadce0;
            --white: #ffffff;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.10);
            --radius: 10px;
            --sidebar-width: 250px;
            --header-height: 60px;
            --transition: 0.25s ease;
            --font: 'Inter', Arial, Helvetica, sans-serif;
        }
        html,
        body {
            height: 100%;
            font-family: var(--font);
            font-size: 14px;
            color: #1e293b;
            background: #f1f5f9;
        }
        a {
            text-decoration: none;
            color: inherit;
        }
        button {
            cursor: pointer;
            font-family: inherit;
            font-size: inherit;
            border: none;
            background: none;
        }
        input,
        select,
        textarea {
            font-family: inherit;
            font-size: inherit;
        }
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        ::-webkit-scrollbar-track {
            background: #e9edf2;
        }
        ::-webkit-scrollbar-thumb {
            background: #b0b8c5;
            border-radius: 6px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: #8f9aaa;
        }

        /* ─── LAYOUT ─── */
        .app {
            display: flex;
            min-height: 100vh;
        }

        /* ─── SIDEBAR ─── */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--navy);
            color: #cfdbe9;
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            display: flex;
            flex-direction: column;
            z-index: 1000;
            transition: transform var(--transition);
            overflow-y: auto;
            overflow-x: hidden;
        }
        .sidebar-brand {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 18px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            font-weight: 700;
            font-size: 16px;
            color: #fff;
            min-height: var(--header-height);
        }
        .sidebar-brand i {
            font-size: 24px;
            color: var(--accent);
        }
        .sidebar-brand span {
            letter-spacing: -0.3px;
        }
        .sidebar-nav {
            flex: 1;
            padding: 12px 0 20px 0;
        }
        .sidebar-nav .nav-label {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #6a7f9e;
            padding: 12px 20px 6px 20px;
            font-weight: 600;
        }
        .sidebar-nav a {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 20px;
            color: #b0c4dd;
            transition: var(--transition);
            border-left: 3px solid transparent;
            font-weight: 500;
        }
        .sidebar-nav a i {
            width: 20px;
            text-align: center;
            font-size: 15px;
        }
        .sidebar-nav a:hover {
            background: rgba(255, 255, 255, 0.05);
            color: #fff;
        }
        .sidebar-nav a.active {
            background: rgba(42, 139, 242, 0.15);
            color: #fff;
            border-left-color: var(--accent);
        }
        .sidebar-footer {
            padding: 16px 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            font-size: 12px;
            color: #6a7f9e;
        }

        /* ─── MAIN ─── */
        .main {
            margin-left: var(--sidebar-width);
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            min-width: 0;
            max-width: 100%;
        }
        .page-content {
            padding: 24px;
            flex: 1;
            min-width: 0;
        }

        /* ─── TOPBAR ─── */
        .topbar {
            height: var(--header-height);
            background: var(--white);
            border-bottom: 1px solid var(--gray-border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 24px;
            position: sticky;
            top: 0;
            z-index: 500;
            background: rgba(255, 255, 255, 0.92);
            backdrop-filter: blur(6px);
        }
        .topbar-left {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        .topbar-left .menu-toggle {
            display: none;
            font-size: 20px;
            color: var(--gray);
        }
        .topbar-left .page-title {
            font-weight: 600;
            font-size: 18px;
            color: #0b1a33;
        }
        .topbar-right {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        .topbar-right .badge-icon {
            position: relative;
            font-size: 18px;
            color: var(--gray);
            transition: var(--transition);
        }
        .topbar-right .badge-icon:hover {
            color: var(--navy);
        }
        .topbar-right .badge-icon .count {
            position: absolute;
            top: -6px;
            right: -8px;
            background: var(--red);
            color: #fff;
            font-size: 10px;
            font-weight: 700;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .topbar-right .user-info {
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 500;
        }
        .topbar-right .user-info .avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--accent);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 16px;
        }

        /* ─── PAGE CONTENT ─── */
        .page-content {
            padding: 28px 32px;
            flex: 1;
        }
        .page-section {
            display: none;
            animation: fadeUp 0.35s ease;
        }
        .page-section.active {
            display: block;
        }
        @keyframes fadeUp {
            0% {
                opacity: 0;
                transform: translateY(16px);
            }
            100% {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* ─── CARDS ─── */
        .card {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            border: 1px solid var(--gray-border);
            transition: var(--transition);
        }
        .card:hover {
            box-shadow: var(--shadow-lg);
        }
        .card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            font-weight: 600;
            font-size: 15px;
            color: #0b1a33;
            border-bottom: 1px solid var(--gray-border);
        }
        .card-header .sub {
            font-weight: 400;
            font-size: 13px;
            color: var(--gray);
        }
        .card-body {
            padding: 20px;
        }

        /* ─── BUTTONS ─── */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 18px;
            border-radius: 6px;
            font-weight: 500;
            font-size: 13px;
            transition: var(--transition);
            border: 1px solid transparent;
            white-space: nowrap;
        }
        .btn-primary {
            background: var(--accent);
            color: #fff;
        }
        .btn-primary:hover {
            background: var(--accent-hover);
        }
        .btn-success {
            background: var(--green);
            color: #fff;
        }
        .btn-success:hover {
            background: #0b7e48;
        }
        .btn-danger {
            background: var(--red);
            color: #fff;
        }
        .btn-danger:hover {
            background: #b71c1c;
        }
        .btn-outline {
            background: transparent;
            border-color: var(--gray-border);
            color: #1e293b;
        }
        .btn-outline:hover {
            background: #f1f3f4;
            border-color: #b0b8c5;
        }
        .btn-ghost {
            background: transparent;
            color: var(--gray);
        }
        .btn-ghost:hover {
            background: #f1f3f4;
            color: #0b1a33;
        }
        .btn-sm {
            padding: 4px 12px;
            font-size: 12px;
            border-radius: 4px;
        }
        .btn-xs {
            padding: 2px 10px;
            font-size: 11px;
            border-radius: 4px;
        }
        .btn-group {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            align-items: center;
        }
        .btn-group .btn {
            flex: 0 0 auto;
        }

        /* ─── BADGE ─── */
        .badge {
            display: inline-block;
            padding: 2px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
        }
        .badge-success {
            background: var(--green-light);
            color: var(--green);
        }
        .badge-danger {
            background: var(--red-light);
            color: var(--red);
        }
        .badge-warning {
            background: var(--orange-light);
            color: var(--orange);
        }
        .badge-info {
            background: var(--accent-light);
            color: var(--accent);
        }
        .badge-purple {
            background: var(--purple-light);
            color: var(--purple);
        }
        .badge-teal {
            background: var(--teal-light);
            color: var(--teal);
        }
        .badge-gray {
            background: #e9edf2;
            color: #4b5563;
        }

        /* ─── FORM ─── */
        .form-group {
            margin-bottom: 16px;
        }
        .form-group label {
            display: block;
            font-weight: 500;
            margin-bottom: 4px;
            font-size: 13px;
            color: #1e293b;
        }
        .form-control {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--gray-border);
            border-radius: 6px;
            font-size: 13px;
            transition: var(--transition);
            background: #fff;
        }
        .form-control:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(42, 139, 242, 0.15);
        }
        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }
        .form-row-3 {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 16px;
        }
        .text-muted {
            color: var(--gray);
        }
        .text-sm {
            font-size: 13px;
        }
        .text-xs {
            font-size: 12px;
        }
        .fw-600 {
            font-weight: 600;
        }
        .mt-12 {
            margin-top: 12px;
        }
        .mt-20 {
            margin-top: 20px;
        }
        .mb-12 {
            margin-bottom: 12px;
        }
        .mb-20 {
            margin-bottom: 20px;
        }
        .flex-between {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .flex {
            display: flex;
        }
        .gap-8 {
            gap: 8px;
        }
        .gap-12 {
            gap: 12px;
        }
        .gap-16 {
            gap: 16px;
        }
        .w-full {
            width: 100%;
        }

        /* ─── TABLES ─── */
        .table-wrap {
            overflow-x: auto;
            max-width: 100%;
            width: 100%;
            display: block;
            -webkit-overflow-scrolling: touch;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        table th {
            text-align: left;
            padding: 10px 12px;
            background: #f8fafc;
            font-weight: 600;
            color: #1e293b;
            border-bottom: 2px solid var(--gray-border);
            white-space: nowrap;
        }
        table td {
            padding: 10px 12px;
            border-bottom: 1px solid #f0f2f5;
            vertical-align: middle;
        }
        table tr:hover td {
            background: #fafbfc;
        }

        /* ─── TABS ─── */
        .tabs {
            display: flex;
            gap: 4px;
            border-bottom: 2px solid var(--gray-border);
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        .tabs .tab {
            padding: 10px 18px;
            font-weight: 500;
            color: var(--gray);
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            transition: var(--transition);
            cursor: pointer;
        }
        .tabs .tab:hover {
            color: var(--navy);
        }
        .tabs .tab.active {
            color: var(--accent);
            border-bottom-color: var(--accent);
        }
        .tab-pane {
            display: none;
            animation: fadeUp 0.25s ease;
        }
        .tab-pane.active {
            display: block;
        }

        /* ─── MODAL ─── */
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(2px);
            z-index: 2000;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .modal-overlay.open {
            display: flex;
        }
        .modal-box {
            background: #fff;
            border-radius: 12px;
            max-width: 780px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            padding: 28px 32px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
            animation: fadeUp 0.25s ease;
        }
        .modal-box .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            font-weight: 600;
            font-size: 18px;
        }
        .modal-box .modal-header .close {
            font-size: 24px;
            color: var(--gray);
            cursor: pointer;
            transition: var(--transition);
        }
        .modal-box .modal-header .close:hover {
            color: var(--red);
        }
        .modal-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin-top: 20px;
            border-top: 1px solid var(--gray-border);
            padding-top: 18px;
        }

        /* ============================================================ */
        /* PARTS & VARIANTS — DETAILED STYLES */
        /* ============================================================ */

        /* Master header */
        .master-header {
            display: flex;
            gap: 24px;
            align-items: flex-start;
            flex-wrap: wrap;
            padding: 0 0 16px 0;
            border-bottom: 1px solid var(--gray-border);
            margin-bottom: 20px;
        }
        .master-header .master-image {
            width: 120px;
            height: 120px;
            border-radius: var(--radius);
            background: #f1f5f9;
            border: 1px solid var(--gray-border);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            color: var(--gray);
            flex-shrink: 0;
        }
        .master-header .master-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: var(--radius);
        }
        .master-header .master-info {
            flex: 1;
            min-width: 200px;
        }
        .master-header .master-info .code {
            font-size: 13px;
            color: var(--gray);
            font-weight: 500;
        }
        .master-header .master-info .name {
            font-size: 22px;
            font-weight: 700;
            color: #0b1a33;
            margin: 2px 0 4px 0;
        }
        .master-header .master-info .oem {
            font-size: 14px;
            color: var(--gray);
        }
        .master-header .master-info .oem strong {
            color: #1e293b;
        }
        .master-header .master-info .meta-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
        }
        .master-header .master-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            align-items: center;
            flex-shrink: 0;
        }

        /* Detail grid */
        .detail-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }
        .detail-grid .full-width {
            grid-column: 1 / -1;
        }

        .info-row {
            display: flex;
            justify-content: space-between;
            padding: 6px 0;
            border-bottom: 1px solid #f0f2f5;
            font-size: 13px;
        }
        .info-row .label {
            color: var(--gray);
            font-weight: 500;
        }
        .info-row .value {
            font-weight: 500;
            color: #0b1a33;
            text-align: right;
        }
        .info-row .value .badge {
            font-weight: 600;
        }

        /* Variant cards */
        .variant-card {
            border: 1px solid var(--gray-border);
            border-radius: var(--radius);
            padding: 16px 18px;
            margin-bottom: 14px;
            background: #fafbfc;
            transition: var(--transition);
        }
        .variant-card:hover {
            border-color: var(--accent);
            background: #f8faff;
        }
        .variant-card .variant-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            flex-wrap: wrap;
            gap: 10px;
        }
        .variant-card .variant-top .left {
            display: flex;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
        }
        .variant-card .variant-top .left .flag {
            font-size: 24px;
        }
        .variant-card .variant-top .left .vname {
            font-weight: 600;
            font-size: 15px;
            color: #0b1a33;
        }
        .variant-card .variant-top .left .vname .sub {
            font-weight: 400;
            font-size: 13px;
            color: var(--gray);
        }
        .variant-card .variant-top .stock-badge {
            font-weight: 600;
            font-size: 14px;
            padding: 4px 14px;
            border-radius: 20px;
            background: var(--green-light);
            color: var(--green);
        }
        .variant-card .variant-top .stock-badge.low {
            background: var(--orange-light);
            color: var(--orange);
        }
        .variant-card .variant-top .stock-badge.critical {
            background: var(--red-light);
            color: var(--red);
        }
        .variant-card .variant-details {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 8px 20px;
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid var(--gray-border);
        }
        .variant-card .variant-details .item {
            font-size: 13px;
        }
        .variant-card .variant-details .item .lbl {
            color: var(--gray);
            font-size: 12px;
        }
        .variant-card .variant-details .item .val {
            font-weight: 500;
            color: #0b1a33;
        }
        .variant-card .variant-codes {
            display: flex;
            flex-wrap: wrap;
            gap: 12px 24px;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid var(--gray-border);
            font-size: 12px;
            font-family: 'Courier New', monospace;
            color: #1e293b;
        }
        .variant-card .variant-codes span {
            display: flex;
            align-items: center;
            gap: 4px;
            background: #f1f5f9;
            padding: 2px 10px;
            border-radius: 4px;
        }
        .variant-card .variant-codes span i {
            color: var(--gray);
            font-size: 14px;
        }

        /* Barcode & QR visual */
        .barcode-visual {
            background: #fff;
            padding: 12px 20px;
            border-radius: 6px;
            border: 1px solid var(--gray-border);
            display: inline-block;
            min-width: 160px;
            text-align: center;
            font-family: 'Courier New', monospace;
            font-size: 18px;
            letter-spacing: 2px;
            color: #0b1a33;
            position: relative;
        }
        .barcode-visual .bars {
            display: flex;
            align-items: flex-end;
            height: 40px;
            gap: 2px;
            justify-content: center;
            margin-bottom: 4px;
        }
        .barcode-visual .bars .bar {
            background: #0b1a33;
            width: 2px;
            height: 100%;
        }
        .barcode-visual .bars .bar.thin {
            width: 1px;
        }
        .barcode-visual .bars .bar.thick {
            width: 4px;
        }
        .barcode-visual .bars .bar.medium {
            width: 2.5px;
        }
        .barcode-visual .label {
            font-size: 11px;
            font-family: var(--font);
            letter-spacing: 1px;
            color: var(--gray);
            margin-top: 2px;
        }
        .qr-visual {
            display: inline-block;
            background: #fff;
            padding: 10px;
            border-radius: 6px;
            border: 1px solid var(--gray-border);
        }
        .qr-visual .qr-grid {
            display: grid;
            grid-template-columns: repeat(21, 1fr);
            gap: 1px;
            width: 120px;
            height: 120px;
            background: #fff;
        }
        .qr-visual .qr-grid .cell {
            background: #fff;
        }
        .qr-visual .qr-grid .cell.dark {
            background: #0b1a33;
        }
        .qr-visual .qr-grid .cell.light {
            background: #fff;
        }

        /* Status indicators */
        .status-indicator {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .status-indicator .dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            display: inline-block;
        }
        .status-indicator .dot.green {
            background: var(--green);
        }
        .status-indicator .dot.orange {
            background: var(--orange);
        }
        .status-indicator .dot.red {
            background: var(--red);
        }
        .status-indicator .dot.gray {
            background: #9ca3af;
        }

        /* ─── RESPONSIVE ─── */
        @media (max-width: 1024px) {
            .detail-grid {
                grid-template-columns: 1fr;
            }
            .detail-grid .full-width {
                grid-column: 1;
            }
            .variant-card .variant-details {
                grid-template-columns: 1fr 1fr;
            }
        }
        @media (max-width: 768px) {
            .sidebar {
                transform: translateX(-100%);
            }
            .sidebar.open {
                transform: translateX(0);
            }
            .main {
                margin-left: 0;
            }
            .topbar-left .menu-toggle {
                display: block;
            }
            .page-content {
                padding: 16px;
            }
            .master-header {
                flex-direction: column;
                align-items: stretch;
            }
            .master-header .master-image {
                width: 100%;
                height: 160px;
            }
            .master-header .master-actions {
                justify-content: flex-start;
            }
            .form-row,
            .form-row-3 {
                grid-template-columns: 1fr;
            }
            .variant-card .variant-details {
                grid-template-columns: 1fr;
            }
            .variant-card .variant-top {
                flex-direction: column;
                align-items: stretch;
            }
            .topbar-right .user-info .name {
                display: none;
            }
            .topbar .page-title {
                font-size: 15px;
            }
        }
        @media (max-width: 480px) {
            .topbar {
                padding: 0 12px;
            }
            .topbar-right .badge-icon .count {
                width: 16px;
                height: 16px;
                font-size: 9px;
                top: -5px;
                right: -6px;
            }
            .card-body {
                padding: 14px;
            }
            .master-header .master-info .name {
                font-size: 18px;
            }
        }
    
/* DASHBOARD RESTORED */
.stat-card {
            display: flex;
            align-items: center;
            gap: 16px;
        }
        .stat-card .icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
            flex-shrink: 0;
        }
        .stat-card .icon.blue {
            background: #dbeafe;
            color: #2563eb;
        }
        .stat-card .icon.green {
            background: #d1fae5;
            color: #059669;
        }
        .stat-card .icon.orange {
            background: #fef3c7;
            color: #d97706;
        }
        .stat-card .icon.red {
            background: #fde8e8;
            color: #dc2626;
        }
        .stat-card .stat-info .value {
            font-size: 24px;
            font-weight: 700;
            color: #0b1a33;
            line-height: 1.2;
        }
        .stat-card .stat-info .label {
            font-size: 13px;
            color: var(--gray);
        }

        /* ─── TABLES ─── */
        .table-wrap {
            overflow-x: auto;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }
        table th {
            text-align: left;
            padding: 10px 12px;
            background: #f8fafc;
            font-weight: 600;
            color: #1e293b;
            border-bottom: 2px solid var(--gray-border);
            white-space: nowrap;
        }
        table td {
            padding: 10px 12px;
            border-bottom: 1px solid #f0f2f5;
            vertical-align: middle;
        }
        table tr:hover td {
            background: #fafbfc;
        }
        .badge {
            display: inline-block;
            padding: 2px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 600;
        }
        .badge-success {
            background: var(--green-light);
            color: var(--green);
        }
        .badge-danger {
            background: var(--red-light);
            color: var(--red);
        }
        .badge-warning {
            background: var(--orange-light);
            color: var(--orange);
        }
        .badge-info {
            background: var(--accent-light);
            color: var(--accent);
        }
        .badge-gray {
            background: #e9edf2;
            color: #4b5563;
        }
        .status-dot {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            margin-right: 6px;
        }
        .status-dot.green {
            background: var(--green);
        }
        .status-dot.red {
            background: var(--red);
        }
        .status-dot.orange {
            background: var(--orange);
        }
        .status-dot.gray {
            background: #9ca3af;
        }

        /* ─── FORMS ─── */
        .form-group {
            margin-bottom: 16px;
        }
        .form-group label {
            display: block;
            font-weight: 500;
            margin-bottom: 4px;
            font-size: 13px;
            color: #1e293b;
        }
        .form-group .hint {
            font-size: 12px;
            color: var(--gray);
            margin-top: 2px;
        }
        .form-control {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--gray-border);
            border-radius: 6px;
            font-size: 13px;
            transition: var(--transition);
            background: #fff;
        }
        .form-control:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(42, 139, 242, 0.15);
        }
        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }
        .form-row-3 {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 16px;
        }
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 8px 18px;
            border-radius: 6px;
            font-weight: 500;
            font-size: 13px;
            transition: var(--transition);
            border: 1px solid transparent;
        }
        .btn-primary {
            background: var(--accent);
            color: #fff;
        }
        .btn-primary:hover {
            background: var(--accent-hover);
        }
        .btn-success {
            background: var(--green);
            color: #fff;
        }
        .btn-success:hover {
            background: #0b7e48;
        }
        .btn-danger {
            background: var(--red);
            color: #fff;
        }
        .btn-danger:hover {
            background: #b71c1c;
        }
        .btn-outline {
            background: transparent;
            border-color: var(--gray-border);
            color: #1e293b;
        }
        .btn-outline:hover {
            background: #f1f3f4;
        }
        .btn-sm {
            padding: 4px 12px;
            font-size: 12px;
        }
        .btn-group {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        .btn-group .btn {
            flex: 0 0 auto;
        }

        /* ─── TABS ─── */
        .tabs {
            display: flex;
            gap: 4px;
            border-bottom: 2px solid var(--gray-border);
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        .tabs .tab {
            padding: 10px 18px;
            font-weight: 500;
            color: var(--gray);
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            transition: var(--transition);
            cursor: pointer;
        }
        .tabs .tab:hover {
            color: var(--navy);
        }
        .tabs .tab.active {
            color: var(--accent);
            border-bottom-color: var(--accent);
        }
        .tab-pane {
            display: none;
            animation: fadeUp 0.25s ease;
        }
        .tab-pane.active {
            display: block;
        }

        /* ─── MISC ─── */
        .mt-12 {
            margin-top: 12px;
        }
        .mt-20 {
            margin-top: 20px;
        }
        .mb-12 {
            margin-bottom: 12px;
        }
        .mb-20 {
            margin-bottom: 20px;
        }
        .flex {
            display: flex;
        }
        .flex-between {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .gap-8 {
            gap: 8px;
        }
        .gap-12 {
            gap: 12px;
        }
        .gap-16 {
            gap: 16px;
        }
        .text-muted {
            color: var(--gray);
        }
        .text-sm {
            font-size: 13px;
        }
        .text-xs {
            font-size: 12px;
        }
        .fw-600 {
            font-weight: 600;
        }
        .w-full {
            width: 100%;
        }
        .overflow-hidden {
            overflow: hidden;
        }

        /* ─── MODAL ─── */
        .modal-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(2px);
            z-index: 2000;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .modal-overlay.open {
            display: flex;
        }
        .modal-box {
            background: #fff;
            border-radius: 12px;
            max-width: 720px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            padding: 28px 32px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
            animation: fadeUp 0.25s ease;
        }
        .modal-box .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            font-weight: 600;
            font-size: 18px;
        }
        .modal-box .modal-header .close {
            font-size: 24px;
            color: var(--gray);
            cursor: pointer;
            transition: var(--transition);
        }
        .modal-box .modal-header .close:hover {
            color: var(--red);
        }
        .modal-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            margin-top: 20px;
            border-top: 1px solid var(--gray-border);
            padding-top: 18px;
        }

        /* ─── CHARTS (simple bar) ─── */
        .chart-bar-container {
            display: flex;
            align-items: flex-end;
            gap: 10px;
            height: 150px;
            padding-top: 10px;
        }
        .chart-bar {
            flex: 1;
            background: var(--accent);
            border-radius: 4px 4px 0 0;
            min-height: 8px;
            transition: 0.3s;
            position: relative;
        }
        .chart-bar .val {
            position: absolute;
            top: -20px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 11px;
            font-weight: 600;
            color: #1e293b;
        }
        .chart-bar .lbl {
            position: absolute;
            bottom: -22px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 10px;
            color: var(--gray);
            white-space: nowrap;
        }

        /* ─── RESPONSIVE ─── */
        

/* DASHBOARD LAYOUT FIXES */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

#dashboard .card {
    padding: 24px;
}
#dashboard .card-header {
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: 1fr 1fr;
    }
    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ─── WAREHOUSE SPECIFIC ─── */
/* Warehouse stats cards */
        .wh-stat-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 16px;
            margin-bottom: 20px;
        }
        .wh-stat-card {
            background: var(--white);
            border-radius: var(--radius);
            border: 1px solid var(--gray-border);
            padding: 14px 18px;
            text-align: center;
        }
        .wh-stat-card .stat-value {
            font-size: 22px;
            font-weight: 700;
            color: #0b1a33;
        }
        .wh-stat-card .stat-label {
            font-size: 12px;
            color: var(--gray);
            margin-top: 2px;
        }
        .wh-stat-card .stat-icon {
            font-size: 20px;
            color: var(--accent);
            margin-bottom: 4px;
        }

        /* Warehouse card grid */
        .wh-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 18px;
            margin-bottom: 20px;
        }
        .wh-card {
            background: var(--white);
            border-radius: var(--radius);
            border: 1px solid var(--gray-border);
            padding: 18px 20px;
            transition: var(--transition);
            cursor: pointer;
        }
        .wh-card:hover {
            border-color: var(--accent);
            box-shadow: var(--shadow-lg);
            transform: translateY(-2px);
        }
        .wh-card .wh-name {
            font-weight: 600;
            font-size: 16px;
            color: #0b1a33;
        }
        .wh-card .wh-code {
            font-size: 13px;
            color: var(--gray);
        }
        .wh-card .wh-stats {
            display: flex;
            gap: 16px;
            margin-top: 10px;
            font-size: 13px;
        }
        .wh-card .wh-stats span {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .wh-card .wh-occupancy {
            margin-top: 10px;
        }
        .wh-card .wh-occupancy .bar {
            height: 6px;
            background: var(--gray-light);
            border-radius: 4px;
            overflow: hidden;
        }
        .wh-card .wh-occupancy .bar .fill {
            height: 100%;
            border-radius: 4px;
            background: var(--accent);
        }
        .wh-card .wh-occupancy .bar .fill.green {
            background: var(--green);
        }
        .wh-card .wh-occupancy .bar .fill.orange {
            background: var(--orange);
        }
        .wh-card .wh-occupancy .bar .fill.red {
            background: var(--red);
        }
        .wh-card .wh-occupancy .label {
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: var(--gray);
            margin-top: 2px;
        }

        /* Warehouse detail view */
        .wh-detail-header {
            display: flex;
            gap: 24px;
            align-items: flex-start;
            flex-wrap: wrap;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--gray-border);
            margin-bottom: 16px;
        }
        .wh-detail-header .wh-info {
            flex: 1;
            min-width: 200px;
        }
        .wh-detail-header .wh-info .wh-name {
            font-size: 22px;
            font-weight: 700;
            color: #0b1a33;
        }
        .wh-detail-header .wh-info .wh-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 12px 20px;
            margin-top: 4px;
            font-size: 13px;
            color: var(--gray);
        }
        .wh-detail-header .wh-info .wh-meta strong {
            color: #1e293b;
        }
        .wh-detail-header .wh-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        /* Location hierarchy tree */
        .location-tree {
            font-family: 'Courier New', monospace;
            font-size: 13px;
            padding: 12px 16px;
            background: #f8fafc;
            border-radius: 6px;
            border: 1px solid var(--gray-border);
        }
        .location-tree .tree-item {
            padding: 2px 0;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .location-tree .tree-item .icon {
            color: var(--gray);
            width: 20px;
            text-align: center;
        }
        .location-tree .tree-item .label {
            font-weight: 500;
        }
        .location-tree .tree-item .badge {
            font-size: 10px;
            margin-left: 6px;
        }
        .location-tree .tree-item .sub-items {
            padding-left: 24px;
        }
        .location-tree .tree-item .sub-items .tree-item {
            padding: 1px 0;
        }

        /* Location table */
        .loc-table .loc-code {
            font-family: 'Courier New', monospace;
            font-weight: 600;
            color: #0b1a33;
        }
        .loc-table .loc-barcode {
            font-size: 12px;
            font-family: 'Courier New', monospace;
            background: #f1f5f9;
            padding: 2px 8px;
            border-radius: 4px;
        }

        /* ─── RTL SUPPORT ─── */
        html[dir="rtl"] .sidebar {
            left: auto;
            right: 0;
            border-left: 1px solid rgba(255, 255, 255, 0.06);
        }
        html[dir="rtl"] .sidebar-nav a {
            border-left: none;
            border-right: 3px solid transparent;
        }
        html[dir="rtl"] .sidebar-nav a.active {
            border-right-color: var(--accent);
        }
        html[dir="rtl"] .main {
            margin-left: 0;
            margin-right: var(--sidebar-width);
        }
        html[dir="rtl"] .topbar-left {
            margin-right: 0;
        }
        html[dir="rtl"] .flex-between {
            flex-direction: row;
        }
        @media (max-width: 992px) {
            html[dir="rtl"] .sidebar {
                transform: translateX(100%);
            }
            html[dir="rtl"] .sidebar.open {
                transform: translateX(0);
            }
            html[dir="rtl"] .main {
                margin-right: 0;
            }
        }


/* PREMIUM DASHBOARD STYLES */
.premium-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.premium-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.premium-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}
.premium-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 150px; height: 150px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    opacity: 0.05;
    border-radius: 50%;
    transform: translate(30%, -30%);
}
.premium-card .icon-box {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}
.premium-card .icon-box.blue { background: rgba(37,99,235,0.1); color: #2563eb; }
.premium-card .icon-box.green { background: rgba(16,185,129,0.1); color: #10b981; }
.premium-card .icon-box.orange { background: rgba(245,158,11,0.1); color: #f59e0b; }
.premium-card .icon-box.red { background: rgba(239,68,68,0.1); color: #ef4444; }

.premium-card .stat-val { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1.2; }
.premium-card .stat-lbl { font-size: 13px; color: #64748b; font-weight: 500; margin-top: 4px; }

/* MINI STATS CARDS */
.parts-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card-mini {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-border);
    padding: 14px 18px;
    text-align: center;
}
.stat-card-mini .stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #0b1a33;
}
.stat-card-mini .stat-label {
    font-size: 12px;
    color: var(--gray);
    margin-top: 2px;
}
.stat-card-mini .stat-icon {
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 4px;
}
