  :root {
            --primary-color: #4361ee;
            --primary-light: #4895ef;
            --secondary-color: #3f37c9;
            --accent-color: #4cc9f0;
            --success-color: #4ade80;
            --warning-color: #f59e0b;
            --danger-color: #ef4444;
            --gray-50: #f8fafc;
            --gray-100: #f1f5f9;
            --gray-200: #e2e8f0;
            --gray-300: #cbd5e1;
            --gray-400: #94a3b8;
            --gray-500: #64748b;
            --gray-600: #475569;
            --gray-700: #334155;
            --gray-800: #1e293b;
            --gray-900: #0f172a;
            --border-radius: 12px;
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
           
            color: var(--gray-800);
            line-height: 1.6;
        }

       

      

        /* Header Section */
        .header-section {
            margin-bottom: 2rem;
        }

        .order-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: white;
            padding: 0.5rem 0.9rem;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow-md);
            border-left: 6px solid var(--primary-color);
        }

        .order-title {
            display: flex;
            align-items: center;
            gap: 1.5rem;
        }

        .order-number {
            font-size: 1.6rem;
            font-weight: 700;
            color: var(--gray-900);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .order-number i {
            color: var(--primary-color);
            font-size: 1.5rem;
        }

        .status-badge {
            padding: 0.5rem 1rem;
            border-radius: 50px;
            font-size: 0.75rem;
            font-weight: 600;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            box-shadow: var(--shadow-sm);
        }

        .status-cadastrada { background-color: var(--gray-200); color: var(--gray-700); }
        .status-separacao { background-color: #fef3c7; color: #92400e; }
        .status-corte { background-color: #fef3c7; color: #92400e; }
        .status-silk, .status-bordado, .status-sublimacao, .status-dtf, .status-aplik { 
            background-color: #dbeafe; color: #1e40af; 
        }
        .status-costura { background-color: #dbeafe; color: #1e40af; }
        .status-acabamento { background-color: #d1fae5; color: #065f46; }
        .status-pronto_entrega { background-color: #d1fae5; color: #065f46; }
        .status-entregue { background-color: #dcfce7; color: #166534; }

        .header-actions {
            display: flex;
            gap: 1rem;
        }

        .btn-action {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: var(--border-radius);
            font-weight: 500;
            text-decoration: none;
            transition: all 0.2s ease;
            box-shadow: var(--shadow-sm);
        }

        .btn-action:hover {
            background: var(--secondary-color);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
            color: white;
        }

        /* Content Grid */
        .content-grid {
            display: grid;
            grid-template-columns: 1fr 400px;
            gap: 2rem;
        }

        @media (max-width: 1024px) {
            .content-grid {
                grid-template-columns: 1fr;
            }
        }

        /* Production Main */
        .production-main {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow-md);
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        .section-header {
            padding: 0.5rem 0.6rem;
            background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
            color: white;
            font-size: 1rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .section-header i {
            font-size: 1.5rem;
        }

        /* Progress Container */
        .progress-container {
            padding: 0.9rem;
            border-bottom: 1px solid var(--gray-200);
        }

        .progress-info {
            display: flex;
            justify-content: space-between;
            margin-bottom: 1rem;
        }

        .progress-text {
            font-weight: 600;
            color: var(--gray-700);
        }

        .progress-bar {
            height: 12px;
            background-color: var(--gray-200);
            border-radius: 10px;
            overflow: hidden;
            position: relative;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
            border-radius: 10px;
            transition: width 1.5s ease-in-out;
            position: relative;
        }

        .progress-fill::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            width: 20px;
            background: linear-gradient(90deg, rgba(255,255,255,0.4), transparent);
            animation: shimmer 2s infinite;
        }

        /* Flow Steps */
        .flow-steps {
            padding: 1rem;
            display: flex;
            justify-content: space-between;
            position: relative;
            border-bottom: 1px solid var(--gray-200);
        }

        .flow-steps::before {
            content: '';
            position: absolute;
            top: 30px;
            left: 50px;
            right: 50px;
            height: 4px;
            background-color: var(--gray-300);
            z-index: 1;
        }

        .flow-step {
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            z-index: 2;
            transition: all 0.3s ease;
        }

        .flow-step.active .step-number {
            background: var(--primary-color);
            color: white;
            transform: scale(1.1);
            box-shadow: var(--shadow-lg);
        }

        .flow-step.completed .step-number {
            background: var(--success-color);
            color: white;
        }

        .flow-step.completed::before {
            background: var(--success-color);
        }

        .step-number {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background: var(--gray-300);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--gray-600);
            margin-bottom: 0.75rem;
            transition: all 0.3s ease;
            border: 3px solid white;
            box-shadow: var(--shadow-sm);
           
        }

        .step-text {
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--gray-700);
            text-align: center;
        }

        .flow-step.active .step-text {
            color: var(--primary-color);
        }

        .flow-step.completed .step-text {
            color: var(--success-color);
        }

        /* Timeline Section - CORRIGIDA COM SCROLL */
        .timeline-section {
            padding: 1rem;
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 0; /* Importante para o flex funcionar corretamente */
        }

        .timeline-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
            font-weight: 600;
            color: var(--gray-700);
            flex-shrink: 0; /* Impede que o header seja comprimido */
        }

        .timeline-container {
            flex: 1;
            overflow-y: auto;
            max-height: 280px; /* Altura máxima para o scroll */
            padding-right: 0.5rem;
        }

        /* Custom scrollbar para a timeline */
        .timeline-container::-webkit-scrollbar {
            width: 6px;
        }

        .timeline-container::-webkit-scrollbar-track {
            background: var(--gray-100);
            border-radius: 3px;
        }

        .timeline-container::-webkit-scrollbar-thumb {
            background: var(--gray-400);
            border-radius: 3px;
        }

        .timeline-container::-webkit-scrollbar-thumb:hover {
            background: var(--gray-500);
        }

        .timeline {
            position: relative;
        }

        .timeline::before {
            content: '';
            position: absolute;
            left: 15px;
            top: 0;
            bottom: 0;
            width: 2px;
            background: var(--gray-300);
        }

        .timeline-item {
            display: flex;
            margin-bottom: 1.5rem;
            position: relative;
            opacity: 0;
            transform: translateY(20px);
            animation: fadeInUp 0.5s ease forwards;
        }

        .timeline-marker {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--gray-300);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 1rem;
            flex-shrink: 0;
            position: relative;
            z-index: 2;
            border: 3px solid white;
            box-shadow: var(--shadow-sm);
        }

        .timeline-item.completed .timeline-marker {
            background: var(--success-color);
            color: white;
        }

        .timeline-content {
            height: 90px;
            flex: 1;
            background: var(--gray-50);
            padding: 1rem;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow-sm);
            transition: all 0.3s ease;
            margin-bottom: 0.5rem;
        }

        .timeline-item:hover .timeline-content {
            transform: translateX(5px);
            box-shadow: var(--shadow-md);
        }

        .timeline-stage {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--gray-800);
            margin-bottom: 0.5rem;
        }

        .timeline-meta {
            font-size: 0.875rem;
            color: var(--gray-600);
            margin-top: 0.75rem;
        }

        .timeline-meta div {
            margin-bottom: 0.25rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .no-history {
            text-align: center;
            padding: 3rem 2rem;
            color: var(--gray-500);
            font-style: italic;
        }

        /* Update Form - AGORA FIXO NO FINAL */
        .update-form {
            padding: 2rem;
            background: var(--gray-50);
            border-top: 1px solid var(--gray-200);
            flex-shrink: 0; /* Impede que o formulário seja comprimido */
            margin-top: auto; /* Empurra para o final do container */
        }

        .form-control {
            border-radius: var(--border-radius);
            border: 1px solid var(--gray-300);
            padding: 0.75rem 1rem;
            transition: all 0.3s ease;
        }

        .form-control:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
        }

        .btn-update {
            background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
            color: white;
            border: none;
            border-radius: var(--border-radius);
            padding: 1rem 1.5rem;
            font-weight: 600;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            box-shadow: var(--shadow-md);
        }

        .btn-update:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
            background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
        }

        /* Registration Form */
        .registration-form {
            background: white;
            border-radius: var(--border-radius);
            box-shadow: var(--shadow-md);
            overflow: hidden;
            height: fit-content;
            position: sticky;
            top: 2rem;
        }

        .form-header {
            padding: 0.5rem 0.6rem;
            background: linear-gradient(135deg, var(--gray-500), var(--gray-600));
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .form-header h3 {
            margin: 0;
            font-size: 1rem;
            font-weight: 600;
        }

        .form-id {
            background: rgba(255, 255, 255, 0.2);
            padding: 0.25rem 0.75rem;
            border-radius: 50px;
            font-size: 0.875rem;
            font-weight: 500;
        }

        .form-section {
            padding: 1.5rem 2rem;
            border-bottom: 1px solid var(--gray-200);
        }

        .form-section:last-child {
            border-bottom: none;
        }

        .form-row {
            display: flex;
            justify-content: space-between;
            padding: 0.75rem 0;
        }

        .form-row.dotted-line {
            border-bottom: 1px dashed var(--gray-300);
        }

        .form-row.highlight {
            background: var(--gray-50);
            margin: 0 -2rem;
            padding: 0.75rem 2rem;
            border-radius: 0;
        }

        .form-label {
            font-weight: 600;
            color: var(--gray-700);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .form-label-obs {
            font-weight: 600;
            color: var(--gray-700);
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .form-value {
            color: var(--gray-800);
            text-align: right;
            font-weight: 500;
        }

        .phone-link {
            color: var(--primary-color);
            text-decoration: none;
        }

        .phone-link:hover {
            text-decoration: underline;
        }

        .form-observation {
            background: var(--gray-50);
            padding: 1rem;
            border-radius: var(--border-radius);
            font-style: italic;
            color: var(--gray-700);
            border-left: 3px solid var(--primary-color);
        }

        .layout-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: var(--gray-100);
            color: var(--gray-700);
            border-radius: var(--border-radius);
            text-decoration: none;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .layout-btn:hover {
            background: var(--gray-200);
            color: var(--gray-800);
        }

        .danger-text {
            color: var(--danger-color);
            font-weight: 600;
        }

        .badge-sm {
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 600;
            margin-left: 0.5rem;
            color: white;
        }

        /* Alert */
        .alert {
            border-radius: var(--border-radius);
            border: none;
            padding: 1rem 1.5rem;
            font-weight: 500;
        }

        /* Animations */
        @keyframes fadeInUp {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(400%); }
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Responsive adjustments */
        @media (max-width: 768px) {
            .order-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 1rem;
            }
            
            .flow-steps {
                flex-wrap: wrap;
                gap: 1rem;
            }
            
            .flow-steps::before {
                display: none;
            }
            
            .form-row {
                flex-direction: column;
                gap: 0.5rem;
            }
            
            .form-value {
                text-align: left;
            }

            .timeline-container {
                max-height: 300px; /* Altura menor em mobile */
            }
        }