   :root {
            --primary-color: #035a2a;
            --primary-light: #4ade80;
            --primary-dark: #022c15;
            --secondary-color: #0ea5e9;
            --accent-color: #f59e0b;
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --error-color: #ef4444;
            --text-primary: #1f2937;
            --text-secondary: #6b7280;
            --bg-primary: #ffffff;
            --bg-secondary: #f8fafc;
            --bg-tertiary: #f1f5f9;
            --border-color: #e2e8f0;
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
            --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
            --border-radius-sm: 0.375rem;
            --border-radius-md: 0.5rem;
            --border-radius-lg: 0.75rem;
            --border-radius-xl: 1rem;
        }

        * {
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
            background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            margin: 0;
            padding: 0;
            min-height: 100vh;
            color: var(--text-primary);
            line-height: 1.6;
        }

        .main-wrapper {
            padding: 1rem;
            max-width: 100vw;
            overflow-x: hidden;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            background: var(--bg-primary);
            border-radius: var(--border-radius-xl);
            padding: 2rem;
            box-shadow: var(--shadow-xl);
            border: 1px solid var(--border-color);
            position: relative;
            overflow: hidden;
        }

        .container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--secondary-color));
        }

        .header-section {
            text-align: center;
            margin-bottom: 3rem;
            padding: 2rem 1rem;
            background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
            border-radius: var(--border-radius-lg);
            border: 1px solid var(--border-color);
        }

        .logo-container {
            margin-bottom: 1.5rem;
        }

        .logo-container img {
            max-width: 100%;
            height: auto;
            filter: drop-shadow(var(--shadow-md));
        }

        .welcome-text {
            font-size: 1rem;
            color: var(--text-secondary);
            max-width: 800px;
            margin: 0 auto 2rem;
            background: var(--bg-primary);
            padding: 1.5rem;
            border-radius: var(--border-radius-md);
            box-shadow: var(--shadow-sm);
            border-left: 4px solid var(--primary-color);
        }

        .app-logo {
            margin: 1rem 0;
        }

        .instructions {
            background: var(--bg-primary);
            padding: 2rem;
            border-radius: var(--border-radius-lg);
            margin: 2rem 0;
            box-shadow: var(--shadow-md);
            border: 1px solid var(--border-color);
        }

        .instructions h3 {
            color: var(--primary-color);
            font-weight: 600;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .instructions h3::before {
            content: "💡";
            font-size: 1.2em;
        }

        .instruction-item {
            display: flex;
            align-items: flex-start;
            gap: 1rem;
            margin-bottom: 1rem;
            padding: 0.75rem;
            background: var(--bg-secondary);
            border-radius: var(--border-radius-md);
            transition: all 0.2s ease;
        }

        .instruction-item:hover {
            background: var(--bg-tertiary);
            transform: translateX(4px);
        }

        .instruction-number {
            background: var(--primary-color);
            color: white;
            width: 1.5rem;
            height: 1.5rem;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: 600;
            flex-shrink: 0;
        }

        .divider {
            height: 2px;
            background: linear-gradient(90deg, transparent, var(--border-color), transparent);
            margin: 2rem 0;
        }

        /* Modal Form Styles */
        #userForm {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(4px);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .modal-content {
            background: var(--bg-primary);
            padding: 2.5rem;
            border-radius: var(--border-radius-xl);
            text-align: center;
            width: 90%;
            max-width: 400px;
            box-shadow: var(--shadow-xl);
            border: 1px solid var(--border-color);
            animation: modalSlideIn 0.3s ease-out;
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translateY(-20px) scale(0.95);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .modal-content h1 {
            color: var(--primary-color);
            font-weight: 700;
            margin-bottom: 0.5rem;
        }

        .modal-content h2 {
            color: var(--secondary-color);
            font-weight: 600;
            margin-bottom: 1rem;
        }

        .form-group {
            margin-bottom: 1.5rem;
            text-align: left;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: var(--text-primary);
        }

        .form-group input {
            width: 100%;
            padding: 0.875rem;
            border: 2px solid var(--border-color);
            border-radius: var(--border-radius-md);
            font-size: 1rem;
            transition: all 0.2s ease;
            background: var(--bg-primary);
        }

        .form-group input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(3, 90, 42, 0.1);
        }

        /* File Upload Section */
        .file-upload-section {
            background: var(--bg-secondary);
            padding: 2rem;
            border-radius: var(--border-radius-lg);
            margin: 2rem 0;
            text-align: center;
            border: 2px dashed var(--border-color);
            transition: all 0.2s ease;
        }

        .file-upload-section:hover {
            border-color: var(--primary-color);
            background: var(--bg-tertiary);
        }

        .file-upload-section input[type="file"] {
            margin-bottom: 1rem;
            padding: 0.5rem;
        }

        /* Controls Section */
        .controls {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem;
            margin: 2rem 0;
            padding: 2rem;
            background: var(--bg-secondary);
            border-radius: var(--border-radius-lg);
            border: 1px solid var(--border-color);
        }

        .control-group {
            display: flex;
            flex-direction: column;
        }

        .control-group label {
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .control-group label::before {
            content: "⚙️";
        }

        .control-group select,
        .control-group input {
            padding: 0.875rem;
            border: 2px solid var(--border-color);
            border-radius: var(--border-radius-md);
            font-size: 1rem;
            background: var(--bg-primary);
            transition: all 0.2s ease;
            cursor: pointer;
        }

        .control-group select:focus,
        .control-group input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(3, 90, 42, 0.1);
        }

        .format-display {
            text-align: center;
            padding: 1rem;
            background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
            color: white;
            border-radius: var(--border-radius-md);
            margin: 1rem 0;
            font-weight: 600;
            box-shadow: var(--shadow-md);
        }

        .edge-total-container {
            text-align: center;
            margin: 2rem 0;
            padding: 1.5rem;
            background: linear-gradient(135deg, var(--success-color), #059669);
            color: white;
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-md);
        }

        .edge-total-container h3 {
            margin: 0 0 0.5rem 0;
            font-weight: 600;
        }

        #edge-total {
            font-size: 1.25rem;
            font-weight: 700;
        }

        /* Table Styles */
        .table-container {
            overflow-x: auto;
            margin: 2rem 0;
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-md);
            border: 1px solid var(--border-color);
        }

        table {
            width: 100%;
            border-collapse: collapse;
            background: var(--bg-primary);
            font-size: 0.9rem;
        }

        th {
            background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
            color: white;
            padding: 1rem 0.75rem;
            text-align: center;
            font-weight: 600;
            white-space: nowrap;
        }

        td {
            padding: 0.75rem;
            text-align: center;
            border-bottom: 1px solid var(--border-color);
            background: var(--bg-primary);
            transition: background-color 0.2s ease;
        }

        tbody tr:hover td {
            background: var(--bg-secondary);
        }

        td input,
        td select {
            width: 100%;
            padding: 0.5rem;
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius-sm);
            font-size: 0.9rem;
            background: var(--bg-primary);
            transition: all 0.2s ease;
        }

        td input:focus,
        td select:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(3, 90, 42, 0.1);
        }

        /* Button Styles */
        button {
            padding: 0.875rem 1.5rem;
            border: none;
            border-radius: var(--border-radius-md);
            cursor: pointer;
            font-size: 0.95rem;
            font-weight: 600;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            text-decoration: none;
            position: relative;
            overflow: hidden;
        }

        button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: left 0.5s ease;
        }

        button:hover::before {
            left: 100%;
        }

        .add-btn {
            background: linear-gradient(135deg, var(--success-color), #059669);
            color: white;
            box-shadow: var(--shadow-md);
        }

        .add-btn:hover {
            background: linear-gradient(135deg, #059669, #047857);
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .optimize-btn {
            background: linear-gradient(135deg, var(--secondary-color), #0284c7);
            color: white;
            box-shadow: var(--shadow-md);
        }

        .optimize-btn:hover {
            background: linear-gradient(135deg, #0284c7, #0369a1);
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .export-btn {
            background: linear-gradient(135deg, var(--accent-color), #d97706);
            color: white;
            box-shadow: var(--shadow-md);
        }

        .export-btn:hover {
            background: linear-gradient(135deg, #d97706, #b45309);
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        /* Button Actions Section */
        .button-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin: 2rem 0;
            justify-content: center;
        }

        /* Carousel Styles */
        .carousel {
            display: flex;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            gap: 2rem;
            padding: 2.5rem 1.5rem;
            background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
            border-radius: var(--border-radius-xl);
            margin: 3rem 0;
            border: 1px solid var(--border-color);
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
            position: relative;
        }

        .carousel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--secondary-color));
            border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
        }

        .carousel::-webkit-scrollbar {
            height: 10px;
        }

        .carousel::-webkit-scrollbar-track {
            background: var(--bg-tertiary);
            border-radius: 5px;
            margin: 0 1rem;
        }

        .carousel::-webkit-scrollbar-thumb {
            background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
            border-radius: 5px;
            border: 2px solid var(--bg-tertiary);
        }

        .carousel::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(90deg, var(--primary-dark), var(--primary-color));
        }

        .carousel canvas {
            flex: 0 0 auto;
            scroll-snap-align: center;
            border: 3px solid transparent;
            border-radius: var(--border-radius-xl);
            box-shadow: 
                0 10px 25px rgba(0, 0, 0, 0.1),
                0 4px 10px rgba(0, 0, 0, 0.05);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            background: linear-gradient(45deg, #ffffff, #f8fafc);
            position: relative;
        }

        .carousel canvas:hover {
            transform: translateY(-5px) scale(1.02);
            box-shadow: 
                0 20px 40px rgba(0, 0, 0, 0.15),
                0 8px 16px rgba(0, 0, 0, 0.1);
            border-color: var(--primary-light);
        }

        .carousel canvas:active {
            transform: translateY(-2px) scale(1.01);
        }

        /* Indicador de scroll para el carousel */
        .carousel-indicator {
            text-align: center;
            margin-top: 1rem;
            color: var(--text-secondary);
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .carousel-indicator::before {
            content: "👆";
        }

        .sheet-count {
            text-align: center;
            margin: 2rem 0;
            padding: 1rem;
            background: linear-gradient(135deg, var(--secondary-color), #0284c7);
            color: white;
            border-radius: var(--border-radius-md);
            font-size: 1.1rem;
            font-weight: 600;
            box-shadow: var(--shadow-md);
        }

        /* WhatsApp Button */
        .whatsapp-button {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            z-index: 100;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.05);
            }
        }

        .whatsapp-button a {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 60px;
            height: 60px;
            background: linear-gradient(135deg, #25D366, #20c55a);
            border-radius: 50%;
            box-shadow: var(--shadow-lg);
            text-decoration: none;
            transition: all 0.3s ease;
        }

        .whatsapp-button a:hover {
            transform: scale(1.1);
            box-shadow: var(--shadow-xl);
        }

        .whatsapp-button img {
            width: 30px;
            height: 30px;
        }

        .footer-text {
            text-align: center;
            margin-top: 3rem;
            padding: 1.5rem;
            color: var(--text-secondary);
            font-style: italic;
            background: var(--bg-secondary);
            border-radius: var(--border-radius-md);
            border: 1px solid var(--border-color);
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .main-wrapper {
                padding: 0.5rem;
            }
            
            .container {
                padding: 1rem;
                border-radius: var(--border-radius-md);
            }

            .header-section {
                padding: 1rem;
                margin-bottom: 2rem;
            }

            .welcome-text {
                font-size: 0.9rem;
                padding: 1rem;
            }

            .controls {
                grid-template-columns: 1fr;
                gap: 1rem;
                padding: 1rem;
            }

            .button-actions {
                flex-direction: column;
            }

            button {
                width: 100%;
                justify-content: center;
            }

            .carousel {
                padding: 1rem 0.5rem;
            }

            th, td {
                padding: 0.5rem 0.25rem;
                font-size: 0.8rem;
            }

            .whatsapp-button {
                bottom: 1rem;
                right: 1rem;
            }
        }

        @media (max-width: 480px) {
            .modal-content {
                padding: 1.5rem;
                margin: 1rem;
            }
            
            .table-container {
                font-size: 0.75rem;
            }
            
            td input,
            td select {
                padding: 0.25rem;
                font-size: 0.8rem;
            }
        }

        /* Loading animation for buttons */
        .loading {
            pointer-events: none;
            opacity: 0.7;
        }

        .loading::after {
            content: '';
            width: 16px;
            height: 16px;
            border: 2px solid transparent;
            border-top: 2px solid currentColor;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-left: 8px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        @keyframes bounce {
            0%, 100% { 
                transform: translateY(0); 
            }
            50% { 
                transform: translateY(-10px); 
            }
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
            20%, 40%, 60%, 80% { transform: translateX(5px); }
        }

        /* Custom scrollbar for the page */
        ::-webkit-scrollbar {
            width: 12px;
        }

        ::-webkit-scrollbar-track {
            background: var(--bg-secondary);
        }

        ::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 6px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--primary-dark);
        }