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

        :root {
            --primary: #0a0e27;
            --secondary: #1a2342;
            --accent: #00d9ff;
            --accent-warm: #ff6b35;
            --success: #00ff88;
            --warning: #ffd700;
            --danger: #ff3366;
            --text: #e8edf4;
            --text-muted: #8b95a8;
            --border: #2a3552;
            --surface: #141829;
        }

        body {
            font-family: 'Archivo', -apple-system, sans-serif;
            background: var(--primary);
            color: var(--text);
            line-height: 1.6;
            overflow-x: hidden;
        }

        /* Login Screen */
        .login-screen {
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            position: relative;
            overflow: hidden;
        }

        .login-screen::before {
            content: '';
            position: absolute;
            width: 500px;
            height: 500px;
            background: radial-gradient(circle, rgba(0, 217, 255, 0.1) 0%, transparent 70%);
            top: -250px;
            right: -250px;
            animation: float 20s ease-in-out infinite;
        }

        .login-screen::after {
            content: '';
            position: absolute;
            width: 400px;
            height: 400px;
            background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
            bottom: -200px;
            left: -200px;
            animation: float 15s ease-in-out infinite reverse;
        }

        @keyframes float {
            0%, 100% { transform: translate(0, 0) rotate(0deg); }
            33% { transform: translate(30px, -30px) rotate(120deg); }
            66% { transform: translate(-20px, 20px) rotate(240deg); }
        }

        .login-container {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 3rem;
            width: 90%;
            max-width: 400px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            position: relative;
            z-index: 1;
        }

        .login-header {
            text-align: center;
            margin-bottom: 2rem;
        }

        .login-header h1 {
            font-size: 2rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--accent), var(--accent-warm));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 0.5rem;
        }

        .login-header p {
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        .login-form {
            margin-bottom: 1.5rem;
        }

        .login-error {
            background: rgba(255, 51, 102, 0.1);
            border: 1px solid var(--danger);
            color: var(--danger);
            padding: 0.75rem;
            border-radius: 8px;
            margin-top: 1rem;
            font-size: 0.9rem;
        }

        .login-footer {
            text-align: center;
            color: var(--text-muted);
        }

        .user-info-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.75rem 1.5rem;
            background: var(--surface);
            border-bottom: 1px solid var(--border);
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent), var(--accent-warm));
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.9rem;
        }

        .user-details {
            display: flex;
            flex-direction: column;
        }

        .user-name {
            font-weight: 600;
            font-size: 0.9rem;
        }

        .user-role {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .logout-btn {
            background: none;
            border: 1px solid var(--border);
            color: var(--text-muted);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.85rem;
            transition: all 0.2s;
        }

        .logout-btn:hover {
            border-color: var(--danger);
            color: var(--danger);
        }

        .app-container {
            min-height: 100vh;
            display: grid;
            grid-template-columns: 280px 1fr;
        }

        /* Sidebar */
        .sidebar {
            background: var(--secondary);
            border-right: 1px solid var(--border);
            padding: 2rem 0;
            position: sticky;
            top: 0;
            height: 100vh;
            overflow-y: auto;
        }

        .logo {
            padding: 0 1.5rem;
            margin-bottom: 3rem;
        }

        .logo h1 {
            font-size: 1.5rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--accent), var(--accent-warm));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .nav-menu {
            list-style: none;
        }

        .nav-item {
            margin-bottom: 0.5rem;
        }

        .nav-link {
            display: flex;
            align-items: center;
            padding: 0.875rem 1.5rem;
            color: var(--text-muted);
            text-decoration: none;
            transition: all 0.2s;
            border-left: 3px solid transparent;
            font-weight: 500;
        }

        .nav-link:hover,
        .nav-link.active {
            color: var(--text);
            background: rgba(0, 217, 255, 0.05);
            border-left-color: var(--accent);
        }

        .nav-icon {
            margin-right: 0.75rem;
            font-size: 1.2rem;
        }

        /* Main Content */
        .main-content {
            padding: 2rem;
            max-width: 1600px;
        }

        .header {
            margin-bottom: 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header h2 {
            font-size: 2rem;
            font-weight: 700;
        }

        .btn {
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            font-family: inherit;
            font-size: 0.95rem;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--accent), #0099cc);
            color: white;
            box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 217, 255, 0.4);
        }

        .btn-secondary {
            background: var(--surface);
            color: var(--text);
            border: 1px solid var(--border);
        }

        .btn-secondary:hover {
            border-color: var(--accent);
        }

        /* Dashboard Grid */
        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .stat-card {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.5rem;
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--accent), var(--accent-warm));
        }

        .stat-label {
            color: var(--text-muted);
            font-size: 0.875rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.5rem;
        }

        .stat-value {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
        }

        .stat-change {
            font-size: 0.875rem;
            color: var(--success);
        }

        /* Orders Section */
        .section {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 2rem;
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border);
        }

        .section-title {
            font-size: 1.25rem;
            font-weight: 600;
        }

        .orders-list {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .order-card {
            background: var(--secondary);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 1.25rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .order-card:hover {
            border-color: var(--accent);
            transform: translateX(4px);
        }

        .order-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 1rem;
        }

        .order-title {
            font-weight: 600;
            font-size: 1.1rem;
            margin-bottom: 0.25rem;
        }

        .order-customer {
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        .order-status {
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .status-pending {
            background: rgba(255, 215, 0, 0.15);
            color: var(--warning);
        }

        .status-production {
            background: rgba(0, 217, 255, 0.15);
            color: var(--accent);
        }

        .status-completed {
            background: rgba(0, 255, 136, 0.15);
            color: var(--success);
        }

        .order-details {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1rem;
            margin-top: 1rem;
        }

        .detail-item {
            display: flex;
            flex-direction: column;
        }

        .detail-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.25rem;
        }

        .detail-value {
            font-weight: 600;
            font-family: 'JetBrains Mono', monospace;
        }

        .production-timeline {
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border);
        }

        .timeline-steps {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }

        .timeline-step {
            flex: 1;
            height: 6px;
            background: var(--border);
            border-radius: 3px;
            position: relative;
            overflow: hidden;
        }

        .timeline-step.completed {
            background: var(--success);
        }

        .timeline-step.active {
            background: linear-gradient(90deg, var(--accent), var(--accent-warm));
            animation: pulse 2s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }

        .step-labels {
            display: flex;
            justify-content: space-between;
            margin-top: 0.5rem;
        }

        .step-label {
            font-size: 0.7rem;
            color: var(--text-muted);
        }

        /* Wizard */
        .wizard-progress {
            display: flex;
            align-items: center;
            margin-bottom: 2rem;
        }
        .wizard-step-indicator {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.3rem;
            flex: 1;
            position: relative;
        }
        .wizard-step-indicator:not(:last-child)::after {
            content: '';
            position: absolute;
            top: 14px;
            left: 50%;
            width: 100%;
            height: 2px;
            background: var(--border);
            z-index: 0;
        }
        .wizard-step-indicator.completed::after { background: var(--accent); }
        .wizard-dot {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: var(--surface);
            border: 2px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            font-weight: 700;
            position: relative;
            z-index: 1;
            transition: all 0.2s;
        }
        .wizard-step-indicator.active .wizard-dot {
            background: var(--accent);
            border-color: var(--accent);
            color: var(--primary);
        }
        .wizard-step-indicator.completed .wizard-dot {
            background: var(--success);
            border-color: var(--success);
            color: white;
        }
        .wizard-label {
            font-size: 0.7rem;
            color: var(--text-muted);
            white-space: nowrap;
        }
        .wizard-step-indicator.active .wizard-label { color: var(--accent); font-weight: 600; }
        .wizard-step-indicator.completed .wizard-label { color: var(--success); }

        .wizard-body { min-height: 280px; }
        .wizard-step-content { display: none; }
        .wizard-step-content.active { display: block; }

        .wizard-nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 1.5rem;
            padding-top: 1.5rem;
            border-top: 1px solid var(--border);
        }

        .summary-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
            margin-bottom: 1.25rem;
        }
        .summary-item {
            background: var(--surface);
            border-radius: 8px;
            padding: 0.6rem 0.8rem;
        }
        .summary-label { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.2rem; }
        .summary-value { font-size: 0.875rem; font-weight: 500; }

        /* Production Plan */
        .plan-grid {
            display: grid;
            grid-template-columns: 110px repeat(5, 1fr);
            gap: 0.6rem;
        }
        .plan-header-cell {
            text-align: center;
            font-weight: 600;
            font-size: 0.85rem;
            padding: 0.6rem 0.4rem;
            background: var(--surface);
            border-radius: 8px;
        }
        .plan-header-cell .plan-date {
            font-size: 0.7rem;
            font-weight: 400;
            color: var(--text-muted);
            margin-top: 0.1rem;
        }
        .plan-header-cell.today {
            background: rgba(0, 217, 255, 0.12);
            border: 1px solid rgba(0, 217, 255, 0.3);
            color: var(--accent);
        }
        .plan-row-label {
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.85rem;
            background: var(--surface);
            border-radius: 8px;
            padding: 0.5rem;
            text-align: center;
        }
        .plan-cell {
            background: var(--secondary);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 0.5rem;
            min-height: 110px;
            cursor: pointer;
            transition: border-color 0.15s;
        }
        .plan-cell:hover { border-color: var(--accent); }
        .plan-cell.today-col { border-color: rgba(0, 217, 255, 0.2); }

        .plan-card {
            border-radius: 6px;
            padding: 0.5rem 0.6rem;
            margin-bottom: 0.4rem;
            cursor: pointer;
            font-size: 0.78rem;
            border-left: 3px solid transparent;
            background: var(--surface);
            transition: opacity 0.15s;
        }
        .plan-card:hover { opacity: 0.85; }
        .plan-card.urgency-overdue { border-left-color: #ff4d4d; background: rgba(255,77,77,0.08); }
        .plan-card.urgency-today   { border-left-color: #ff8c00; background: rgba(255,140,0,0.08); }
        .plan-card.urgency-tomorrow{ border-left-color: #ffd700; background: rgba(255,215,0,0.06); }
        .plan-card-id { font-weight: 700; color: var(--accent); margin-bottom: 0.2rem; }
        .plan-card-customer { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .plan-card-meta { color: var(--text-muted); font-size: 0.7rem; margin-top: 0.2rem; }

        /* Order Panel */
        #orderPanelOverlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 200;
        }
        #orderPanelOverlay.open { display: block; }

        #orderPanel {
            position: fixed;
            top: 0;
            right: -520px;
            width: 500px;
            max-width: 95vw;
            height: 100vh;
            background: var(--secondary);
            border-left: 1px solid var(--border);
            z-index: 201;
            overflow-y: auto;
            transition: right 0.3s ease;
            box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
        }
        #orderPanel.open { right: 0; }

        .panel-header {
            position: sticky;
            top: 0;
            background: var(--secondary);
            border-bottom: 1px solid var(--border);
            padding: 1.25rem 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 1;
        }
        .panel-body { padding: 1.5rem; }
        .panel-section {
            margin-bottom: 1.75rem;
        }
        .panel-section-title {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            margin-bottom: 0.75rem;
        }
        .panel-field {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            padding: 0.4rem 0;
            border-bottom: 1px solid rgba(255,255,255,0.04);
            font-size: 0.875rem;
        }
        .panel-field:last-child { border-bottom: none; }
        .panel-field-label { color: var(--text-muted); }
        .panel-field-value { font-weight: 500; text-align: right; max-width: 60%; }

        .step-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
        .step-btn {
            padding: 0.4rem 0.9rem;
            border-radius: 20px;
            border: 1px solid var(--border);
            background: var(--surface);
            color: var(--text-muted);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.15s;
        }
        .step-btn:hover { border-color: var(--accent); color: var(--accent); }
        .step-btn.active { background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }
        .step-btn.completed { background: var(--success); border-color: var(--success); color: white; }

        .tag {
            display: inline-block;
            padding: 0.25rem 0.6rem;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 12px;
            font-size: 0.75rem;
            margin: 0.2rem;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(10, 14, 39, 0.95);
            backdrop-filter: blur(8px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.2s;
        }

        .modal.active {
            display: flex;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .modal-content {
            background: var(--secondary);
            border: 1px solid var(--border);
            border-radius: 16px;
            padding: 2rem;
            max-width: 800px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            animation: slideUp 0.3s;
        }

        @keyframes slideUp {
            from { 
                transform: translateY(30px);
                opacity: 0;
            }
            to { 
                transform: translateY(0);
                opacity: 1;
            }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
        }

        .modal-title {
            font-size: 1.5rem;
            font-weight: 700;
        }

        .close-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            transition: color 0.2s;
        }

        .close-btn:hover {
            color: var(--text);
        }

        .form-group {
            margin-bottom: 1.5rem;
        }

        .form-label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            font-size: 0.9rem;
        }

        .form-input,
        .form-select {
            width: 100%;
            padding: 0.75rem;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 8px;
            color: var(--text);
            font-family: inherit;
            font-size: 1rem;
            transition: border-color 0.2s;
        }

        textarea.form-input {
            resize: vertical;
            min-height: 100px;
            line-height: 1.5;
        }

        .form-input:focus,
        .form-select:focus {
            outline: none;
            border-color: var(--accent);
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        .checkbox-group {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-top: 0.5rem;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .checkbox-item input {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }

        .ai-estimate {
            background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(255, 107, 53, 0.1));
            border: 1px solid var(--accent);
            border-radius: 8px;
            padding: 1.5rem;
            margin-top: 1.5rem;
        }

        .ai-estimate-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }

        .ai-badge {
            background: var(--accent);
            color: var(--primary);
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .estimate-breakdown {
            display: grid;
            gap: 0.75rem;
        }

        .estimate-item {
            display: flex;
            justify-content: space-between;
            padding: 0.5rem 0;
            border-bottom: 1px solid var(--border);
        }

        .estimate-item:last-child {
            border-bottom: none;
            font-weight: 700;
            font-size: 1.1rem;
            padding-top: 1rem;
            margin-top: 0.5rem;
            border-top: 2px solid var(--accent);
        }

        .loading {
            display: inline-block;
            width: 16px;
            height: 16px;
            border: 2px solid var(--border);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .customer-info {
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 1.5rem;
        }

        .customer-info-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.75rem;
            color: var(--accent);
            font-weight: 600;
        }

        .info-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.75rem;
        }

        .info-item {
            font-size: 0.9rem;
        }

        .info-label {
            color: var(--text-muted);
            font-size: 0.8rem;
        }

        .btn-group {
            display: flex;
            gap: 1rem;
            margin-top: 2rem;
        }

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