:root {
            --round-gold-bg: rgba(240, 130, 0, 0.08);
            --round-gold-border: rgba(240, 130, 0, 0.35);
            --round-gold-text: #d97700;
        }

        body {
            display: flex;
            flex-direction: column;
        }

        .workspace {
            display: flex;
            flex: 1;
            padding: 24px;
            padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
            gap: 24px;
            max-width: 1600px;
            margin: 0 auto;
            width: 100%;
            box-sizing: border-box;
        }

        /* --- Sidebar Lateral --- */
        .sidebar {
            flex: 0 0 320px;
            background: white;
            border-radius: var(--radius-md, 12px);
            padding: 24px;
            box-shadow: var(--shadow-md, 0 4px 10px rgba(0,0,0,0.05));
            height: fit-content;
            display: flex;
            flex-direction: column;
            gap: 20px;
            box-sizing: border-box;
            border-left: 5px solid var(--azul-caixa);
        }

        @media (max-width: 992px) {
            .workspace {
                flex-direction: column;
                padding: 16px;
                padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
                gap: 16px;
            }
            .sidebar {
                flex: none;
                width: 100%;
                padding: 18px;
            }
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .form-group label {
            font-size: 0.75rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            color: var(--azul-caixa);
        }

        .form-select {
            width: 100%;
            padding: 12px 38px 12px 16px;
            font-size: 0.95rem;
            font-weight: 600;
            border: 2px solid var(--borda, #e0e0e0);
            border-radius: var(--radius-sm, 8px);
            background-color: white;
            color: var(--texto, #333);
            outline: none;
            transition: all 0.25s ease;
            box-sizing: border-box;
            appearance: none;
            background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300366D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 15px center;
            background-size: 15px;
            cursor: pointer;
        }

        .form-select:focus {
            border-color: var(--laranja-caixa);
            box-shadow: 0 0 0 4px rgba(240, 130, 0, 0.15);
        }

        /* --- Painel de Limites --- */
        .limits-panel {
            background: var(--fundo-sutil);
            border: 1px solid var(--borda-sutil);
            border-radius: var(--radius-sm, 8px);
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
        }

        .limit-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.85rem;
            font-weight: 600;
            padding-bottom: 8px;
            border-bottom: 1px solid var(--fundo-hover);
        }

        .limit-row:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }

        .limit-label {
            color: #64748b;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .limit-value {
            color: var(--azul-caixa);
            font-weight: 700;
        }

        /* --- Conte├║do Principal --- */
        .content {
            flex: 1;
            background: white;
            border-radius: var(--radius-md, 12px);
            padding: 24px;
            box-shadow: var(--shadow-md, 0 4px 10px rgba(0,0,0,0.05));
            display: flex;
            flex-direction: column;
            gap: 20px;
            min-width: 0;
            box-sizing: border-box;
            border-left: 5px solid var(--laranja-caixa);
        }

        .matrix-container {
            flex: 1;
            overflow: auto;
            -webkit-overflow-scrolling: touch;
            border: 1px solid var(--borda, #e0e0e0);
            border-radius: 12px;
            position: relative;
            max-height: 72vh;
            max-height: 72dvh;
            background: white;
            box-shadow: inset 0 2px 8px rgba(0,0,0,0.02);
        }

        
        
        
        

        /* --- Estilo da Tabela --- */
        .matrix-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 4px;
            font-size: 0.9rem;
            text-align: center;
            padding: 12px;
        }

        .matrix-table th, .matrix-table td {
            padding: 10px 8px;
            border: none;
            min-width: 90px;
            height: 42px;
            box-sizing: border-box;
            border-radius: 8px;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .matrix-table th {
            background-color: var(--azul-caixa) !important;
            color: white !important;
            font-weight: 800;
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .matrix-table th.col-cota-header {
            position: sticky;
            left: 0;
            z-index: 11;
            background-color: var(--azul-claro) !important;
            color: white !important;
            box-shadow: 2px 0 8px rgba(0,0,0,0.1);
        }

        .matrix-table td.row-header {
            font-weight: 800;
            color: white !important;
            background-color: var(--azul-claro) !important;
            position: sticky;
            left: 0;
            z-index: 9;
            box-shadow: 2px 0 8px rgba(0,0,0,0.08);
        }

        /* --- Estados das C├®lulas --- */
        .cell-valid {
            background-color: rgba(40, 167, 69, 0.05);
            color: #218838;
            font-weight: 700;
            cursor: pointer;
            border: 1px solid rgba(40, 167, 69, 0.15);
        }

        @media (hover: hover) and (pointer: fine) {
            .cell-valid:hover {
                transform: translateY(-2px) scale(1.08);
                box-shadow: 0 6px 15px rgba(40, 167, 69, 0.2);
                z-index: 5;
                position: relative;
                background-color: #28a745 !important;
                color: white !important;
                border-color: #28a745 !important;
            }
        }

        .cell-round {
            background-color: var(--round-gold-bg) !important;
            color: var(--round-gold-text) !important;
            border: 1.5px dashed var(--round-gold-border) !important;
            font-weight: 800;
        }

        @media (hover: hover) and (pointer: fine) {
            .cell-round:hover {
                background-color: var(--laranja-caixa) !important;
                color: white !important;
                border-color: var(--laranja-caixa) !important;
                box-shadow: 0 6px 15px rgba(240, 130, 0, 0.25) !important;
            }
        }

        .cell-invalid {
            background-color: var(--fundo-sutil);
            color: #94a3b8;
            text-decoration: line-through;
            opacity: 0.45;
            font-size: 0.8rem;
            cursor: not-allowed;
            border: 1px solid var(--borda-sutil);
        }

        .cell-selected {
            background-color: var(--laranja-caixa) !important;
            color: white !important;
            border-color: var(--laranja-caixa) !important;
            box-shadow: 0 0 12px rgba(240, 130, 0, 0.4) !important;
            transform: scale(1.05);
            z-index: 4;
            position: relative;
        }

        /* --- Painel de Sele├º├úo/Detalhes (WhatsApp Card) --- */
        .detail-card {
            background: linear-gradient(135deg, var(--azul-caixa), #001f3f);
            color: white;
            padding: 24px;
            border-radius: var(--radius-md, 12px);
            box-shadow: var(--shadow-lg);
            display: none;
            flex-direction: column;
            gap: 12px;
            margin-top: 15px;
            border-top: 5px solid var(--laranja-caixa);
            animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

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

        .detail-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(255, 255, 255, 0.15);
            padding-bottom: 10px;
        }

        .detail-title {
            font-size: 1.1rem;
            font-weight: 800;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 16px;
            margin-top: 10px;
        }

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

        .detail-label {
            font-size: 0.7rem;
            opacity: 0.75;
            text-transform: uppercase;
            font-weight: 700;
            letter-spacing: 0.5px;
        }

        .detail-value {
            font-size: 1.1rem;
            font-weight: 700;
        }

        .btn-share {
            background: #25d366;
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 30px;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-top: 12px;
            align-self: flex-start;
            transition: all 0.2s ease;
            box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
        }

        .btn-share:hover {
            background: #1ebd56;
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
        }

        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #94a3b8;
            gap: 15px;
            padding: 60px 40px;
            text-align: center;
            font-weight: 600;
        }

        .empty-state i {
            font-size: 3rem;
            color: #cbd5e1;
        }

        /* --- Ajustes Globais no Header --- */
        .hub-header-right {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        @media (max-width: 600px) {
            .workspace {
                padding: 12px;
                padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
                gap: 12px;
            }
            .sidebar,
            .content {
                padding: 16px 14px;
            }
            .detail-card {
                padding: 16px;
            }
            .detail-header {
                flex-wrap: wrap;
                gap: 8px;
            }
            .detail-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 12px;
            }
            .detail-value {
                font-size: 1rem;
            }
            .btn-share {
                width: 100%;
                box-sizing: border-box;
            }
            .empty-state {
                padding: 36px 20px;
            }
        }
