
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg,#1E3C72 0%, #2A5298 100%);
            min-height: 100vh;
            padding: 20px;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            background: white;
            border-radius: 15px;
            box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
            overflow: hidden;
        }

        .header {
            background: linear-gradient(135deg, #E17055 0%, #D63031 100%);
            color: white;
            padding: 30px;
            text-align: center;
        }

        .header h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
        }

        .header p {
            font-size: 1.2rem;
            opacity: 0.9;
        }

        .main-content {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            padding: 30px;
        }

        .section {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 25px;
            border: 2px solid #e9ecef;
        }

        .section h2 {
            color: #2c3e50;
            margin-bottom: 20px;
            font-size: 1.6rem;
            border-bottom: 3px solid #E17055;
            padding-bottom: 10px;
        }

        .input-group {
            margin-bottom: 20px;
        }

        .input-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: #34495e;
        }

        .input-group input,
        .input-group select {
            width: 100%;
            padding: 12px;
            border: 2px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
            transition: border-color 0.3s ease;
        }

        .input-group input:focus,
        .input-group select:focus {
            outline: none;
            border-color: #E17055;
            box-shadow: 0 0 0 3px rgba(225, 112, 85, 0.1);
        }

        .dimensions-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 15px;
        }

        .btn {
            background: #E17055;
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            width: 100%;
            margin-top: 15px;
        }

        .btn:hover {
            background: #D63031;
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(225, 112, 85, 0.3);
        }

        .btn-success {
            background: #00B894;
        }

        .btn-success:hover {
            background: #00A085;
        }

        .family-filter-section {
            background: #E8F4F8;
            border: 2px solid #74B9FF;
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
        }

        .family-filter-section h3 {
            color: #0984E3;
            margin-bottom: 15px;
            font-size: 1.2rem;
        }

        .family-stats {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 10px;
            margin-top: 15px;
            font-size: 0.9rem;
        }

        .family-stat {
            background: white;
            padding: 8px 12px;
            border-radius: 6px;
            text-align: center;
            border: 1px solid #74B9FF;
        }

        .family-stat .label {
            color: #636E72;
            font-size: 0.8rem;
        }

        .family-stat .value {
            color: #0984E3;
            font-weight: 600;
            font-size: 1rem;
        }

        .stock-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 15px;
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        }

        .stock-table th,
        .stock-table td {
            padding: 8px;
            text-align: left;
            border-bottom: 1px solid #ddd;
            font-size: 0.85rem;
        }

        .stock-table th {
            background: #34495E;
            color: white;
            font-weight: 600;
        }

        .stock-table tr:hover {
            background: #F1F2F6;
        }

        .family-cell {
            font-weight: 600;
            padding: 4px 8px;
            border-radius: 4px;
            color: white;
            text-align: center;
            font-size: 0.75rem;
        }

        .family-electrofondus { background: #636E72; }
        .family-silice { background: #74B9FF; }
        .family-zircon-dense { background: #00B894; }
        .family-zircon-mullite { background: #E17055; }
        .family-sillimanite { background: #FDCB6E; color: #2D3436; }
        .family-isolants { background: #A29BFE; }
        .family-divers { background: #FD79A8; }
        .family-40-al2o3 { background: #E84393; }

        .result-section {
            grid-column: 1 / -1;
            margin-top: 20px;
        }

        .results-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-top: 20px;
        }

        .results-left {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .results-right {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .block-3d-container {
            background: white;
            border: 2px solid #ddd;
            border-radius: 10px;
            padding: 20px;
            text-align: center;
        }

        .block-3d-container h3 {
            color: #2C3E50;
            margin-bottom: 15px;
            font-size: 1.3rem;
        }

        .combined-scene {
            width: 350px;
            height: 250px;
            margin: 20px auto;
            perspective: 800px;
            perspective-origin: 50% 50%;
            border: 1px solid #ddd;
            border-radius: 8px;
            background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
            position: relative;
            overflow: visible;
        }

        .combined-box-container {
            width: 100%;
            height: 100%;
            position: relative;
            transform-style: preserve-3d;
            transition: transform 0.8s ease;
        }

        .block-box {
            position: absolute;
            left: 50%;
            top: 50%;
            transform-style: preserve-3d;
            transition: transform 0.8s ease;
        }

        .block-face {
            position: absolute;
            border: 1px solid rgba(0, 0, 0, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            color: white;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
            font-size: 12px;
            backface-visibility: visible;
        }

        .target-face {
            background: rgba(253, 255, 180, 0.9);
            border: 2px solid #e6d73a;
            z-index: 10;
            transition: all 0.3s ease;
            color: #2d3436;
        }

        .target-face:hover {
            background: rgba(253, 255, 180, 1);
            border: 2px solid #d4af37;
            box-shadow: 0 0 10px rgba(230, 215, 58, 0.5);
        }

        .candidate-face {
            background: rgba(116, 185, 255, 0.4);
            border: 1px solid #74b9ff;
            z-index: 5;
            transition: all 0.3s ease;
        }

        .candidate-face:hover {
            background: rgba(116, 185, 255, 0.6);
            border: 1px solid #0984e3;
        }

        .rotation-controls {
            margin-top: 15px;
        }

        .rotation-buttons {
            display: flex;
            justify-content: center;
            gap: 15px;
            flex-wrap: wrap;
            margin-bottom: 10px;
        }

        .rotation-buttons label {
            display: flex;
            align-items: center;
            gap: 5px;
            cursor: pointer;
            padding: 5px 10px;
            border-radius: 5px;
            transition: background-color 0.3s ease;
            font-size: 0.9rem;
        }

        .rotation-buttons label:hover {
            background-color: #f1f2f6;
        }

        .rotation-buttons input[type="radio"] {
            margin: 0;
        }

        .auto-rotation-controls {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin: 10px 0;
        }

        .auto-rotation-btn {
            padding: 5px 12px;
            background: #74b9ff;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.8rem;
            transition: all 0.3s ease;
        }

        .auto-rotation-btn:hover {
            background: #0984e3;
            transform: translateY(-1px);
        }

        .auto-rotation-btn.active {
            background: #e17055;
        }

        .dimension-tooltip {
            position: absolute;
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 8px 12px;
            border-radius: 5px;
            font-size: 0.8rem;
            pointer-events: none;
            z-index: 1000;
            white-space: nowrap;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .dimension-tooltip.show {
            opacity: 1;
        }

        .dimension-tooltip::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            margin-left: -5px;
            border: 5px solid transparent;
            border-top-color: rgba(0, 0, 0, 0.8);
        }

        .dimensions-info {
            margin-top: 15px;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            font-size: 0.85rem;
        }

        .dimension-item {
            background: #f8f9fa;
            padding: 8px;
            border-radius: 5px;
            border-left: 3px solid #ddd;
        }

        .dimension-item.target {
            border-left-color: #00b894;
        }

        .dimension-item.candidate {
            border-left-color: #74b9ff;
        }

        .visualization-legend {
            border-top: 1px solid #ddd;
            padding-top: 10px;
        }

        .cutting-section {
            background: white;
            border: 2px solid #ddd;
            border-radius: 10px;
            padding: 20px;
        }

        .cutting-section h3 {
            color: #2c3e50;
            margin-bottom: 15px;
            font-size: 1.3rem;
            border-bottom: 2px solid #e17055;
            padding-bottom: 8px;
        }

        .candidates-section {
            background: white;
            border: 2px solid #ddd;
            border-radius: 10px;
            padding: 20px;
            max-height: 500px;
            overflow-y: auto;
        }

        .candidates-section h3 {
            color: #2c3e50;
            margin-bottom: 15px;
            font-size: 1.3rem;
            border-bottom: 2px solid #00b894;
            padding-bottom: 8px;
        }

        .block-perspective {
            position: relative;
            margin: 20px auto;
            perspective: 800px;
            perspective-origin: 50% 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 150px;
        }

        .block-3d {
            position: relative;
            transform-style: preserve-3d;
            animation: rotate3d 8s infinite linear;
        }

        @keyframes rotate3d {
            from { transform: rotateX(15deg) rotateY(0deg); }
            to { transform: rotateX(15deg) rotateY(360deg); }
        }

        .candidate-item {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 10px;
            border-left: 4px solid #ddd;
            transition: all 0.3s ease;
            cursor: pointer;
        }

        .candidate-item:hover {
            transform: translateX(5px);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
            background: #f1f2f6;
        }

        .candidate-item.best {
            border-left-color: #00b894;
            background: linear-gradient(135deg, #e8f5e8 0%, #d1f2eb 100%);
        }

        .candidate-item.selected {
            border: 2px solid #e17055;
            background: linear-gradient(135deg, #fff2f0 0%, #ffe8e4 100%);
            transform: translateX(5px);
            box-shadow: 0 4px 15px rgba(225, 112, 85, 0.3);
        }

        .candidate-item.selected .candidate-ref {
            color: #e17055;
        }

        .candidate-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;
        }

        .candidate-ref {
            font-weight: 600;
            color: #2c3e50;
            font-size: 0.9rem;
        }

        .candidate-score {
            padding: 3px 6px;
            border-radius: 10px;
            font-size: 0.7rem;
            font-weight: 600;
        }

        .score-best {
            background: #00b894;
            color: white;
        }

        .score-good {
            background: #fdcb6e;
            color: #2d3436;
        }

        .candidate-details {
            font-size: 0.8rem;
            color: #636e72;
            line-height: 1.3;
        }

        .alert {
            padding: 15px;
            border-radius: 8px;
            margin: 15px 0;
        }

        .alert-info {
            background: #d4edda;
            border: 1px solid #c3e6cb;
            color: #155724;
        }

        .alert-warning {
            background: #fff3cd;
            border: 1px solid #ffeaa7;
            color: #856404;
        }

        .target-display {
            background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
            color: white;
            padding: 20px;
            border-radius: 10px;
            text-align: center;
            margin-bottom: 20px;
        }

        .target-dimensions {
            font-size: 1.8rem;
            font-weight: 600;
            margin-bottom: 10px;
        }

        .target-volume {
            font-size: 1.2rem;
            opacity: 0.9;
        }

        .sequence-step {
            background: white;
            border-radius: 6px;
            padding: 12px;
            margin-bottom: 10px;
            border-left: 4px solid #ffc107;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .step-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }

        .step-title {
            font-weight: 600;
            color: #2c3e50;
        }

        .step-priority {
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 600;
            color: white;
        }

        .priority-haute {
            background: #e74c3c;
        }

        .priority-normale {
            background: #3498db;
        }

        @media (max-width: 768px) {
            .main-content {
                grid-template-columns: 1fr;
                gap: 20px;
            }

            .results-container {
                grid-template-columns: 1fr;
            }

            .dimensions-grid {
                grid-template-columns: 1fr;
            }

            .family-stats {
                grid-template-columns: 1fr;
            }
        }
   
